Class MarkSweepGarbageCollector
java.lang.Object
org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector
- All Implemented Interfaces:
BlobGarbageCollector
@Deprecated(since="2024-09-23")
public class MarkSweepGarbageCollector
extends Object
implements BlobGarbageCollector
Deprecated.
The Jackrabbit Oak Blob Plugins library is designed for Oak-internal use only and thus deprecated. It will not be part of the AEM SDK after April 2025.
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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMarkSweepGarbageCollector
(BlobReferenceRetriever marker, GarbageCollectableBlobStore blobStore, Executor executor, long maxLastModifiedInterval, @Nullable String repositoryId, @Nullable Whiteboard whiteboard, @Nullable StatisticsProvider statisticsProvider) Deprecated.Instantiates a new blob garbage collector.MarkSweepGarbageCollector
(BlobReferenceRetriever marker, GarbageCollectableBlobStore blobStore, Executor executor, String root, int batchCount, long maxLastModifiedInterval, boolean checkConsistencyAfterGc, boolean sweepIfRefsPastRetention, @Nullable String repositoryId, @Nullable Whiteboard whiteboard, @Nullable StatisticsProvider statisticsProvider) Deprecated.Creates an instance of MarkSweepGarbageCollectorMarkSweepGarbageCollector
(BlobReferenceRetriever marker, GarbageCollectableBlobStore blobStore, Executor executor, String root, int batchCount, long maxLastModifiedInterval, @Nullable String repositoryId) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionlong
Deprecated.Checks for the DataStore consistency and reports the number of missing blobs still referenced.long
checkConsistency
(boolean markOnly) Deprecated.Collects the blob references and consolidates references from other repositories if available in the DataStore.void
collectGarbage
(boolean markOnly) Deprecated.Marks garbage blobs from the passed node store instance.void
collectGarbage
(boolean markOnly, boolean forceBlobRetrieve) Deprecated.Marks garbage blobs from the passed node store instance.Deprecated.Returns consistency operation statisticsDeprecated.Returns operation statisticsgetStats()
Deprecated.Returns the stats related to GC for all reposvoid
Deprecated.void
setTraceOutput
(boolean trace) Deprecated.
-
Field Details
-
LOG
Deprecated. -
TEMP_DIR
Deprecated. -
DEFAULT_BATCH_COUNT
public static final int DEFAULT_BATCH_COUNTDeprecated.- See Also:
-
DELIM
Deprecated.- See Also:
-
-
Constructor Details
-
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 Deprecated.Creates an instance of MarkSweepGarbageCollector- Parameters:
marker
- BlobReferenceRetriever instanced used to fetch refereed blob entriesblobStore
- the blob store instanceexecutor
- executorroot
- the root absolute path of directory under which temporary files would be createdbatchCount
- batch sized used for saving intermediate statemaxLastModifiedInterval
- lastModifiedTime in millis. Only files with time less than this time would be considered for GCrepositoryId
- unique repository id for this nodewhiteboard
- whiteboard instancestatisticsProvider
- statistics provider instance- Throws:
IOException
-
MarkSweepGarbageCollector
public MarkSweepGarbageCollector(BlobReferenceRetriever marker, GarbageCollectableBlobStore blobStore, Executor executor, String root, int batchCount, long maxLastModifiedInterval, @Nullable @Nullable String repositoryId) throws IOException Deprecated.- Throws:
IOException
-
MarkSweepGarbageCollector
public MarkSweepGarbageCollector(BlobReferenceRetriever marker, GarbageCollectableBlobStore blobStore, Executor executor, long maxLastModifiedInterval, @Nullable @Nullable String repositoryId, @Nullable @Nullable Whiteboard whiteboard, @Nullable @Nullable StatisticsProvider statisticsProvider) throws IOException Deprecated.Instantiates a new blob garbage collector.- Throws:
IOException
-
-
Method Details
-
collectGarbage
Deprecated.Description copied from interface:BlobGarbageCollector
Marks garbage blobs from the passed node store instance. Collects them only if markOnly is false.- Specified by:
collectGarbage
in interfaceBlobGarbageCollector
- Parameters:
markOnly
- whether to only mark references and not sweep in the mark and sweep operation.- Throws:
Exception
- the exception
-
collectGarbage
Deprecated.Description copied from interface:BlobGarbageCollector
Marks garbage blobs from the passed node store instance. Collects them only if markOnly is false. Also forces retrieval of blob ids from the blob store rather than using any local tracking.- Specified by:
collectGarbage
in interfaceBlobGarbageCollector
- Parameters:
markOnly
- whether to only mark references and not sweep in the mark and sweep operation.forceBlobRetrieve
- whether to force retrieve of blob ids from datastore- Throws:
Exception
-
getStats
Deprecated.Returns the stats related to GC for all repos- Specified by:
getStats
in interfaceBlobGarbageCollector
- Returns:
- a list of GarbageCollectionRepoStats objects
- Throws:
Exception
-
getOperationStats
Deprecated.Description copied from interface:BlobGarbageCollector
Returns operation statistics- Specified by:
getOperationStats
in interfaceBlobGarbageCollector
- Returns:
- stats object
-
getConsistencyOperationStats
Deprecated.Description copied from interface:BlobGarbageCollector
Returns consistency operation statistics- Specified by:
getConsistencyOperationStats
in interfaceBlobGarbageCollector
- Returns:
- stats object
-
checkConsistency
Deprecated.Description copied from interface:BlobGarbageCollector
Collects the blob references and consolidates references from other repositories if available in the DataStore. Adds relevant metrics.- Specified by:
checkConsistency
in interfaceBlobGarbageCollector
- Returns:
- Throws:
Exception
-
checkConsistency
Deprecated.Checks for the DataStore consistency and reports the number of missing blobs still referenced.- Specified by:
checkConsistency
in interfaceBlobGarbageCollector
- Returns:
- the missing blobs
- Throws:
Exception
-
setTraceOutput
public void setTraceOutput(boolean trace) Deprecated. -
setClock
Deprecated.
-