You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/06/08 06:47:00 UTC

[GitHub] [pulsar] k2la commented on a change in pull request #7198: [pulsar-client-cpp] Support Seek on Partitioned Topic by Time

k2la commented on a change in pull request #7198:
URL: https://github.com/apache/pulsar/pull/7198#discussion_r436486338



##########
File path: pulsar-client-cpp/lib/PartitionedConsumerImpl.cc
##########
@@ -542,11 +542,27 @@ void PartitionedConsumerImpl::handleGetConsumerStats(Result res, BrokerConsumerS
 }
 
 void PartitionedConsumerImpl::seekAsync(const MessageId& msgId, ResultCallback callback) {
-    callback(ResultOperationNotSupported);
+    Lock stateLock(mutex_);
+    if (state_ != Ready) {
+        callback(ResultAlreadyClosed);
+        return;
+    }
+    stateLock.unlock();
+    for (ConsumerList::const_iterator i = consumers_.begin(); i != consumers_.end(); i++) {
+        (*i)->seekAsync(msgId, callback);

Review comment:
       I understood that.
   This PR decides to support only seeking on partitioned topic by time.




----------------------------------------------------------------
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:
users@infra.apache.org