sijie commented on a change in pull request #6052: [PIP-54] Acknowledgement for 
batch message local index
URL: https://github.com/apache/pulsar/pull/6052#discussion_r379157708
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
 ##########
 @@ -57,23 +62,29 @@
      * Latest cumulative ack sent to broker
      */
     private volatile MessageIdImpl lastCumulativeAck = (MessageIdImpl) 
MessageId.earliest;
+    private volatile ConcurrentBitSet lastCumulativeAckSet = null;
     private volatile boolean cumulativeAckFlushRequired = false;
 
     private static final 
AtomicReferenceFieldUpdater<PersistentAcknowledgmentsGroupingTracker, 
MessageIdImpl> LAST_CUMULATIVE_ACK_UPDATER = AtomicReferenceFieldUpdater
             .newUpdater(PersistentAcknowledgmentsGroupingTracker.class, 
MessageIdImpl.class, "lastCumulativeAck");
+    private static final 
AtomicReferenceFieldUpdater<PersistentAcknowledgmentsGroupingTracker, 
ConcurrentBitSet> LAST_CUMULATIVE_ACK_SET_UPDATER = AtomicReferenceFieldUpdater
+        .newUpdater(PersistentAcknowledgmentsGroupingTracker.class, 
ConcurrentBitSet.class, "lastCumulativeAckSet");
+
 
     /**
      * This is a set of all the individual acks that the application has 
issued and that were not already sent to
      * broker.
      */
     private final ConcurrentSkipListSet<MessageIdImpl> pendingIndividualAcks;
+    private final ConcurrentHashMap<MessageIdImpl, ConcurrentBitSet> 
pendingIndividualBatchIndexAcks;
 
 Review comment:
   bookkeeper has a pretty efficient AckSet / WriteSet implementation that can 
avoid producing a lot of garbages. I think we should leverage the 
implementation there - 
https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RoundRobinDistributionSchedule.java#L76

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