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
Fields Modifier and Type Field Description protected long
m_cbMaxFile
Maximum size for any of the journal files (maximum-file-size).protected long
m_cbMaxSize
The maximum total amount of memory that the journal will allocate (maximum-size).protected int
m_cbMaxValue
Configurable maximum value size (maximum-value-size).protected long
m_cCollectorTimeout
The number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.protected double
m_dflLoadFactorGC
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 double
MAX_COLLECT_PCT
Maximum collection factor (0.99, i.e. files that are still almost full).static int
MAX_FILE_COUNT
Maximum file count for a Journal (511).static double
MIN_COLLECT_PCT
Minimum collection factor (0.01, i.e. files that are only 1% utilized).static long
MIN_TIMEOUT
Minimum allowed guardable timeout.
-
Constructor Summary
Constructors Constructor Description DefaultDependencies()
Construct a DefaultDependencies object.DefaultDependencies(AbstractJournalRM.Dependencies deps)
Construct a DefaultDependencies object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected long
calculateMaxFileSize(long cbJrnlSize)
Calculate the maximum size of each file based on the given the journal size.double
getCollectorLoadFactor()
Return the load factor threshold at which files become eligible for garbage collection (compaction).long
getCollectorTimeout()
Return the number of milliseconds the Collector can be unresponsive prior to considering the Collector timed out.protected abstract double
getDefaultCollectorLoadFactor()
Get the default percentage at which a file is eligible for garbage collection.protected long
getDefaultCollectorTimeout()
The default number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.protected abstract long
getDefaultMaxFileSize()
Get the default maximum file size for this Journal Resource Manager.protected abstract long
getDefaultMaxSize()
Get the default maximum size (capacity) for this Journal Resource Manager.protected abstract int
getDefaultMaxValueSize()
Get the default maximum value size for this Journal Resource Manager.long
getMaxFileSize()
Return the maximum allowable size, in bytes, of each individual file used to hold Journal data.long
getMaxJournalSize()
Return the total amount of memory, in bytes, that can be allocated for Journal storage.int
getMaxValueSize()
Return the maximum allowable size, in bytes, of a Binary value.protected abstract long
getPermittedMaxFileSize()
Return the highest memory size that can be allocated per journal file.protected abstract long
getPermittedMaxJournalSize()
Return the highest memory size that can be allocated per journal.protected abstract int
getPermittedMaxValueSize()
Return the highest memory size permitted for each value stored in the journal.protected abstract long
getPermittedMinFileSize()
Return the lowest memory size that can be allocated per journal file.protected abstract long
getPermittedMinJournalSize()
Return the lowest memory size that can be allocated per journal.AbstractJournalRM.DefaultDependencies
setCollectorLoadFactor(double dflFactor)
Set the use-percentage of file below which it becomes eligible for garbage collection.AbstractJournalRM.DefaultDependencies
setCollectorTimeout(long cCollectorTimeout)
Set the number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.AbstractJournalRM.DefaultDependencies
setMaxFileSize(long maxFileSize)
Set the maximum size of the underlying journal files.AbstractJournalRM.DefaultDependencies
setMaxJournalSize(long cbMax)
Set the total amount of bytes that can be allocated for Journal storage.AbstractJournalRM.DefaultDependencies
setMaxValueSize(int valueSize)
Set the maximum size, in bytes, of Binary values to store.String
toString()
Return the DefautlDependencies in String format.AbstractJournalRM.Dependencies
validate()
Validate the supplied dependencies.protected void
validateCollectorTimeout()
Validate the collector-timeout.protected void
validateJournalSize()
Validate the journal and file size.protected void
validateLoadFactor()
Validate the minimum-load-factor.protected void
validateMaxValueSize()
Validate the maximum-value-size.
-
-
-
Field Detail
-
MIN_COLLECT_PCT
public static final double MIN_COLLECT_PCT
Minimum collection factor (0.01, i.e. files that are only 1% utilized).- See Also:
- Constant Field Values
-
MAX_COLLECT_PCT
public static final double MAX_COLLECT_PCT
Maximum collection factor (0.99, i.e. files that are still almost full).- See Also:
- Constant Field Values
-
MAX_FILE_COUNT
public static final int MAX_FILE_COUNT
Maximum file count for a Journal (511).- See Also:
- Constant Field Values
-
MIN_TIMEOUT
public static final long MIN_TIMEOUT
Minimum allowed guardable timeout.- See Also:
- Constant Field Values
-
m_cbMaxValue
protected int m_cbMaxValue
Configurable maximum value size (maximum-value-size).
-
m_cbMaxFile
protected long m_cbMaxFile
Maximum size for any of the journal files (maximum-file-size).
-
m_cbMaxSize
protected long m_cbMaxSize
The maximum total amount of memory that the journal will allocate (maximum-size).
-
m_dflLoadFactorGC
protected double m_dflLoadFactorGC
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).
-
m_cCollectorTimeout
protected long m_cCollectorTimeout
The number of milliseconds the Collector daemon can remain unresponsive prior to being considered timed out.
-
-
Constructor Detail
-
DefaultDependencies
public DefaultDependencies()
Construct a DefaultDependencies object.
-
DefaultDependencies
public DefaultDependencies(AbstractJournalRM.Dependencies deps)
Construct a DefaultDependencies object. Copy the values from the specified Dependencies object.- Parameters:
deps
- the dependencies to copy, or null
-
-
Method Detail
-
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
public AbstractJournalRM.DefaultDependencies setMaxValueSize(int valueSize)
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
public AbstractJournalRM.DefaultDependencies setMaxFileSize(long maxFileSize)
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
public AbstractJournalRM.DefaultDependencies setMaxJournalSize(long cbMax)
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
public AbstractJournalRM.DefaultDependencies setCollectorLoadFactor(double dflFactor)
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
public AbstractJournalRM.DefaultDependencies setCollectorTimeout(long cCollectorTimeout)
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
public AbstractJournalRM.Dependencies 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
public String 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
-
-