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_r379154997
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
 ##########
 @@ -103,22 +114,48 @@ public void addAcknowledgment(MessageIdImpl msgId, 
AckType ackType, Map<String,
             // uncommon condition since it's only used for the compaction 
subscription.
             doImmediateAck(msgId, ackType, properties);
         } else if (ackType == AckType.Cumulative) {
-            doCumulativeAck(msgId);
+            doCumulativeAck(msgId, null);
         } else {
             // Individual ack
             pendingIndividualAcks.add(msgId);
+            pendingIndividualBatchIndexAcks.remove(msgId);
             if (pendingIndividualAcks.size() >= MAX_ACK_GROUP_SIZE) {
                 flush();
             }
         }
     }
 
-    private void doCumulativeAck(MessageIdImpl msgId) {
+    @Override
+    public void addBatchIndexAcknowledgment(BatchMessageIdImpl msgId, int 
batchIndex, int batchSize, AckType ackType, Map<String, Long> properties) {
+        if (acknowledgementGroupTimeMicros == 0 || !properties.isEmpty()) {
+            doImmediateBatchIndexAck(msgId, batchIndex, batchSize, ackType, 
properties);
+        } else if (ackType == AckType.Cumulative) {
+            ConcurrentBitSet bitSet = new ConcurrentBitSet(batchSize);
 
 Review comment:
   Why do we need a concurrent bit set?

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