codelipenghui commented on a change in pull request #5570: Transaction log 
implemention
URL: https://github.com/apache/pulsar/pull/5570#discussion_r350021225
 
 

 ##########
 File path: 
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/TransactionMetadataStore.java
 ##########
 @@ -32,70 +33,82 @@
 public interface TransactionMetadataStore {
 
     /**
-     * Query the {@link TxnStatus} of a given transaction <tt>txnid</tt>.
+     * Query the {@link TxnStatus} of a given transaction <tt>txnId</tt>.
      *
-     * @param txnid transaction id
+     * @param txnID {@link TxnID} for get transaction status
      * @return a future represents the result of this operation.
      *         it returns {@link TxnStatus} of the given transaction.
      */
-    default CompletableFuture<TxnStatus> getTxnStatus(TxnID txnid) {
-        return getTxnMeta(txnid).thenApply(txnMeta -> txnMeta.status());
+    default CompletableFuture<TxnStatus> getTxnStatus(TxnID txnID) {
+        return getTxnMetaAsync(txnID).thenApply(TxnMeta::status);
     }
 
     /**
      * Query the {@link TxnMeta} of a given transaction <tt>txnid</tt>.
      *
-     * @param txnid transaction id
+     * @param txnID {@link TxnID} for get transaction metadata
      * @return a future represents the result of this operation.
      *         it returns {@link TxnMeta} of the given transaction.
      */
-    CompletableFuture<TxnMeta> getTxnMeta(TxnID txnid);
+    CompletableFuture<TxnMeta> getTxnMetaAsync(TxnID txnID);
+
+    /**
+     * Create a new transaction in the transaction metadata store.
+     *
+     * @return a future represents the result of creating a new transaction.
+     *         it returns {@link TxnID} as the identifier for identifying the
+     *         transaction.
+     */
+    CompletableFuture<TxnID> newTransactionAsync();
 
     /**
      * Create a new transaction in the transaction metadata store.
      *
+     * @param timeOut the timeout duration of the transaction in mills
      * @return a future represents the result of creating a new transaction.
      *         it returns {@link TxnID} as the identifier for identifying the
      *         transaction.
      */
-    CompletableFuture<TxnID> newTransaction();
+    CompletableFuture<TxnID> newTransactionAsync(long timeOut);
 
 Review comment:
   If the param timeOut use mills as time unit, please name it timeoutInMills.

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


With regards,
Apache Git Services

Reply via email to