public class ReaderImpl<T> extends Object implements Reader<T>
| Constructor and Description |
|---|
ReaderImpl(PulsarClientImpl client,
ReaderConfigurationData<T> readerConfiguration,
ExecutorService listenerExecutor,
CompletableFuture<Consumer<T>> consumerFuture,
Schema<T> schema) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<Void> |
closeAsync() |
ConsumerImpl<T> |
getConsumer() |
String |
getTopic() |
boolean |
hasMessageAvailable() |
CompletableFuture<Boolean> |
hasMessageAvailableAsync() |
boolean |
hasReachedEndOfTopic() |
boolean |
isConnected() |
Message<T> |
readNext() |
Message<T> |
readNext(int timeout,
TimeUnit unit) |
CompletableFuture<Message<T>> |
readNextAsync() |
void |
seek(long timestamp) |
void |
seek(MessageId messageId) |
CompletableFuture<Void> |
seekAsync(long timestamp) |
CompletableFuture<Void> |
seekAsync(MessageId messageId) |
public ReaderImpl(PulsarClientImpl client, ReaderConfigurationData<T> readerConfiguration, ExecutorService listenerExecutor, CompletableFuture<Consumer<T>> consumerFuture, Schema<T> schema)
public ConsumerImpl<T> getConsumer()
public boolean hasReachedEndOfTopic()
hasReachedEndOfTopic in interface Reader<T>public Message<T> readNext() throws PulsarClientException
readNext in interface Reader<T>PulsarClientExceptionpublic Message<T> readNext(int timeout, TimeUnit unit) throws PulsarClientException
readNext in interface Reader<T>PulsarClientExceptionpublic CompletableFuture<Message<T>> readNextAsync()
readNextAsync in interface Reader<T>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic CompletableFuture<Void> closeAsync()
closeAsync in interface Reader<T>public boolean hasMessageAvailable()
throws PulsarClientException
hasMessageAvailable in interface Reader<T>PulsarClientExceptionpublic CompletableFuture<Boolean> hasMessageAvailableAsync()
hasMessageAvailableAsync in interface Reader<T>public boolean isConnected()
isConnected in interface Reader<T>public void seek(MessageId messageId) throws PulsarClientException
seek in interface Reader<T>PulsarClientExceptionpublic void seek(long timestamp)
throws PulsarClientException
seek in interface Reader<T>PulsarClientExceptionpublic CompletableFuture<Void> seekAsync(MessageId messageId)
public CompletableFuture<Void> seekAsync(long timestamp)
Copyright © 2017–2020 Apache Software Foundation. All rights reserved.