use of org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter in project ozone by apache.
the class TestStorageContainerManagerHelper method getPendingDeletionBlocks.
public List<String> getPendingDeletionBlocks(Long containerID) throws IOException {
List<String> pendingDeletionBlocks = Lists.newArrayList();
ReferenceCountedDB meta = getContainerMetadata(containerID);
KeyPrefixFilter filter = new KeyPrefixFilter().addFilter(OzoneConsts.DELETING_KEY_PREFIX);
List<? extends Table.KeyValue<String, BlockData>> kvs = meta.getStore().getBlockDataTable().getRangeKVs(null, Integer.MAX_VALUE, filter);
for (Table.KeyValue<String, BlockData> entry : kvs) {
pendingDeletionBlocks.add(entry.getKey().replace(OzoneConsts.DELETING_KEY_PREFIX, ""));
}
meta.close();
return pendingDeletionBlocks;
}
Aggregations