Skip to content

Commit

Permalink
Fix broken main branch caused by wrong getBitSet method
Browse files Browse the repository at this point in the history
### Motivation

Currently the main branch is broken by the concurrent merge of
apache#153 and
apache#151.

### Modifications

Add a dummy `getBitSet` implementation to `BatchMessageAcker` and the
correct implementation for `BatchMessageAckerImpl`.
  • Loading branch information
BewareMyPower committed Jan 18, 2023
1 parent 06eab69 commit 3b6c1b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/BatchMessageAcker.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class BatchMessageAcker {
return prevBatchCumulativelyAcked_.compare_exchange_strong(expectedValue, true);
}

const BitSet& getBitSet() const noexcept { return bitSet_; }
virtual const BitSet& getBitSet() const noexcept {
static BitSet emptyBitSet;
return emptyBitSet;
}

private:
// When a batched message is acknowledged cumulatively, the previous message id will be acknowledged
Expand Down Expand Up @@ -80,6 +83,8 @@ class BatchMessageAckerImpl : public BatchMessageAcker {
return bitSet_.isEmpty();
}

const BitSet& getBitSet() const noexcept override { return bitSet_; }

private:
BitSet bitSet_;
mutable std::mutex mutex_;
Expand Down

0 comments on commit 3b6c1b3

Please sign in to comment.