public abstract class CompactionStrategy extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CompactionStrategy.CleanupType |
| Modifier and Type | Field and Description |
|---|---|
static CompactionStrategy.CleanupType |
CLEANUP_DEFAULT |
static boolean |
CLONE_BINARIES_DEFAULT |
static boolean |
FORCE_AFTER_FAIL_DEFAULT
Default value for
getForceAfterFail() |
static byte |
GAIN_THRESHOLD_DEFAULT |
static byte |
MEMORY_THRESHOLD_DEFAULT |
static CompactionStrategy |
NO_COMPACTION
No compaction at all
|
static boolean |
PAUSE_DEFAULT |
static boolean |
PERSIST_COMPACTION_MAP_DEFAULT |
static int |
RETRY_COUNT_DEFAULT
Default value for
getRetryCount() |
static long |
TIMESTAMP_DEFAULT |
| Modifier | Constructor and Description |
|---|---|
protected |
CompactionStrategy(boolean paused,
boolean cloneBinaries,
CompactionStrategy.CleanupType cleanupType,
long olderThan,
byte memoryThreshold) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRemove(SegmentId id) |
boolean |
cloneBinaries() |
abstract boolean |
compacted(Callable<Boolean> setHead) |
boolean |
getForceAfterFail()
Get whether or not to force compact concurrent commits on top of already
compacted commits after the maximum number of retries has been reached.
|
byte |
getGainThreshold()
Get the compaction gain estimate threshold beyond which compaction should
run
|
byte |
getMemoryThreshold() |
boolean |
getPersistCompactionMap() |
int |
getRetryCount()
Get the number of tries to compact concurrent commits on top of already
compacted commits
|
boolean |
isDiskSpaceSufficient(long repositoryDiskSpace,
long availableDiskSpace)
Check if the approximate repository size is getting too big compared with
the available space on disk.
|
boolean |
isOfflineCompaction() |
boolean |
isPaused() |
void |
setCleanupType(CompactionStrategy.CleanupType cleanupType) |
void |
setCloneBinaries(boolean cloneBinaries) |
void |
setCompactionStart(long ms) |
void |
setForceAfterFail(boolean forceAfterFail)
Set whether or not to force compact concurrent commits on top of already
compacted commits after the maximum number of retries has been reached.
|
void |
setGainThreshold(byte gainThreshold)
Set the compaction gain estimate threshold beyond which compaction should
run
|
void |
setMemoryThreshold(byte memoryThreshold) |
void |
setOfflineCompaction(boolean offlineCompaction) |
void |
setOlderThan(long olderThan) |
void |
setPaused(boolean paused) |
void |
setPersistCompactionMap(boolean persist) |
void |
setRetryCount(int retryCount)
Set the number of tries to compact concurrent commits on top of already
compacted commits
|
String |
toString() |
public static final boolean PAUSE_DEFAULT
public static final boolean CLONE_BINARIES_DEFAULT
public static final CompactionStrategy.CleanupType CLEANUP_DEFAULT
public static final long TIMESTAMP_DEFAULT
public static final byte MEMORY_THRESHOLD_DEFAULT
public static final boolean PERSIST_COMPACTION_MAP_DEFAULT
public static final byte GAIN_THRESHOLD_DEFAULT
public static final int RETRY_COUNT_DEFAULT
getRetryCount()public static final boolean FORCE_AFTER_FAIL_DEFAULT
getForceAfterFail()public static final CompactionStrategy NO_COMPACTION
protected CompactionStrategy(boolean paused,
boolean cloneBinaries,
@Nonnull
CompactionStrategy.CleanupType cleanupType,
long olderThan,
byte memoryThreshold)
public boolean canRemove(SegmentId id)
public boolean cloneBinaries()
public boolean isPaused()
public void setPaused(boolean paused)
public void setCloneBinaries(boolean cloneBinaries)
public void setCleanupType(@Nonnull CompactionStrategy.CleanupType cleanupType)
public void setOlderThan(long olderThan)
public void setCompactionStart(long ms)
public byte getMemoryThreshold()
public void setMemoryThreshold(byte memoryThreshold)
public boolean getPersistCompactionMap()
public void setPersistCompactionMap(boolean persist)
public boolean getForceAfterFail()
true if force commit is on, false otherwisepublic void setForceAfterFail(boolean forceAfterFail)
forceAfterFail - public int getRetryCount()
public void setRetryCount(int retryCount)
retryCount - public byte getGainThreshold()
public void setGainThreshold(byte gainThreshold)
gainThreshold - public abstract boolean compacted(@Nonnull Callable<Boolean> setHead) throws Exception
Exceptionpublic boolean isOfflineCompaction()
public void setOfflineCompaction(boolean offlineCompaction)
public boolean isDiskSpaceSufficient(long repositoryDiskSpace,
long availableDiskSpace)
repositoryDiskSpace - Approximate size of the disk space occupied by
the repository.availableDiskSpace - Currently available disk space.true if the available disk space is considered enough for
normal repository operations.Copyright © 2012-2018 The Apache Software Foundation. All Rights Reserved.