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

 ##########
 File path: 
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/TransactionMetadataStore.java
 ##########
 @@ -61,41 +72,80 @@
     CompletableFuture<TxnID> newTransaction();
 
     /**
-     * Add the produced partitions to transaction identified by <tt>txnid</tt>.
+     * Create a new transaction in the transaction metadata store.
      *
-     * @param txnid transaction id
+     * @param timeOut the timeout time
+     * @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(long timeOut);
+
+    /**
+     * Add the produced partitions to transaction identified by <tt>txnId</tt>.
+     *
+     * @param txnID {@link TxnID} for add produced partition to transaction
      * @param partitions the list of partitions that a transaction produces to
      * @return a future represents the result of this operation
      */
     CompletableFuture<Void> addProducedPartitionToTxn(
-        TxnID txnid, List<String> partitions);
+        TxnID txnID, List<String> partitions);
+
+    /**
+     * Add the acked subscriptions to transaction identified by <tt>txnId</tt>.
+     *
+     * @param txnID {@link TxnID} for add acked subscription
+     * @param txnSubscriptions the list of subscriptions that a transaction 
ack to
+     * @return a future represents the result of this operation
+     */
+    CompletableFuture<Void> addAckedSubscriptionToTxn(
+            TxnID txnID, List<TxnSubscription> txnSubscriptions);
 
     /**
-     * Add the acked partitions to transaction identified by <tt>txnid</tt>.
+     * Add the acked partitions to transaction identified by <tt>txnId</tt>.
      *
-     * @param txnid transaction id
+     * @param txnID {@link TxnID} for add acked partition
      * @param partitions the list of partitions that a transaction acknowledge 
to
      * @return a future represents the result of the operation
      */
     CompletableFuture<Void> addAckedPartitionToTxn(
-        TxnID txnid, List<String> partitions);
+        TxnID txnID, List<String> partitions);
 
     /**
      * Update the transaction from <tt>expectedStatus</tt> to 
<tt>newStatus</tt>.
      *
      * <p>If the current transaction status is not <tt>expectedStatus</tt>, the
      * update will be failed.
      *
+     * @param txnID {@link TxnID} for update txn status
      * @param newStatus the new txn status that the transaction should be 
updated to
      * @param expectedStatus the expected status that the transaction should be
      * @return a future represents the result of the operation
      */
     CompletableFuture<Void> updateTxnStatus(
-        TxnID txnid, TxnStatus newStatus, TxnStatus expectedStatus);
+        TxnID txnID, TxnStatus newStatus, TxnStatus expectedStatus);
 
     /**
      * Close the transaction metadata store.
+     *
+     * @return a future represents the result of this operation
      */
     CompletableFuture<Void> closeAsync();
 
+    /**
+     * Update the {@link State}.
+     *
+     * @param state the transaction metadata store state {@link State}
+     * @return a future represents the result of this operation
+     */
+    CompletableFuture<Void> updateMetadataStoreState(State state);
+
+    /**
+     * Set the txn sequenceId.
+     *
+     * @param sequenceId the transaction sequenceId for new transaction Id
+     * @return a future represents the result of this operation
+     */
+    CompletableFuture<Void> setTxnSequenceId(long sequenceId);
+
 
 Review comment:
   Shall we need to expose these method in TransactionMetadataStore interface?

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