eolivelli commented on a change in pull request #9670:
URL: https://github.com/apache/pulsar/pull/9670#discussion_r580165968



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -1761,31 +1761,31 @@ public void seek(long timestamp) throws 
PulsarClientException {
         }
     }
 
-    @Override
-    public CompletableFuture<Void> seekAsync(long timestamp) {
+    private Optional<CompletableFuture<Void>> seekAsyncCheckState(String 
seekBy) {
         if (getState() == State.Closing || getState() == State.Closed) {
-            return FutureUtil
-                .failedFuture(new PulsarClientException.AlreadyClosedException(
-                    String.format("The consumer %s was already closed when 
seeking the subscription %s of the topic " +
-                        "%s to the timestamp %d", consumerName, subscription, 
topicName.toString(), timestamp)));
+            return Optional.of(FutureUtil
+                    .failedFuture(new 
PulsarClientException.AlreadyClosedException(
+                            String.format("The consumer %s was already closed 
when seeking the subscription %s of the"
+                                    + " topic %s to %s", consumerName, 
subscription, topicName.toString(), seekBy))));
         }
 
         if (!isConnected()) {
-            return FutureUtil.failedFuture(new PulsarClientException(
-                String.format("The client is not connected to the broker when 
seeking the subscription %s of the " +
-                    "topic %s to the timestamp %d", subscription, 
topicName.toString(), timestamp)));
+            return Optional.of(FutureUtil.failedFuture(new 
PulsarClientException(
+                    String.format("The client is not connected to the broker 
when seeking the subscription %s of the "
+                            + "topic %s to %s", subscription, 
topicName.toString(), seekBy))));
         }
 
-        final CompletableFuture<Void> seekFuture = new CompletableFuture<>();
+        return Optional.empty();
+    }
 
-        long requestId = client.newRequestId();
-        ByteBuf seek = Commands.newSeek(consumerId, requestId, timestamp);
+    private CompletableFuture<Void> seekAsyncFire(long requestId, ByteBuf 
seek, String seekBy) {

Review comment:
       what about `seekAsyncInternal` ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to