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 2021/09/03 09:40:42 UTC

[GitHub] [pulsar] gaozhangmin commented on a change in pull request #11893: Admin cli support terminate a partitioned topic

gaozhangmin commented on a change in pull request #11893:
URL: https://github.com/apache/pulsar/pull/11893#discussion_r701751332



##########
File path: pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java
##########
@@ -650,6 +650,51 @@ public void failed(Throwable throwable) {
         return future;
     }
 
+    @Override
+    public List<MessageId> terminatePartitionedTopic(String topic) throws PulsarAdminException {
+        try {
+            return terminatePartitionedTopicAsync(topic).get(this.readTimeoutMs, TimeUnit.MILLISECONDS);
+        } catch (ExecutionException e) {
+            throw (PulsarAdminException) e.getCause();
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new PulsarAdminException(e);
+        } catch (TimeoutException e) {
+            throw new PulsarAdminException.TimeoutException(e);
+        }
+    }
+
+    @Override
+    public CompletableFuture<List<MessageId>> terminatePartitionedTopicAsync(String topic) {
+        TopicName tn = validateTopic(topic);
+
+        final CompletableFuture<List<MessageId>> future = new CompletableFuture<>();
+
+        try {
+            final WebTarget path = topicPath(tn, "terminate", "partitions");
+
+            request(path).async().post(Entity.entity("", MediaType.APPLICATION_JSON),

Review comment:
       After test added, I found the request would be stuck until timeout exception. From log, It requests rest api  `/{tenant}/{namespace}/{topic}/terminate/partitions` successfully, but doesn't return. I can't tell why. PTAL.
   
   @BewareMyPower  




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org