amit-jain commented on code in PR #771:
URL: https://github.com/apache/jackrabbit-oak/pull/771#discussion_r1036694328
##########
oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java:
##########
@@ -405,13 +405,35 @@ protected void mark(GarbageCollectorFileState fs) throws
IOException, DataStoreE
// Mark all used references
iterateNodeTree(fs, false);
-
+
+ // Get size
+ sizeBlobStoreReferences(fs, stats);
+
// Move the marked references file to the data store meta area if
applicable
GarbageCollectionType.get(blobStore).addMarked(blobStore, fs, repoId,
uniqueSuffix);
LOG.debug("Ending mark phase of the garbage collector");
}
+ private static void sizeBlobStoreReferences(GarbageCollectorFileState fs,
GarbageCollectionOperationStats stats)
+ throws IOException {
+ try (LineIterator lineIterator = new LineIterator(new
FileReader(fs.getMarkedRefs()))) {
+ lineIterator.forEachRemaining(line -> {
+ String id = line.split(DELIM)[0];
+ long length = DataStoreBlobStore.BlobId.of(id).getLength();
+ LOG.info("Blob {} has size {}", id, length);
+
+ stats.getCollector().updateNumBlobReferences(1);
Review Comment:
I pushed a few changes to the naming but left these as I see the earlier
ones are also named update.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]