public class MarkSweepGarbageCollector extends Object implements BlobGarbageCollector
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BATCH_COUNT |
static String |
DELIM |
static Logger |
LOG |
static String |
TEMP_DIR |
| Constructor and Description |
|---|
MarkSweepGarbageCollector(BlobReferenceRetriever marker,
GarbageCollectableBlobStore blobStore,
Executor executor,
long maxLastModifiedInterval,
@Nullable String repositoryId,
@Nullable Whiteboard whiteboard,
@Nullable StatisticsProvider statisticsProvider)
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)
Creates an instance of MarkSweepGarbageCollector
|
MarkSweepGarbageCollector(BlobReferenceRetriever marker,
GarbageCollectableBlobStore blobStore,
Executor executor,
String root,
int batchCount,
long maxLastModifiedInterval,
@Nullable String repositoryId) |
| Modifier and Type | Method and Description |
|---|---|
long |
checkConsistency()
Checks for the DataStore consistency and reports the number of missing blobs still referenced.
|
void |
collectGarbage(boolean markOnly)
Marks garbage blobs from the passed node store instance.
|
void |
collectGarbage(boolean markOnly,
boolean forceBlobRetrieve)
Marks garbage blobs from the passed node store instance.
|
OperationsStatsMBean |
getConsistencyOperationStats()
Returns consistency operation statistics
|
OperationsStatsMBean |
getOperationStats()
Returns operation statistics
|
List<GarbageCollectionRepoStats> |
getStats()
Returns the stats related to GC for all repos
|
void |
setClock(Clock clock) |
void |
setTraceOutput(boolean trace) |
public static final Logger LOG
public static final String TEMP_DIR
public static final int DEFAULT_BATCH_COUNT
public static final String DELIM
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
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 instanceIOExceptionpublic MarkSweepGarbageCollector(BlobReferenceRetriever marker, GarbageCollectableBlobStore blobStore, Executor executor, String root, int batchCount, long maxLastModifiedInterval, @Nullable @Nullable String repositoryId) throws IOException
IOExceptionpublic MarkSweepGarbageCollector(BlobReferenceRetriever marker, GarbageCollectableBlobStore blobStore, Executor executor, long maxLastModifiedInterval, @Nullable @Nullable String repositoryId, @Nullable @Nullable Whiteboard whiteboard, @Nullable @Nullable StatisticsProvider statisticsProvider) throws IOException
IOExceptionpublic void collectGarbage(boolean markOnly)
throws Exception
BlobGarbageCollectorcollectGarbage in interface BlobGarbageCollectormarkOnly - whether to only mark references and not sweep in the mark and sweep operation.Exception - the exceptionpublic void collectGarbage(boolean markOnly,
boolean forceBlobRetrieve)
throws Exception
BlobGarbageCollectorcollectGarbage in interface BlobGarbageCollectormarkOnly - whether to only mark references and not sweep in the mark and sweep operation.forceBlobRetrieve - whether to force retrieve of blob ids from datastoreExceptionpublic List<GarbageCollectionRepoStats> getStats() throws Exception
getStats in interface BlobGarbageCollectorExceptionpublic OperationsStatsMBean getOperationStats()
BlobGarbageCollectorgetOperationStats in interface BlobGarbageCollectorpublic OperationsStatsMBean getConsistencyOperationStats()
BlobGarbageCollectorgetConsistencyOperationStats in interface BlobGarbageCollectorpublic long checkConsistency()
throws Exception
checkConsistency in interface BlobGarbageCollectorExceptionpublic void setTraceOutput(boolean trace)
public void setClock(Clock clock)
Copyright © 2010 - 2020 Adobe. All Rights Reserved