Skip to content

Commit

Permalink
Method
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Oct 30, 2017
1 parent 21299b8 commit 91fbab3
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -192,7 +192,7 @@ assert getBitArrayForSeqNo(checkpoint + 1).get(seqNoToBitArrayOffset(checkpoint
* The checkpoint always falls in the current bit set or we have already cleaned it; if it falls on the last bit of the
* current bit set, we can clean it.
*/
if (checkpoint == (1 + bitArrayKey) * bitArraysSize - 1) {
if (checkpoint == lastSeqNoInBitArray(bitArrayKey)) {
assert current != null;
final FixedBitSet removed = processedSeqNo.remove(bitArrayKey);
assert removed == current;
Expand All @@ -205,6 +205,10 @@ assert getBitArrayForSeqNo(checkpoint + 1).get(seqNoToBitArrayOffset(checkpoint
}
}

private long lastSeqNoInBitArray(final long bitArrayKey) {
return (1 + bitArrayKey) * bitArraysSize - 1;
}

/**
* Return the bit array for the provided sequence number, possibly allocating a new array if needed.
*
Expand Down

0 comments on commit 91fbab3

Please sign in to comment.