Class AbstractJournalRM
- All Implemented Interfaces:
Disposable,BinaryStoreManager,ClassLoaderAware,JournalMBean,Controllable,AutoCloseable
- Direct Known Subclasses:
FlashJournalRM,RamJournalRM
The limits on the journal are as follows:
- Values are limited by default to 64MB;
- An individual file is limited by default to 2GB (and maximum 4GB);
- A journal is composed of up to 512 files;
- A journal is thus limited by default to 1TB, with a theoretical maximum of 2TB.
- Since:
- Coherence 3.7
- Author:
- cp/cf 2010-06-23
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThe CollectorDaemon evaluates the JournalFile objects to see which ones should be evacuated, it evacuates those that should be, and it deletes those that have been successfully evacuated.static classThe DefaultDependencies class provides a default implementation of Dependencies.protected static interfaceThe Dependencies interface provides AbstractJournalRM with its external dependencies.protected classA JournalFile object is created for each file used to store the journal contents.protected classA Journal implementation managed by this Journal Resource Manager. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final booleanWhether de-duping (interning) the byte arrays held by the BinaryRadixTree should be requested.protected final ConditionA condition associated with a synchronization lock above that is used to wait for notification and to notify waiting threads.protected final LockThe lock that should be used to control concurrent access to JournalFile objects.protected final ConditionA condition associated with a synchronization lock above that is used to wait for notification and to notify waiting threads.protected final LockThe lock that should be used to control concurrent access to this Journal Resource Manager.protected final AbstractJournalRM.JournalFile[]Registry of JournalFile objects indexed by file id.protected intThe number of JournalFiles that currently exist.protected AbstractJournalRM.CollectorDaemonThe "garbage collector" thread that determines when journal files are ripe to be evacuated and deleted.protected doubleThe size of the file as a ratio to the largest possible file size.protected AbstractJournalRM.DependenciesThe configuration used by this instance.protected doubleThe highest percentage (as a double in the range 0.00 to 1.00) of the configured capacity that this journal has reached.protected AbstractJournalRM.JournalFileThe current JournalFile.protected ClassLoaderThe ClassLoader supplied to this Controllable instance.protected intThe current state of the Resource Manager; one of the STATE_* constants.protected final Set<AbstractJournalRM.JournalImpl> Registry of JournalImpl objects.protected static final longThe 64-bit bitmask for the compact flag.protected static final longThe 64-bit bitmask for the compact length.protected static final intThe location of the compact flag within the ticket.protected static final intThe location of the compact length within the ticket.protected static final intState: Configured (ready to be started).protected static final intState: Initial (unconfigured).protected static final intState: Running (able to be shut down or stopped).protected static final intState: Stopped.protected static final intState: Stopping. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJournalRM(Cluster cluster, AbstractJournalRM.Dependencies deps) Construct anAbstractJournalRM. -
Method Summary
Modifier and TypeMethodDescriptionprotected doubleCalculate current load factor for compaction (GC).Clone the Dependencies object.voidclose()Deprecated.use the Disposable interfacevoidcompact(boolean fRegular) Execute either a regular or exhaustive compaction on the journal based on the provided parameter.voidconfigure(XmlElement xml) Configure the dependencies object given the xml configuration.Create a new BinaryStore that will journal its information using this Journal Resource Manager.createJournal(Journal.JournalConsumer consumer) Create a new Journal that exposes the storage capabilities of this Journal Resource Manager.voiddestroyBinaryStore(BinaryStore store) Lifecycle method: Destroy a BinaryStore previously created by this manager.voiddispose()Invoked when all resources owned by the implementer can safely be released.protected abstract longencodeTicket(int nFile, long of, int cb) Encode a file number, offset and length into a "ticket".protected longencodeTicket(ByteSequence bin) Encode a Binary into a "ticket".protected AbstractJournalRM.JournalFileObtain the current JournalFile that is being appended to, creating a new one if necessary.protected BinaryextractBinary(long lTicket) Extract a Binary from the passed ticket.protected abstract intextractFileId(long lTicket) Extract a file index (a file ID) from the passed ticket.protected abstract intextractLength(long lTicket) Extract a file offset from the passed ticket.protected abstract longextractOffset(long lTicket) Extract a file offset from the passed ticket.intDetermine the number of active BinaryStore objects that are using this Journal.protected ClusterReturns theClusterfor which theAbstractJournalRMis storing data.protected AbstractJournalRM.CollectorDaemonObtain the CollectorDaemon instance.doubleDetermine the load factor threshold at which files become eligible for garbage collection (compaction).protected longReturn the number of milliseconds the Collector can be unresponsive prior to considering the Collector timed out.intDetermine the number of compactions (garbage collections) performed by this journal.Retrieve the context ClassLoader for this object.doubleDetermine the current load factor threshold for the journal.Return the Dependencies object.protected StringFormat the object attributes into a String for inclusion in the String returned from thetoString()method.protected abstract longObtain the bit mask that is used to identify tickets that need to be evacuated for a particular file id.intDetermine the total number of exhaustive compactions performed by the collector.longReturn the total amount time spent performing exhaustive compaction.intDetermine the number of Journal files used by this Journal.protected GuardiandoubleDetermine the high-water mark load factor for the entire journal.protected AbstractJournalRM.JournalFilegetJournalFile(int nFileId) Obtain a JournalFile by its ID.protected longDetermine the maximum sleep cycle between collections.longDetermine the maximum allowable size, in bytes, of each individual file used to hold Journal data.protected intDetermine the maximum number of journal files.intDetermine the maximum number of Journal files.protected longReturn the total amount of memory, in bytes, that can be allocated for Journal storage.intDetermine the maximum allowable size, in bytes, of a Binary value.protected longDetermine the minimum sleep cycle between collections.protected abstract StringgetName()Returns the name value to be used in MBean Objectname key "name".protected intgetState()Determine the current state of the AbstractJournalRM.protected static StringgetStateDescription(int nState) Format the passed state identifier into a human-readable string.protected AbstractJournalRM.JournalFileReturn aAbstractJournalRM.JournalFilebased on the context of the calling thread or null if it is determined that an exhaustive evacuation will not reclaim sufficient memory.protected StringgetTicketDescription(long lTicket) Format the information encoded in a ticket into a debug string.longDetermine the amount of data currently stored by this Journal.longDetermine the number of bytes in the Journal files for this Journal.protected AbstractJournalRM.CollectorDaemonFactory: Instantiate a CollectorDaemon.protected AbstractJournalRM.JournalImplFactory: Instantiate a JournalImpl object.protected abstract AbstractJournalRM.JournalFileinstantiateJournalFile(int nFile) Factory: Instantiate a JournalFile or subclass thereof.protected booleanisCompact(long lTicket) Determine if the ticket is in the compact form.protected booleanDetermine if this journal resource manager should de-dup the keys that its JournalBinaryStore instances are managing.booleanDetermine whether or not the controllable service is running.protected booleanDetermine if this journal resource manager should only evacuate one single JournalFile (at the most) per collection cycle.protected Iterator<AbstractJournalRM.JournalFile> Iterate all of the JournalFile objects.protected Iterator<AbstractJournalRM.JournalImpl> Iterate through the Journal instances that have been created by this Journal Resource Manager but have not been disposed of yet.protected voidProcess the Dependencies after they have been injected into this object.protected voidRegister a Journal that uses this Journal Resource Manager.protected voidRegister an MBean for this JournalRM.voidReset the journal statistics.voidsetContextClassLoader(ClassLoader loader) Specify the context ClassLoader for this object.protected voidsetState(int nState) Modify the current state of the AbstractJournalRM.protected booleanCheck if the Collector daemon needs to be notified to come out of sleepvoidshutdown()Stop the controllable service.voidstart()Start the controllable service.protected voidCreate and start the various threads used by this Journal Resource Manager.voidstop()Hard-stop the controllable service.protected voidStop the various threads used by this Journal Resource Manager.toString()protected voidRegister a Journal that uses this Journal Resource Manager.protected voidUnregister an MBean for this JournalRM.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.tangosol.io.journal.JournalMBean
getBacklogCount, getBacklogSize, getBufferSize, getHighFileCount, getMaxBacklogSize, getMaxPoolSize, getMaxTotalRam, getPoolSize, isNioRam
-
Field Details
-
STATE_INITIAL
protected static final int STATE_INITIALState: Initial (unconfigured).- See Also:
-
STATE_CONFIGURED
protected static final int STATE_CONFIGUREDState: Configured (ready to be started).- See Also:
-
STATE_RUNNING
protected static final int STATE_RUNNINGState: Running (able to be shut down or stopped).- See Also:
-
STATE_STOPPING
protected static final int STATE_STOPPINGState: Stopping.- See Also:
-
STATE_STOPPED
protected static final int STATE_STOPPEDState: Stopped.- See Also:
-
SHIFT_COMPACT_FLAG
protected static final int SHIFT_COMPACT_FLAGThe location of the compact flag within the ticket.- See Also:
-
MASK_COMPACT_FLAG
protected static final long MASK_COMPACT_FLAGThe 64-bit bitmask for the compact flag.The compact flag is the bit that signifies whether the ticket contains the actual value encoded into the long, versus a "proper" journal file ticket.
- See Also:
-
SHIFT_COMPACT_LENGTH
protected static final int SHIFT_COMPACT_LENGTHThe location of the compact length within the ticket.- See Also:
-
MASK_COMPACT_LENGTH
protected static final long MASK_COMPACT_LENGTHThe 64-bit bitmask for the compact length.- See Also:
-
DEDUPE_ENABLED
protected static final boolean DEDUPE_ENABLEDWhether de-duping (interning) the byte arrays held by the BinaryRadixTree should be requested. -
m_nState
protected int m_nStateThe current state of the Resource Manager; one of the STATE_* constants. -
m_dependencies
The configuration used by this instance. -
m_loader
The ClassLoader supplied to this Controllable instance. (Controllable extends ClassLoaderAware.) -
m_dflHighestLoadFactor
protected double m_dflHighestLoadFactorThe highest percentage (as a double in the range 0.00 to 1.00) of the configured capacity that this journal has reached. In other words, this is a high water mark of how full the journal has ever gotten. -
m_dblFileSizeFactor
protected double m_dblFileSizeFactorThe size of the file as a ratio to the largest possible file size. Used to tune the aggressiveness of the collection. -
m_setJournals
Registry of JournalImpl objects. -
m_ajournalfile
Registry of JournalFile objects indexed by file id. -
f_ajournalfileLock
The lock that should be used to control concurrent access to JournalFile objects. -
f_ajournalfileCondition
A condition associated with a synchronization lock above that is used to wait for notification and to notify waiting threads. -
m_cJournalFiles
protected volatile int m_cJournalFilesThe number of JournalFiles that currently exist. -
m_jrnlfile
The current JournalFile. -
m_daemonCollector
The "garbage collector" thread that determines when journal files are ripe to be evacuated and deleted. -
f_journalRMLock
The lock that should be used to control concurrent access to this Journal Resource Manager. -
f_journalRMCondition
A condition associated with a synchronization lock above that is used to wait for notification and to notify waiting threads.
-
-
Constructor Details
-
AbstractJournalRM
Construct anAbstractJournalRM.- Parameters:
cluster- theClusterfor which theAbstractJournalRMis storing datadeps- the Dependencies object
-
-
Method Details
-
configure
Configure the dependencies object given the xml configuration.- Specified by:
configurein interfaceControllable- Parameters:
xml- the XML configuration for the object
-
start
public void start()Start the controllable service.This method should only be called once per the life cycle of the Controllable service. This method has no affect if the service is already running.
- Specified by:
startin interfaceControllable
-
isRunning
public boolean isRunning()Determine whether or not the controllable service is running. This method returns false before a service is started, while the service is starting, while a service is shutting down and after the service has stopped. It only returns true after completing its start processing and before beginning its shutdown processing.- Specified by:
isRunningin interfaceControllable- Returns:
- true if the service is running; false otherwise
-
shutdown
public void shutdown()Stop the controllable service. This is a controlled shut-down, and is preferred to theControllable.stop()method.This method should only be called once per the life cycle of the controllable service. Calling this method for a service that has already stopped has no effect.
- Specified by:
shutdownin interfaceControllable
-
stop
public void stop()Hard-stop the controllable service. UseControllable.shutdown()for normal service termination. Calling this method for a service that has already stopped has no effect.- Specified by:
stopin interfaceControllable
-
getContextClassLoader
Retrieve the context ClassLoader for this object. The context ClassLoader is provided by the creator of the object for use by the object when loading classes and resources.- Specified by:
getContextClassLoaderin interfaceClassLoaderAware- Returns:
- the context ClassLoader for this object
- See Also:
-
setContextClassLoader
Specify the context ClassLoader for this object. The context ClassLoader can be set when the object is created, and allows the creator to provide the appropriate class loader to be used by the object when when loading classes and resources.- Specified by:
setContextClassLoaderin interfaceClassLoaderAware- Parameters:
loader- the context ClassLoader for this object
-
dispose
public void dispose()Invoked when all resources owned by the implementer can safely be released.Once disposed of the object should no longer be considered to be usable.
Note the Disposable interface is compatible with try-with-resources which will automatically invoke this method.
- Specified by:
disposein interfaceDisposable
-
close
public void close()Deprecated.use the Disposable interfacePrevious to the Disposable interface, clean-up was performed by invoking a close method via reflection.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDisposable
-
getMaxJournalFilesNumber
public int getMaxJournalFilesNumber()Determine the maximum number of Journal files.- Specified by:
getMaxJournalFilesNumberin interfaceJournalMBean- Returns:
- the maximum number of simultaneous Journal files that will be used to store the contents of this Journal
-
getBinaryStoreCount
public int getBinaryStoreCount()Determine the number of active BinaryStore objects that are using this Journal.- Specified by:
getBinaryStoreCountin interfaceJournalMBean- Returns:
- the number of BinaryStore objects that are currently active
-
getFileCount
public int getFileCount()Determine the number of Journal files used by this Journal.- Specified by:
getFileCountin interfaceJournalMBean- Returns:
- the number of files for this journal
-
getTotalDataSize
public long getTotalDataSize()Determine the amount of data currently stored by this Journal. This value does not include data that have been released.- Specified by:
getTotalDataSizein interfaceJournalMBean- Returns:
- the number of bytes for this Journal used to store Binary values that have not been released
-
getTotalFileSize
public long getTotalFileSize()Determine the number of bytes in the Journal files for this Journal. This number could include released data that has not yet been compacted.- Specified by:
getTotalFileSizein interfaceJournalMBean- Returns:
- the total size of all Journal files for this Journal
-
getMaxValueSize
public int getMaxValueSize()Determine the maximum allowable size, in bytes, of a Binary value.- Specified by:
getMaxValueSizein interfaceJournalMBean- Returns:
- the maximum allowable size for a value to write
-
getMaxFileSize
public long getMaxFileSize()Determine 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:
getMaxFileSizein interfaceJournalMBean- Returns:
- the maximum allowable size for an underlying file
-
getCollectorLoadFactor
public double getCollectorLoadFactor()Determine 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:
getCollectorLoadFactorin interfaceJournalMBean- Returns:
- the compaction factor threshold between 0.0 and 1.0
-
getCurrentCollectorLoadFactor
public double getCurrentCollectorLoadFactor()Determine the current load factor threshold for the journal.- Specified by:
getCurrentCollectorLoadFactorin interfaceJournalMBean- Returns:
- the current load factor threshold between 0.0 and 1.0
-
getHighestLoadFactor
public double getHighestLoadFactor()Determine the high-water mark load factor for the entire journal. The load factor is the ratio of the highest number of journal files that have concurrently existed to the maximum number of journal files that can concurrently exist.- Specified by:
getHighestLoadFactorin interfaceJournalMBean- Returns:
- the high-water journal load factor in the range 0.00 to 1.00
-
getCompactionCount
public int getCompactionCount()Determine the number of compactions (garbage collections) performed by this journal.- Specified by:
getCompactionCountin interfaceJournalMBean- Returns:
- the number of compactions
-
getExhaustiveCompactionCount
public int getExhaustiveCompactionCount()Determine the total number of exhaustive compactions performed by the collector. An exhaustive compaction is performed when there appears to be no memory available, however the garbage collector may have the ability reclaim memory via compaction.- Specified by:
getExhaustiveCompactionCountin interfaceJournalMBean- Returns:
- number of exhaustive compactions executed
-
getExhaustiveCompactionTime
public long getExhaustiveCompactionTime()Return the total amount time spent performing exhaustive compaction.- Specified by:
getExhaustiveCompactionTimein interfaceJournalMBean- Returns:
- the total amount time spent performing exhaustive compaction
-
resetStatistics
public void resetStatistics()Reset the journal statistics.- Specified by:
resetStatisticsin interfaceJournalMBean
-
compact
public void compact(boolean fRegular) Execute either a regular or exhaustive compaction on the journal based on the provided parameter. The compaction is performed asynchronous to the invocation of this operation.An exhaustive compaction is only executed if sufficient memory has been released or sufficient time has elapsed since the previous exhaustive compaction.
- Specified by:
compactin interfaceJournalMBean- Parameters:
fRegular- whether the compaction should be regular; false for an exhaustive compaction
-
createBinaryStore
Create a new BinaryStore that will journal its information using this Journal Resource Manager.- Specified by:
createBinaryStorein interfaceBinaryStoreManager- Returns:
- a new instance of JournalBinaryStore that uses this Journal Resource Manager for storage
-
destroyBinaryStore
Lifecycle method: Destroy a BinaryStore previously created by this manager.- Specified by:
destroyBinaryStorein interfaceBinaryStoreManager- Parameters:
store- a BinaryStore object previously created by this manager
-
createJournal
Create a new Journal that exposes the storage capabilities of this Journal Resource Manager.- Parameters:
consumer- the JournalConsumer that will be using the Journal- Returns:
- a new instance of Journal that uses this Journal Resource Manager for storage
-
toString
-
getDependencies
Return the Dependencies object.- Returns:
- the journal dependencies object
-
cloneDependencies
public abstract AbstractJournalRM.DefaultDependencies cloneDependencies(AbstractJournalRM.Dependencies deps) Clone the Dependencies object.- Parameters:
deps- the populated Dependencies object- Returns:
- the cloned Dependencies object
-
onDependencies
Process the Dependencies after they have been injected into this object.- Parameters:
deps- the populated Dependencies object
-
getState
protected int getState()Determine the current state of the AbstractJournalRM.- Returns:
- one of the STATE_* constants
-
setState
protected void setState(int nState) Modify the current state of the AbstractJournalRM.- Parameters:
nState- one of the STATE_* constants
-
startThreads
protected void startThreads()Create and start the various threads used by this Journal Resource Manager. -
stopThreads
protected void stopThreads()Stop the various threads used by this Journal Resource Manager. -
calculateCurrentLoadFactor
protected double calculateCurrentLoadFactor()Calculate current load factor for compaction (GC).- Returns:
- calculated load factor
-
getStateDescription
Format the passed state identifier into a human-readable string.- Parameters:
nState- a state identifier- Returns:
- a human-readable string for the state
-
getDescription
Format the object attributes into a String for inclusion in the String returned from thetoString()method.- Returns:
- a comma-delimited String listing the attributes of this object in the form "attribute=value"
-
getMaxJournalFiles
protected int getMaxJournalFiles()Determine the maximum number of journal files.- Returns:
- the maximum number of simultaneous journal files that will be used to store the contents of this journal
-
getMaxJournalSize
protected long getMaxJournalSize()Return the total amount of memory, in bytes, that can be allocated for Journal storage.- Returns:
- the maximum number of bytes that can be allocated for Journal storage
-
getMinCollectorSleepMillis
protected long getMinCollectorSleepMillis()Determine the minimum sleep cycle between collections.- Returns:
- the minimum number of milliseconds to sleep between collections
-
getMaxCollectorSleepMillis
protected long getMaxCollectorSleepMillis()Determine the maximum sleep cycle between collections.- Returns:
- the maximum number of milliseconds to sleep between collections
-
isDedupEnabled
protected boolean isDedupEnabled()Determine if this journal resource manager should de-dup the keys that its JournalBinaryStore instances are managing.- Returns:
- true iff this journal resource manager should routinely cause its JournalBinaryStore instances to de-dup their keys
-
isSingleEvacuation
protected boolean isSingleEvacuation()Determine if this journal resource manager should only evacuate one single JournalFile (at the most) per collection cycle.- Returns:
- true iff this journal resource manager should only evacuate the emptiest JournalFile instead of all the JournalFile instances that qualify for evacuation
-
getSurvivorFile
Return aAbstractJournalRM.JournalFilebased on the context of the calling thread or null if it is determined that an exhaustive evacuation will not reclaim sufficient memory. This method should only be invoked in a "depleted" state when:- the maximum number of files is used
- all those files are
non-appending
When called on the CollectorDaemon thread this method returns a normal JournalFile, with the only exception that it will be in excess to the maximum number of permitted journal files and used exclusively by the CollectorDaemon to perform evacuation in a depleted state.
- Returns:
- either a JournalFile whose usage triggers a full collection or
a JournalFile used exclusively by the CollectorDaemon.
nullmay be returned if it is determined that an exhaustive evacuation will not reclaim sufficient memory
-
registerMBean
protected void registerMBean()Register an MBean for this JournalRM. -
unregisterMBean
protected void unregisterMBean()Unregister an MBean for this JournalRM. -
instantiateJournal
Factory: Instantiate a JournalImpl object.- Returns:
- a JournalImpl instance or subclass thereof
-
registerJournal
Register a Journal that uses this Journal Resource Manager.- Parameters:
journal- an instance of JournalImpl created by this Journal Resource Manager
-
unregisterJournal
Register a Journal that uses this Journal Resource Manager.- Parameters:
journal- an instance of JournalImpl created by this Journal Resource Manager
-
iterateJournals
Iterate through the Journal instances that have been created by this Journal Resource Manager but have not been disposed of yet.- Returns:
- an Iterator of the current JournalImpl instances
-
getJournalFile
Obtain a JournalFile by its ID.- Parameters:
nFileId- the file id (0-511)- Returns:
- the JournalFile for that file id, or null if there is currently no JournalFile for that file id
-
ensureCurrentJournalFile
Obtain the current JournalFile that is being appended to, creating a new one if necessary.- Returns:
- the current JournalFile, or null if the storage is full and no new JournalFile can be created as a result
-
iterateJournalFiles
Iterate all of the JournalFile objects.- Returns:
- an Iterator of the existing JournalFile instances
-
instantiateJournalFile
Factory: Instantiate a JournalFile or subclass thereof.- Parameters:
nFile- the file number in the range 0-511 (inclusive)- Returns:
- a new JournalFile instance
-
instantiateCollectorDaemon
Factory: Instantiate a CollectorDaemon.- Returns:
- a CollectorDaemon or a sub-class thereof
-
getCollectorDaemon
Obtain the CollectorDaemon instance.- Returns:
- the CollectorDaemon for this Journal Resource Manager
-
isCompact
protected boolean isCompact(long lTicket) Determine if the ticket is in the compact form.- Parameters:
lTicket- a "ticket" that was created by the Journal- Returns:
- true iff the ticket is a compact ticket
-
getEvacuationMask
protected abstract long getEvacuationMask()Obtain the bit mask that is used to identify tickets that need to be evacuated for a particular file id.- Returns:
- the bit mask for the file index within a ticket and whatever other bits are necessary to ensure that a ticket refers to that file
-
extractFileId
protected abstract int extractFileId(long lTicket) Extract a file index (a file ID) from the passed ticket.- Parameters:
lTicket- a "ticket" that was created by the Journal- Returns:
- the file index for the value represented by that ticket
-
extractOffset
protected abstract long extractOffset(long lTicket) Extract a file offset from the passed ticket.- Parameters:
lTicket- a "ticket" that was created by the Journal- Returns:
- the file offset for the value represented by that ticket
-
extractLength
protected abstract int extractLength(long lTicket) Extract a file offset from the passed ticket.- Parameters:
lTicket- a "ticket" that was created by the Journal- Returns:
- the file offset for the value represented by that ticket
-
encodeTicket
protected abstract long encodeTicket(int nFile, long of, int cb) Encode a file number, offset and length into a "ticket".- Parameters:
nFile- a file number (aka a file index)of- a value offsetcb- a value length- Returns:
- a "ticket" containing the file number, offset and length
-
encodeTicket
Encode a Binary into a "ticket".- Parameters:
bin- a ByteSequence with (length() <= 7)- Returns:
- a compact "ticket" containing the passed Binary value
-
extractBinary
Extract a Binary from the passed ticket.- Parameters:
lTicket- a compact "ticket" that was created by the Journal- Returns:
- the Binary encoded into the ticket
-
getTicketDescription
Format the information encoded in a ticket into a debug string.- Parameters:
lTicket- the ticket value- Returns:
- a description of the contents of the ticket value
-
shouldNotifyCollector
protected boolean shouldNotifyCollector()Check if the Collector daemon needs to be notified to come out of sleep- Returns:
- true if collector daemon should be notified
-
getCluster
Returns theClusterfor which theAbstractJournalRMis storing data.- Returns:
- the
Cluster
-
getGuardian
- Returns:
- the Guardian associated with the Cluster or null
-
getCollectorTimeout
protected long getCollectorTimeout()Return the number of milliseconds the Collector can be unresponsive prior to considering the Collector timed out.- Returns:
- the number of milliseconds the Collector can be unresponsive
-
getName
Returns the name value to be used in MBean Objectname key "name".- Returns:
- the name
-