From 22e8cb2aea76d61ae5dfd4703a6f2f65190260c3 Mon Sep 17 00:00:00 2001 From: Zike Yang Date: Mon, 25 Jul 2022 13:10:42 +0800 Subject: [PATCH] [doc][client] Add timestamp format description for seek method of the Consumer and Reader (#16648) ### Motivation There are many timestamp formats, we need to specify the required timestamp format for the seek method of the Consumer and Reader. ### Modifications * Add a description requiring the timestamp format should be Unix Time in milliseconds for the seek method of the Consumer and Reader. --- .../src/main/java/org/apache/pulsar/client/api/Consumer.java | 2 ++ .../src/main/java/org/apache/pulsar/client/api/Reader.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java index 3017cc2b4a0cc..be267982b23a4 100644 --- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java +++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java @@ -708,6 +708,7 @@ CompletableFuture reconsumeLaterCumulativeAsync(Message message, * * @param timestamp * the message publish time where to reposition the subscription + * The timestamp format should be Unix time in milliseconds. */ void seek(long timestamp) throws PulsarClientException; @@ -765,6 +766,7 @@ CompletableFuture reconsumeLaterCumulativeAsync(Message message, * * @param timestamp * the message publish time where to reposition the subscription + * The timestamp format should be Unix time in milliseconds. * @return a future to track the completion of the seek operation */ CompletableFuture seekAsync(long timestamp); diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Reader.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Reader.java index d972e58137d07..ba50883f0efc0 100644 --- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Reader.java +++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Reader.java @@ -153,6 +153,7 @@ public interface Reader extends Closeable { * the seek() on the individual partitions. * * @param timestamp the message publish time where to reposition the reader + * The timestamp format should be Unix time in milliseconds. */ void seek(long timestamp) throws PulsarClientException; @@ -212,6 +213,7 @@ public interface Reader extends Closeable { * * @param timestamp * the message publish time where to position the reader + * The timestamp format should be Unix time in milliseconds. * @return a future to track the completion of the seek operation */ CompletableFuture seekAsync(long timestamp);