public class SyncReaderImpl extends ReaderImpl implements SyncReader
ReaderImpl.ReadSessionImplid, isReconnecting, isStopped, reconnectCounter| Constructor and Description |
|---|
SyncReaderImpl(TopicRpc topicRpc,
ReaderSettings settings) |
| 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 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) |
void |
init()
Initialize reading in the background.
|
void |
initAndWait()
Initialize internal threads and wait for server init response.
|
Message |
receive(ReceiveSettings receiveSettings)
Receive a
Message. |
Message |
receiveInternal(ReceiveSettings receiveSettings,
long timeout,
TimeUnit unit) |
void |
shutdown()
Stops internal threads and makes cleanup in background.
|
getLogger, getStreamName, initImpl, onShutdown, onStreamReconnect, sendUpdateOffsetsInTransactiongenerateRandomId, onSessionClosed, shutdownImpl, shutdownImplclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreceive, receivepublic SyncReaderImpl(TopicRpc topicRpc, ReaderSettings settings)
public void init()
SyncReaderinit in interface SyncReaderpublic void initAndWait()
SyncReaderinitAndWait in interface SyncReader@Nullable public Message receiveInternal(ReceiveSettings receiveSettings, long timeout, TimeUnit unit) throws InterruptedException
InterruptedExceptionpublic Message receive(ReceiveSettings receiveSettings) throws InterruptedException
SyncReaderMessage. Blocks until a Message is received.receive in interface SyncReaderreceiveSettings - settings for receiving a MessageMessage, or null if the specified timeout time elapses before a message is availableInterruptedExceptionprotected 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 ReaderImplpublic void shutdown()
SyncReadershutdown in interface SyncReaderCopyright © 2025. All rights reserved.