@@ -283,6 +283,16 @@ namespace NYdb::NConsoleClient {
283
283
return EXIT_SUCCESS;
284
284
}
285
285
286
+ int TTopicReader::HandleEndPartitionSessionEvent (NTopic::TReadSessionEvent::TEndPartitionSessionEvent *event) {
287
+ if (!HasSession (event->GetPartitionSession ()->GetPartitionSessionId ())) {
288
+ return EXIT_SUCCESS;
289
+ }
290
+
291
+ event->Confirm ();
292
+
293
+ return EXIT_SUCCESS;
294
+ }
295
+
286
296
int TTopicReader::HandleEvent (NYdb::NTopic::TReadSessionEvent::TEvent& event, IOutputStream& output) {
287
297
if (auto * dataEvent = std::get_if<NTopic::TReadSessionEvent::TDataReceivedEvent>(&event)) {
288
298
return HandleDataReceivedEvent (dataEvent, output);
@@ -292,10 +302,12 @@ namespace NYdb::NConsoleClient {
292
302
return HandleCommitOffsetAcknowledgementEvent (commitEvent);
293
303
} else if (auto * partitionStatusEvent = std::get_if<NTopic::TReadSessionEvent::TPartitionSessionStatusEvent>(&event)) {
294
304
return HandlePartitionSessionStatusEvent (partitionStatusEvent);
295
- } else if (auto * stopPartitionSessionEvent = std::get_if<NTopic::TReadSessionEvent::TStopPartitionSessionEvent>(&event)) {
305
+ } else if (auto * stopPartitionSessionEvent = std::get_if<NTopic::TReadSessionEvent::TStopPartitionSessionEvent>(&event)) {
296
306
return HandleStopPartitionSessionEvent (stopPartitionSessionEvent);
297
307
} else if (auto * partitionSessionClosedEvent = std::get_if<NTopic::TReadSessionEvent::TPartitionSessionClosedEvent>(&event)) {
298
308
return HandlePartitionSessionClosedEvent (partitionSessionClosedEvent);
309
+ } else if (auto * endPartitionSessionEvent = std::get_if<NTopic::TReadSessionEvent::TEndPartitionSessionEvent>(&event)) {
310
+ return HandleEndPartitionSessionEvent (endPartitionSessionEvent);
299
311
} else if (auto * sessionClosedEvent = std::get_if<NTopic::TSessionClosedEvent>(&event)) {
300
312
ThrowOnError (*sessionClosedEvent);
301
313
return 1 ;
@@ -339,4 +351,4 @@ namespace NYdb::NConsoleClient {
339
351
}
340
352
return EXIT_SUCCESS;
341
353
}
342
- } // namespace NYdb::NConsoleClient
354
+ } // namespace NYdb::NConsoleClient
0 commit comments