@@ -1720,35 +1720,16 @@ void TReadSessionActor<UseMigrationProtocol>::Handle(TEvPQProxy::TEvRead::TPtr&
1720
1720
ProcessReads (ctx);
1721
1721
}
1722
1722
1723
-
1724
1723
template <typename TServerMessage>
1725
1724
i64 TFormedReadResponse<TServerMessage>::ApplyResponse (TServerMessage&& resp) {
1726
1725
constexpr bool UseMigrationProtocol = std::is_same_v<TServerMessage, PersQueue::V1::MigrationStreamingReadServerMessage>;
1727
1726
1728
1727
if constexpr (UseMigrationProtocol) {
1729
- auto * partition_data = resp.mutable_data_batch ()->mutable_partition_data (0 );
1730
- Y_ABORT_UNLESS (partition_data != nullptr && partition_data->batches_size () > 0 );
1731
-
1732
- for (auto & batch : *partition_data->mutable_batches ()) {
1733
- for (auto & message_data : *batch.mutable_message_data ()) {
1734
- if (message_data.codec () == Ydb::PersQueue::V1::CODEC_UNSPECIFIED) {
1735
- message_data.set_codec (Ydb::PersQueue::V1::CODEC_RAW);
1736
- }
1737
- }
1738
- }
1739
-
1740
- Response.mutable_data_batch ()->add_partition_data ()->Swap (partition_data);
1728
+ Y_ABORT_UNLESS (resp.data_batch ().partition_data_size () == 1 );
1729
+ Response.mutable_data_batch ()->add_partition_data ()->Swap (resp.mutable_data_batch ()->mutable_partition_data (0 ));
1741
1730
} else {
1742
- auto * partition_data = resp.mutable_read_response ()->mutable_partition_data (0 );
1743
- Y_ABORT_UNLESS (partition_data != nullptr && partition_data->batches_size () > 0 );
1744
-
1745
- for (auto & batch : *partition_data->mutable_batches ()) {
1746
- if (batch.codec () == Ydb::Topic::CODEC_UNSPECIFIED) {
1747
- batch.set_codec (Ydb::Topic::CODEC_RAW);
1748
- }
1749
- }
1750
-
1751
- Response.mutable_read_response ()->add_partition_data ()->Swap (partition_data);
1731
+ Y_ABORT_UNLESS (resp.read_response ().partition_data_size () == 1 );
1732
+ Response.mutable_read_response ()->add_partition_data ()->Swap (resp.mutable_read_response ()->mutable_partition_data (0 ));
1752
1733
}
1753
1734
1754
1735
Response.set_status (Ydb::StatusIds::SUCCESS);
@@ -1759,7 +1740,6 @@ i64 TFormedReadResponse<TServerMessage>::ApplyResponse(TServerMessage&& resp) {
1759
1740
}
1760
1741
1761
1742
1762
-
1763
1743
template <typename TServerMessage>
1764
1744
i64 TFormedReadResponse<TServerMessage>::ApplyDirectReadResponse (TEvPQProxy::TEvDirectReadResponse::TPtr& ev) {
1765
1745
@@ -1776,7 +1756,6 @@ i64 TFormedReadResponse<TServerMessage>::ApplyDirectReadResponse(TEvPQProxy::TEv
1776
1756
return diff;
1777
1757
}
1778
1758
1779
-
1780
1759
template <bool UseMigrationProtocol>
1781
1760
void TReadSessionActor<UseMigrationProtocol>::Handle (typename TEvReadResponse::TPtr& ev, const TActorContext& ctx) {
1782
1761
if (!ActualPartitionActors.contains (ev->Sender )) {
0 commit comments