public final class RogLogCompactor extends RogObject
Modifier and Type | Class and Description |
---|---|
static class |
RogLogCompactor.Params
Contains parameters for compaction.
|
static class |
RogLogCompactor.State
Enmerates the various compactor states
|
Modifier and Type | Method and Description |
---|---|
RogLogCompactor |
compact()
Perform the log compaction
This method kicks off the background compaction of the live transaction
log file.
|
RogLogCompactor |
compact(long forceCheckpointCompletionOn)
Perform the log compaction
|
long |
getMaxCompactionWindowSize()
Gets the compaction window size in Bytes.
|
double |
getMaxCompactionWindowSize(UtlUnit.ByteUnit unit)
Gets the compaction window size.
|
long |
getNewLogInitialLogSize()
Gets the size of new log files creted by the compactor.
|
RogLogCompactor.State |
getState()
Get the current compaction state
|
boolean |
isCompactionInProgress()
Get is compaction is in progress
|
void |
setMaxCompactionWindowSize(double size,
UtlUnit.ByteUnit byteUnit)
May be used to change the compaction windows size.
|
void |
setMaxCompactionWindowSize(long size)
May be used to change the compaction windows size.
|
void |
setNewLogInitialLogSize(long initialLogSize)
Sets the intial size (in bytes) for the log into which entries will be written.
|
void |
stop()
Stop any running compaction
|
void |
waitForCompactionToComplete()
Wait for compaction to complete
|
getChecked, getThreaded, getTracer, setChecked, setTracer
public final void setMaxCompactionWindowSize(double size, UtlUnit.ByteUnit byteUnit)
size
- The size (in megabytes) to set for the compaction window.byteUnit
- The byte unit to use.IllegalStateException
- if isCompactionInProgress()
is true.IllegalArgumentException
- if the compaction window size is invalid (<=0).public final double getMaxCompactionWindowSize(UtlUnit.ByteUnit unit)
unit
- The byte unit in which to return the compaction window size.public final void setMaxCompactionWindowSize(long size)
size
- The size (in megabytes) to set for the compaction window.IllegalStateException
- if isCompactionInProgress()
is true.IllegalArgumentException
- if the compaction window size is invalid (<=0).public final long getMaxCompactionWindowSize()
public void setNewLogInitialLogSize(long initialLogSize)
initialLogSize
- The initial log size of the compacted log or -1 to use the
initial log size configured for the source log.public long getNewLogInitialLogSize()
public final RogLogCompactor.State getState()
public final RogLogCompactor compact(long forceCheckpointCompletionOn)
forceCheckpointCompletionOn
- Specifies a checkpoint version that forces
the completion of a checkpoint in the compacted log. This value is used in
conjunction with the compaction window to determine when to complete a
checkpoint in the compacted log. A value of <=0 in this parameter will
cause only the compaction window to be used. A value of > 0 will cause
the compaction window to be used but will force the checkpoint to be
completed immediately after processing the checkpoint version specified
in this parameter.
This method kicks off the background compaction of the live transaction
log file. The caller can track the status of the compaction by polling
the state via the getState()
method.
public final RogLogCompactor compact()
This method kicks off the background compaction of the live transaction
log file. The caller can track the status of the compaction by polling
the state via the getState()
method.
public final boolean isCompactionInProgress()
public final void waitForCompactionToComplete() throws Exception
Exception
public final void stop()
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.