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/05/26 00:01:43 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #10650: [Transactionn] Transaction admin api component in topic status

codelipenghui commented on a change in pull request #10650:
URL: https://github.com/apache/pulsar/pull/10650#discussion_r639309938



##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java
##########
@@ -84,6 +109,8 @@ void run() throws Exception {
     public CmdTransactions(Supplier<PulsarAdmin> admin) {
         super("transactions", admin);
         jcommander.addCommand("coordinator-status", new GetCoordinatorStatus());
+        jcommander.addCommand("transaction-buffer-status", new GetTransactionBufferStatus());

Review comment:
       ```suggestion
           jcommander.addCommand("transaction-buffer-stats", new GetTransactionBufferStats());
   ```

##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/TransactionPendingAckStatus.java
##########
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.common.policies.data;
+
+public class TransactionPendingAckStatus {

Review comment:
       ```suggestion
   public class TransactionPendingAckStats {
   ```

##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/TransactionBufferStatus.java
##########
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.common.policies.data;
+
+public class TransactionBufferStatus {

Review comment:
       ```suggestion
   public class TransactionBufferStats {
   ```

##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java
##########
@@ -84,6 +109,8 @@ void run() throws Exception {
     public CmdTransactions(Supplier<PulsarAdmin> admin) {
         super("transactions", admin);
         jcommander.addCommand("coordinator-status", new GetCoordinatorStatus());
+        jcommander.addCommand("transaction-buffer-status", new GetTransactionBufferStatus());
+        jcommander.addCommand("pending-ack-status", new GetPendingAckStatus());

Review comment:
       ```suggestion
           jcommander.addCommand("pending-ack-stats", new GetPendingAckStats());
   ```

##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java
##########
@@ -42,6 +42,31 @@ void run() throws Exception {
         }
     }
 
+    @Parameters(commandDescription = "Get transaction buffer status")
+    private class GetTransactionBufferStatus extends CliCommand {

Review comment:
       ```suggestion
       private class GetTransactionBufferStats extends CliCommand {
   ```

##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java
##########
@@ -42,6 +42,31 @@ void run() throws Exception {
         }
     }
 
+    @Parameters(commandDescription = "Get transaction buffer status")
+    private class GetTransactionBufferStatus extends CliCommand {
+        @Parameter(names = {"-t", "--topic"}, description = "the topic", required = true)
+        private String topic;
+
+        @Override
+        void run() throws Exception {
+            print(getAdmin().transactions().getTransactionBufferStatus(topic));
+        }
+    }
+
+    @Parameters(commandDescription = "Get transaction pending ack status")
+    private class GetPendingAckStatus extends CliCommand {

Review comment:
       ```suggestion
       private class GetPendingAckStats extends CliCommand {
   ```




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