poorbarcode commented on code in PR #21406:
URL: https://github.com/apache/pulsar/pull/21406#discussion_r1707262568
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:
##########
@@ -89,7 +91,11 @@ public class TopicTransactionBuffer extends
TopicTransactionBufferState implemen
private final int takeSnapshotIntervalTime;
+ @Getter
Review Comment:
Is this `@Getter` is only for the test?
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:
##########
@@ -255,6 +231,42 @@ public long getCommittedTxnCount() {
@Override
public CompletableFuture<Position> appendBufferToTxn(TxnID txnId, long
sequenceId, ByteBuf buffer) {
+ buffer.retain();
Review Comment:
I am confusing why it will be released. Could you talk a little bit about
its life cycle to help us understand why we need this retain?
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/TransactionBuffer.java:
##########
@@ -187,14 +187,13 @@ public interface TransactionBuffer {
TransactionBufferStats getStats(boolean lowWaterMarks);
/**
- * Wait TransactionBuffer Recovers completely.
- * Take snapshot after TB Recovers completely.
- * @param isTxn
- * @return a future which has completely if isTxn = false. Or a future
return by takeSnapshot.
+ * Wait TransactionBuffer recovers completely.
+ *
+ * @return a future that will be completed after the transaction buffer
recover completely.
*/
- CompletableFuture<Void> checkIfTBRecoverCompletely(boolean isTxn);
-
-
+ default CompletableFuture<Void> checkIfTBRecoverCompletely() {
Review Comment:
Seems all the `3` implementations have been implemented this method, I think
we can remove this change
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]