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 2019/08/22 02:12:44 UTC

[GitHub] [pulsar] zymap commented on a change in pull request #4993: [Transaction] handle command send with transaction messages

zymap commented on a change in pull request #4993: [Transaction] handle command send with transaction messages
URL: https://github.com/apache/pulsar/pull/4993#discussion_r316471795
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
 ##########
 @@ -700,6 +706,48 @@ void removeSubscription(String subscriptionName) {
         return delete(false, true, false);
     }
 
+    @Override
+    public CompletableFuture<TransactionBuffer> getTxnBuffer(boolean createIfAbsent) {
+        if (buffer.isPresent()) {
+            return CompletableFuture.completedFuture(buffer.get());
+        }
+        if (createIfAbsent) {
+            return createTransactionBuffer(createIfAbsent);
+        }
+        return FutureUtil.failedFuture(new TransactionBufferNotExistOnTopicException("Not found transaction buffer"));
+    }
+
+    private CompletableFuture<TransactionBuffer> createTransactionBuffer(boolean createIfAbsent) {
+        TopicName topicName = TopicName.get(topic);
+        String txnTopic = topic + "_txnlog";
 
 Review comment:
   Yeah. I will add it.

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


With regards,
Apache Git Services