nlu90 commented on code in PR #15178:
URL: https://github.com/apache/pulsar/pull/15178#discussion_r853420106
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TableViewImpl.java:
##########
@@ -224,9 +224,23 @@ private CompletableFuture<Reader<T>> newReader(String
partition) {
.readCompacted(true)
.poolMessages(true)
.createAsync()
+ .thenCompose(this::cacheNewReader)
.thenCompose(this::readAllExistingMessages);
}
+ private CompletableFuture<Reader<T>> cacheNewReader(Reader<T> reader) {
+ CompletableFuture<Reader<T>> future = new CompletableFuture<>();
+ if (this.readers.containsKey(reader.getTopic())) {
Review Comment:
This is safe-guard condition to make the future finish in both cases and for
code completeness
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]