public class AsyncReaderImpl extends ReaderImpl implements AsyncReader
ReaderImpl.ReadSessionImplid, isReconnecting, isStopped, reconnectCounter| Constructor and Description |
|---|
AsyncReaderImpl(TopicRpc topicRpc,
ReaderSettings settings,
ReadEventHandlersSettings handlersSettings) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleClosePartitionSession(PartitionSession partitionSession) |
protected void |
handleCommitResponse(long committedOffset,
PartitionSession partitionSession) |
protected CompletableFuture<Void> |
handleDataReceivedEvent(DataReceivedEvent event) |
protected CompletableFuture<Void> |
handleReaderClosed() |
protected void |
handleStartPartitionSessionRequest(tech.ydb.proto.topic.YdbTopic.StreamReadMessage.StartPartitionSessionRequest request,
PartitionSession partitionSession,
Consumer<StartPartitionSessionSettings> confirmCallback) |
protected void |
handleStopPartitionSession(tech.ydb.proto.topic.YdbTopic.StreamReadMessage.StopPartitionSessionRequest request,
PartitionSession partitionSession,
Runnable confirmCallback) |
CompletableFuture<Void> |
init()
Initialize reading in the background.
|
protected void |
onShutdown(String reason) |
CompletableFuture<Void> |
shutdown()
Stops internal threads and makes cleanup in background.
|
CompletableFuture<Status> |
updateOffsetsInTransaction(YdbTransaction transaction,
Map<String,List<PartitionOffsets>> offsets,
UpdateOffsetsInTransactionSettings settings)
Add offsets to transaction.
|
getLogger, getStreamName, initImpl, onStreamReconnect, sendUpdateOffsetsInTransactiongenerateRandomId, onSessionClosed, shutdownImpl, shutdownImplclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupdateOffsetsInTransactionpublic AsyncReaderImpl(TopicRpc topicRpc, ReaderSettings settings, ReadEventHandlersSettings handlersSettings)
public CompletableFuture<Void> init()
AsyncReaderinit in interface AsyncReaderpublic CompletableFuture<Status> updateOffsetsInTransaction(YdbTransaction transaction, Map<String,List<PartitionOffsets>> offsets, UpdateOffsetsInTransactionSettings settings)
AsyncReaderupdateOffsetsInTransaction in interface AsyncReadertransaction - a YdbTransaction that offsets should be added to.
Transaction has to be active.offsets - Offsets that should be added to transaction.
Map key: topic Path
Map value: List of Partition ranges for every partition in this topic to addsettings - Operation settings.CompletableFuture to operation statusprotected CompletableFuture<Void> handleDataReceivedEvent(DataReceivedEvent event)
handleDataReceivedEvent in class ReaderImplprotected void handleCommitResponse(long committedOffset,
PartitionSession partitionSession)
handleCommitResponse in class ReaderImplprotected void handleStartPartitionSessionRequest(tech.ydb.proto.topic.YdbTopic.StreamReadMessage.StartPartitionSessionRequest request,
PartitionSession partitionSession,
Consumer<StartPartitionSessionSettings> confirmCallback)
handleStartPartitionSessionRequest in class ReaderImplprotected void handleStopPartitionSession(tech.ydb.proto.topic.YdbTopic.StreamReadMessage.StopPartitionSessionRequest request,
PartitionSession partitionSession,
Runnable confirmCallback)
handleStopPartitionSession in class ReaderImplprotected void handleClosePartitionSession(PartitionSession partitionSession)
handleClosePartitionSession in class ReaderImplprotected CompletableFuture<Void> handleReaderClosed()
protected void onShutdown(String reason)
onShutdown in class ReaderImplpublic CompletableFuture<Void> shutdown()
AsyncReadershutdown in interface AsyncReaderCopyright © 2025. All rights reserved.