Skip to content

Commit

Permalink
[hotfix] Fix RocksDB resource handling in RocksKeyGroupsRocksSingleSt…
Browse files Browse the repository at this point in the history
…ateIteratorTest
  • Loading branch information
aljoscha authored and dawidwys committed Feb 5, 2021
1 parent f56021c commit f63b9ad
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,21 @@ public void testMergeIterator(int maxParallelism) throws Exception {
totalKeysExpected += numKeys;
}

CloseableRegistry closeableRegistry = new CloseableRegistry();
int id = 0;
for (Tuple2<ColumnFamilyHandle, Integer> columnFamilyHandle :
columnFamilyHandlesWithKeyCount) {
rocksIteratorsWithKVStateId.add(
new Tuple2<>(
RocksDBOperationUtils.getRocksIterator(
rocksDB, columnFamilyHandle.f0, readOptions),
id));
RocksIteratorWrapper rocksIterator =
RocksDBOperationUtils.getRocksIterator(
rocksDB, columnFamilyHandle.f0, readOptions);
closeableRegistry.registerCloseable(rocksIterator);
rocksIteratorsWithKVStateId.add(new Tuple2<>(rocksIterator, id));
++id;
}

try (RocksStatesPerKeyGroupMergeIterator mergeIterator =
new RocksStatesPerKeyGroupMergeIterator(
new CloseableRegistry(),
closeableRegistry,
rocksIteratorsWithKVStateId,
maxParallelism <= Byte.MAX_VALUE ? 1 : 2)) {

Expand Down

0 comments on commit f63b9ad

Please sign in to comment.