Package com.tangosol.io.journal
Class AbstractJournalRM.DefaultDependencies
java.lang.Object
com.tangosol.io.journal.AbstractJournalRM.DefaultDependencies
- All Implemented Interfaces:
AbstractJournalRM.Dependencies
- Direct Known Subclasses:
FlashJournalRM.DefaultDependencies
,RamJournalRM.DefaultDependencies
- Enclosing class:
AbstractJournalRM
public abstract static class AbstractJournalRM.DefaultDependencies
extends Object
implements AbstractJournalRM.Dependencies
The DefaultDependencies class provides a default implementation of Dependencies.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long
Maximum size for any of the journal files (maximum-file-size).protected long
The maximum total amount of memory that the journal will allocate (maximum-size).protected int
Configurable maximum value size (maximum-value-size).protected long
The number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.protected double
The percentage (as a double in the range 0.01 to 0.99) at which a file is eligible for garbage collection (minimum-load-factor).static final double
Maximum collection factor (0.99, i.e. files that are still almost full).static final int
Maximum file count for a Journal (511).static final double
Minimum collection factor (0.01, i.e. files that are only 1% utilized).static final long
Minimum allowed guardable timeout. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a DefaultDependencies object.Construct a DefaultDependencies object. -
Method Summary
Modifier and TypeMethodDescriptionprotected long
calculateMaxFileSize
(long cbJrnlSize) Calculate the maximum size of each file based on the given the journal size.double
Return the load factor threshold at which files become eligible for garbage collection (compaction).long
Return the number of milliseconds the Collector can be unresponsive prior to considering the Collector timed out.protected abstract double
Get the default percentage at which a file is eligible for garbage collection.protected long
The default number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.protected abstract long
Get the default maximum file size for this Journal Resource Manager.protected abstract long
Get the default maximum size (capacity) for this Journal Resource Manager.protected abstract int
Get the default maximum value size for this Journal Resource Manager.long
Return the maximum allowable size, in bytes, of each individual file used to hold Journal data.long
Return the total amount of memory, in bytes, that can be allocated for Journal storage.int
Return the maximum allowable size, in bytes, of a Binary value.protected abstract long
Return the highest memory size that can be allocated per journal file.protected abstract long
Return the highest memory size that can be allocated per journal.protected abstract int
Return the highest memory size permitted for each value stored in the journal.protected abstract long
Return the lowest memory size that can be allocated per journal file.protected abstract long
Return the lowest memory size that can be allocated per journal.setCollectorLoadFactor
(double dflFactor) Set the use-percentage of file below which it becomes eligible for garbage collection.setCollectorTimeout
(long cCollectorTimeout) Set the number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.setMaxFileSize
(long maxFileSize) Set the maximum size of the underlying journal files.setMaxJournalSize
(long cbMax) Set the total amount of bytes that can be allocated for Journal storage.setMaxValueSize
(int valueSize) Set the maximum size, in bytes, of Binary values to store.toString()
Return the DefautlDependencies in String format.validate()
Validate the supplied dependencies.protected void
Validate the collector-timeout.protected void
Validate the journal and file size.protected void
Validate the minimum-load-factor.protected void
Validate the maximum-value-size.
-
Field Details
-
MIN_COLLECT_PCT
public static final double MIN_COLLECT_PCTMinimum collection factor (0.01, i.e. files that are only 1% utilized).- See Also:
-
MAX_COLLECT_PCT
public static final double MAX_COLLECT_PCTMaximum collection factor (0.99, i.e. files that are still almost full).- See Also:
-
MAX_FILE_COUNT
public static final int MAX_FILE_COUNTMaximum file count for a Journal (511).- See Also:
-
MIN_TIMEOUT
public static final long MIN_TIMEOUTMinimum allowed guardable timeout.- See Also:
-
m_cbMaxValue
protected int m_cbMaxValueConfigurable maximum value size (maximum-value-size). -
m_cbMaxFile
protected long m_cbMaxFileMaximum size for any of the journal files (maximum-file-size). -
m_cbMaxSize
protected long m_cbMaxSizeThe maximum total amount of memory that the journal will allocate (maximum-size). -
m_dflLoadFactorGC
protected double m_dflLoadFactorGCThe percentage (as a double in the range 0.01 to 0.99) at which a file is eligible for garbage collection (minimum-load-factor). -
m_cCollectorTimeout
protected long m_cCollectorTimeoutThe number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.
-
-
Constructor Details
-
DefaultDependencies
public DefaultDependencies()Construct a DefaultDependencies object. -
DefaultDependencies
Construct a DefaultDependencies object. Copy the values from the specified Dependencies object.- Parameters:
deps
- the dependencies to copy, or null
-
-
Method Details
-
getDefaultMaxFileSize
protected abstract long getDefaultMaxFileSize()Get the default maximum file size for this Journal Resource Manager.- Returns:
- the default maximum file size
-
getDefaultMaxValueSize
protected abstract int getDefaultMaxValueSize()Get the default maximum value size for this Journal Resource Manager.- Returns:
- the default maximum value size
-
getDefaultMaxSize
protected abstract long getDefaultMaxSize()Get the default maximum size (capacity) for this Journal Resource Manager.- Returns:
- the default maximum size
-
getDefaultCollectorLoadFactor
protected abstract double getDefaultCollectorLoadFactor()Get the default percentage at which a file is eligible for garbage collection.- Returns:
- the default garbage collection load factor
-
getPermittedMaxJournalSize
protected abstract long getPermittedMaxJournalSize()Return the highest memory size that can be allocated per journal.- Returns:
- the highest memory size that can be allocated per journal
-
getPermittedMinJournalSize
protected abstract long getPermittedMinJournalSize()Return the lowest memory size that can be allocated per journal.- Returns:
- the lowest memory size that can be allocated per journal
-
getPermittedMaxFileSize
protected abstract long getPermittedMaxFileSize()Return the highest memory size that can be allocated per journal file.- Returns:
- the highest memory size that can be allocated per journal file
-
getPermittedMinFileSize
protected abstract long getPermittedMinFileSize()Return the lowest memory size that can be allocated per journal file.- Returns:
- the lowest memory size that can be allocated per journal file
-
getPermittedMaxValueSize
protected abstract int getPermittedMaxValueSize()Return the highest memory size permitted for each value stored in the journal.- Returns:
- the highest memory size permitted for each value stored in the journal
-
getMaxValueSize
public int getMaxValueSize()Return the maximum allowable size, in bytes, of a Binary value.- Specified by:
getMaxValueSize
in interfaceAbstractJournalRM.Dependencies
- Returns:
- the maximum allowable size for a value to write
-
setMaxValueSize
Set the maximum size, in bytes, of Binary values to store.- Parameters:
valueSize
- the maximum allowable size for a Binary value, or zero to specify no configured maximum for the value size- Returns:
- this object
-
getMaxFileSize
public long getMaxFileSize()Return the maximum allowable size, in bytes, of each individual file used to hold Journal data. This is not the total size limit of the Journal, since the Journal may use a number of files to store its data.- Specified by:
getMaxFileSize
in interfaceAbstractJournalRM.Dependencies
- Returns:
- the maximum allowable size for an underlying file
-
setMaxFileSize
Set the maximum size of the underlying journal files.- Parameters:
maxFileSize
- the maximum size, in bytes, for journal files- Returns:
- this object
-
getMaxJournalSize
public long getMaxJournalSize()Return the total amount of memory, in bytes, that can be allocated for Journal storage.- Specified by:
getMaxJournalSize
in interfaceAbstractJournalRM.Dependencies
- Returns:
- the maximum number of bytes that can be allocated for Journal storage
-
setMaxJournalSize
Set the total amount of bytes that can be allocated for Journal storage.- Parameters:
cbMax
- the maximum number of bytes that can be allocated for journal storage- Returns:
- this object
-
getCollectorLoadFactor
public double getCollectorLoadFactor()Return the load factor threshold at which files become eligible for garbage collection (compaction). The load factor threshold is the ratio between the portion of the file used for live data and the total size of the file, and is expressed as a double value in the interval (0.0, 1.0).When the portion of released data exceeds (1 - threshold), the file becomes eligible for compaction (garbage collection).
- Specified by:
getCollectorLoadFactor
in interfaceAbstractJournalRM.Dependencies
- Returns:
- the compaction factor threshold between 0.0 and 1.0
-
setCollectorLoadFactor
Set the use-percentage of file below which it becomes eligible for garbage collection. The minimum is defined byMIN_COLLECT_PCT
and a maximum defined byMAX_COLLECT_PCT
. Setting the value higher means that disk space will be collected more aggressively, but the cost of collection will be significantly higher, while setting the value lower will use more disk space.- Parameters:
dflFactor
- the garbage collector factor in the range 0.01 to 0.99- Returns:
- this object
-
getCollectorTimeout
public long getCollectorTimeout()Return the number of milliseconds the Collector can be unresponsive prior to considering the Collector timed out.- Specified by:
getCollectorTimeout
in interfaceAbstractJournalRM.Dependencies
- Returns:
- the number of milliseconds the Collector can be unresponsive
-
setCollectorTimeout
Set the number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.- Parameters:
cCollectorTimeout
- number of millis the Collector daemon can remain unresponsive- Returns:
- this object
-
validate
Validate the supplied dependencies.- Returns:
- this object
- Throws:
IllegalArgumentException
- if the dependencies are not valid
-
getDefaultCollectorTimeout
protected long getDefaultCollectorTimeout()The default number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.- Returns:
- default number of millis the Collector daemon can remain unresponsive
-
toString
Return the DefautlDependencies in String format. -
validateJournalSize
protected void validateJournalSize()Validate the journal and file size. -
validateMaxValueSize
protected void validateMaxValueSize()Validate the maximum-value-size. -
validateLoadFactor
protected void validateLoadFactor()Validate the minimum-load-factor. -
validateCollectorTimeout
protected void validateCollectorTimeout()Validate the collector-timeout. -
calculateMaxFileSize
protected long calculateMaxFileSize(long cbJrnlSize) Calculate the maximum size of each file based on the given the journal size.- Parameters:
cbJrnlSize
- the size, in bytes, of the journal- Returns:
- the maximum size permitted for each file
-