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

 ##########
 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:
   I thought we are going to introduce a new `transaction` domain?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to