Class MarkSweepGarbageCollector

  • All Implemented Interfaces:
    BlobGarbageCollector

    public class MarkSweepGarbageCollector
    extends Object
    implements BlobGarbageCollector
    Mark and sweep garbage collector. Uses the file system to store internal state while in process to account for huge data. This class is not thread safe.
    • Constructor Detail

      • MarkSweepGarbageCollector

        public MarkSweepGarbageCollector​(BlobReferenceRetriever marker,
                                         GarbageCollectableBlobStore blobStore,
                                         Executor executor,
                                         String root,
                                         int batchCount,
                                         long maxLastModifiedInterval,
                                         boolean checkConsistencyAfterGc,
                                         boolean sweepIfRefsPastRetention,
                                         @Nullable
                                         @Nullable String repositoryId,
                                         @Nullable
                                         @Nullable Whiteboard whiteboard,
                                         @Nullable
                                         @Nullable StatisticsProvider statisticsProvider)
                                  throws IOException
        Creates an instance of MarkSweepGarbageCollector
        Parameters:
        marker - BlobReferenceRetriever instanced used to fetch refereed blob entries
        blobStore - the blob store instance
        executor - executor
        root - the root absolute path of directory under which temporary files would be created
        batchCount - batch sized used for saving intermediate state
        maxLastModifiedInterval - lastModifiedTime in millis. Only files with time less than this time would be considered for GC
        repositoryId - unique repository id for this node
        whiteboard - whiteboard instance
        statisticsProvider - statistics provider instance
        Throws:
        IOException