Handle all available references in the DataStore when doing consistency check
skip handling specific to SharedDataStore when the BlobStore is not a SharedDataStore
@@ -688,8 +688,9 @@ public class MarkSweepGarbageCollector implements BlobGarbageCollector {
}
// Retrieve all other marked present in the datastore
- List<DataRecord> refFiles =
- ((SharedDataStore) blobStore).getAllMetadataRecords(SharedStoreRecordType.REFERENCES.getType());
+ if (blobStore instanceof SharedDataStore) {
+ List<DataRecord> refFiles = ((SharedDataStore) blobStore)
+ .getAllMetadataRecords(SharedStoreRecordType.REFERENCES.getType());
if (refFiles.size() > 0) {
File temp = new File(root, repoId + UUID.randomUUID().toString());
copyFile(fs.getMarkedRefs(), temp);
@@ -703,6 +704,7 @@ public class MarkSweepGarbageCollector implements BlobGarbageCollector {
}
merge(files, fs.getMarkedRefs());
}
+ }
LOG.trace("Starting difference phase of the consistency check");
FileLineDifferenceIterator iter = new FileLineDifferenceIterator(
