Skip to content

Commit

Permalink
fixed ManagedCursorTest.testBatchIndexesDeletionPersistAndRecover
Browse files Browse the repository at this point in the history
  • Loading branch information
dlg99 committed May 15, 2024
1 parent e004aeb commit 6d23bc5
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3076,20 +3076,19 @@ private List<MLDataFormats.BatchedEntryDeletionIndexInfo> buildBatchEntryDeletio
if (!config.isDeletionAtBatchIndexLevelEnabled() || batchDeletedIndexes.isEmpty()) {
return Collections.emptyList();
}
MLDataFormats.BatchedEntryDeletionIndexInfo batchDeletedIndexInfoBuilder = new MLDataFormats
.BatchedEntryDeletionIndexInfo();
List<MLDataFormats.BatchedEntryDeletionIndexInfo> result = new ArrayList<>();
Iterator<Map.Entry<PositionImpl, BitSetRecyclable>> iterator = batchDeletedIndexes.entrySet().iterator();
while (iterator.hasNext() && result.size() < config.getMaxBatchDeletedIndexToPersist()) {
Map.Entry<PositionImpl, BitSetRecyclable> entry = iterator.next();
MLDataFormats.BatchedEntryDeletionIndexInfo batchDeletedIndexInfoBuilder = new MLDataFormats
.BatchedEntryDeletionIndexInfo();
batchDeletedIndexInfoBuilder.setPosition()
.setLedgerId(entry.getKey().getLedgerId())
.setEntryId(entry.getKey().getEntryId());
long[] array = entry.getValue().toLongArray();
for (long l : array) {
batchDeletedIndexInfoBuilder.addDeleteSet(l);
}
batchDeletedIndexInfoBuilder.clearDeleteSet();
result.add(batchDeletedIndexInfoBuilder);
}
return result;
Expand Down

0 comments on commit 6d23bc5

Please sign in to comment.