|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.2) E26043-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.io.journal.AbstractJournalRM
public abstract class AbstractJournalRM
The AbstractJournalRM represents a Journal Resource Manager that manages storage for journaled data, and acts as a shared resource for any number of journals that share a common configuration. This implementation is intended to support both file-based and memory-based implementations.
The limits on the journal are as follows:
| Nested Class Summary | |
|---|---|
protected class |
AbstractJournalRM.CollectorDaemonThe 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 class |
AbstractJournalRM.DefaultDependenciesThe DefaultDependencies class provides a default implementation of Dependencies. |
protected static interface |
AbstractJournalRM.DependenciesThe Dependencies interface provides AbstractJournalRM with its external dependencies. |
protected class |
AbstractJournalRM.JournalFileA JournalFile object is created for each file used to store the journal contents. |
protected class |
AbstractJournalRM.JournalImplA Journal implementation managed by this Journal Resource Manager. |
| Field Summary | |
|---|---|
protected AbstractJournalRM.JournalFile[] |
m_ajournalfileRegistry of JournalFile objects indexed by file id. |
protected int |
m_cJournalFilesThe number of JournalFiles that currently exist. |
protected AbstractJournalRM.CollectorDaemon |
m_daemonCollectorThe "garbage collector" thread that determines when journal files are ripe to be evacuated and deleted. |
protected AbstractJournalRM.Dependencies |
m_dependenciesThe configuration used by this instance. |
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. |
protected AbstractJournalRM.JournalFile |
m_jrnlfileThe current JournalFile. |
protected java.lang.ClassLoader |
m_loaderThe ClassLoader supplied to this Controllable instance. |
protected int |
m_nStateThe current state of the Resource Manager; one of the STATE_* constants. |
protected java.util.Set |
m_setJournalsRegistry of JournalImpl objects. |
protected static long |
MASK_COMPACT_FLAGThe 64-bit bitmask for the compact flag. |
protected static long |
MASK_COMPACT_LENGTHThe 64-bit bitmask for the compact length. |
protected static int |
SHIFT_COMPACT_FLAGThe location of the compact flag within the ticket. |
protected static int |
SHIFT_COMPACT_LENGTHThe location of the compact length within the ticket. |
protected static int |
STATE_CONFIGUREDState: Configured (ready to be started). |
protected static int |
STATE_INITIALState: Initial (unconfigured). |
protected static int |
STATE_RUNNINGState: Running (able to be shut down or stopped). |
protected static int |
STATE_STOPPEDState: Stopped. |
protected static int |
STATE_STOPPINGState: Stopping. |
| Constructor Summary | |
|---|---|
protected |
AbstractJournalRM(Cluster cluster, AbstractJournalRM.Dependencies deps)Construct an AbstractJournalRM. |
| Method Summary | |
|---|---|
protected double |
calculateCurrentLoadFactor()Calculate current load factor for compaction (GC) |
abstract AbstractJournalRM.DefaultDependencies |
cloneDependencies(AbstractJournalRM.Dependencies deps)Clone the Dependencies object. |
void |
close()Deprecated. use the Disposable interface |
void |
configure(XmlElement xml)Configure the dependencies object given the xml configuration. |
JournalBinaryStore |
createBinaryStore()Create a new BinaryStore that will journal its information using this Journal Resource Manager. |
Journal |
createJournal(Journal.JournalConsumer consumer)Create a new Journal that exposes the storage capabilities of this Journal Resource Manager. |
void |
destroyBinaryStore(BinaryStore store)Lifecycle method: Destroy a BinaryStore previously created by this manager. |
void |
dispose() |
protected long |
encodeTicket(ByteSequence bin)Encode a Binary into a "ticket". |
protected abstract long |
encodeTicket(int nFile, long of, int cb)Encode a file number, offset and length into a "ticket". |
protected AbstractJournalRM.JournalFile |
ensureCurrentJournalFile()Obtain the current JournalFile that is being appended to, creating a new one if necessary. |
protected Binary |
extractBinary(long lTicket)Extract a Binary from the passed ticket. |
protected abstract int |
extractFileId(long lTicket)Extract a file index (a file ID) from the passed ticket. |
protected abstract int |
extractLength(long lTicket)Extract a file offset from the passed ticket. |
protected abstract long |
extractOffset(long lTicket)Extract a file offset from the passed ticket. |
int |
getBinaryStoreCount()Determine the number of active BinaryStore objects that are using this Journal. |
Cluster |
getCluster()Returns the Cluster for which the AbstractJournalRM is storing data. |
protected AbstractJournalRM.CollectorDaemon |
getCollectorDaemon()Obtain the CollectorDaemon instance. |
double |
getCollectorLoadFactor()Determine the load factor threshold at which files become eligible for garbage collection (compaction). |
java.lang.ClassLoader |
getContextClassLoader()Retrieve the context ClassLoader for this object. |
double |
getCurrentCollectorLoadFactor()Determine the current load factor threshold for the journal. |
AbstractJournalRM.Dependencies |
getDependencies()Return the Dependencies object. |
protected java.lang.String |
getDescription()Format the object attributes into a String for inclusion in the String returned from the toString() method. |
protected abstract long |
getEvacuationMask()Obtain the bit mask that is used to identify tickets that need to be evacuated for a particular file id. |
int |
getFileCount()Determine the number of Journal files used by this Journal. |
double |
getHighestLoadFactor()Determine the high-water mark load factor for the entire journal. |
protected AbstractJournalRM.JournalFile |
getJournalFile(int nFileId)Obtain a JournalFile by its ID. |
protected long |
getMaxCollectorSleepMillis()Determine the maximum sleep cycle between collections. |
long |
getMaxFileSize()Determine the maximum allowable size, in bytes, of each individual file used to hold Journal data. |
protected int |
getMaxJournalFiles()Determine the maximum number of journal files. |
int |
getMaxJournalFilesNumber()Determine the maximum number of Journal files. |
int |
getMaxValueSize()Determine the maximum allowable size, in bytes, of a Binary value. |
protected long |
getMinCollectorSleepMillis()Determine the minimum sleep cycle between collections. |
protected abstract java.lang.String |
getName()Returns the name value to be used in MBean Objectname key "name". |
protected int |
getState()Determine the current state of the AbstractJournalRM. |
protected static java.lang.String |
getStateDescription(int nState)Format the passed state identifier into a human-readable string. |
protected java.lang.String |
getTicketDescription(long lTicket)Format the information encoded in a ticket into a debug string. |
int |
getTotalCompactionCount()Determine the total number of compaction (garbage collection) done for the journal. |
long |
getTotalDataSize()Determine the amount of data currently stored by this Journal. |
long |
getTotalFileSize()Determine the number of bytes in the Journal files for this Journal. |
protected AbstractJournalRM.CollectorDaemon |
instantiateCollectorDaemon()Factory: Instantiate a CollectorDaemon. |
protected AbstractJournalRM.JournalImpl |
instantiateJournal()Factory: Instantiate a JournalImpl object. |
protected abstract AbstractJournalRM.JournalFile |
instantiateJournalFile(int nFile)Factory: Instantiate a JournalFile or subclass thereof. |
protected boolean |
isCompact(long lTicket)Determine if the ticket is in the compact form. |
protected boolean |
isDedupEnabled()Determine if this journal resource manager should de-dup the keys that its JournalBinaryStore instances are managing. |
boolean |
isRunning()Determine whether or not the controllable service is running. |
protected boolean |
isSingleEvacuation()Determine if this journal resource manager should only evacuate one single JournalFile (at the most) per collection cycle. |
protected java.util.Iterator |
iterateJournalFiles()Iterate all of the JournalFile objects. |
protected java.util.Iterator |
iterateJournals()Iterate through the Journal instances that have been created by this Journal Resource Manager but have not been disposed of yet. |
protected void |
onDependencies(AbstractJournalRM.Dependencies deps)Process the Dependencies after they have been injected into this object. |
protected void |
registerJournal(AbstractJournalRM.JournalImpl journal)Register a Journal that uses this Journal Resource Manager. |
protected void |
registerMBean()Register an MBean for this JournalRM. |
void |
setContextClassLoader(java.lang.ClassLoader loader)Specify the context ClassLoader for this object. |
protected void |
setState(int nState)Modify the current state of the AbstractJournalRM. |
protected boolean |
shouldNotifyCollector()Check if the Collector daemon needs to be notified to come out of sleep |
void |
shutdown()Stop the controllable service. |
void |
start()Start the controllable service. |
protected void |
startThreads()Create and start the various threads used by this Journal Resource Manager. |
void |
stop()Hard-stop the controllable service. |
protected void |
stopThreads()Stop the various threads used by this Journal Resource Manager. |
java.lang.String |
toString() |
protected void |
unregisterJournal(AbstractJournalRM.JournalImpl journal)Register a Journal that uses this Journal Resource Manager. |
protected void |
unregisterMBean()Unregister an MBean for this JournalRM. |
| Methods inherited from interface com.tangosol.io.journal.JournalMBean |
|---|
getBacklogCount, getBacklogSize, getBufferSize, getHighFileCount, getMaxBacklogSize, getMaxPoolSize, getMaxTotalRam, getPoolSize, isNioRam |
| Field Detail |
|---|
protected static final int STATE_INITIAL
protected static final int STATE_CONFIGURED
protected static final int STATE_RUNNING
protected static final int STATE_STOPPING
protected static final int STATE_STOPPED
protected static final int SHIFT_COMPACT_FLAG
protected static final long MASK_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.
protected static final int SHIFT_COMPACT_LENGTH
protected static final long MASK_COMPACT_LENGTH
protected int m_nState
protected AbstractJournalRM.Dependencies m_dependencies
protected java.lang.ClassLoader m_loader
protected double m_dflHighestLoadFactor
protected final java.util.Set m_setJournals
protected final AbstractJournalRM.JournalFile[] m_ajournalfile
protected volatile int m_cJournalFiles
protected volatile AbstractJournalRM.JournalFile m_jrnlfile
protected AbstractJournalRM.CollectorDaemon m_daemonCollector
| Constructor Detail |
|---|
protected AbstractJournalRM(Cluster cluster,
AbstractJournalRM.Dependencies deps)
AbstractJournalRM.
cluster - the Cluster for which the AbstractJournalRM is storing datadeps - the Dependencies object| Method Detail |
|---|
public void configure(XmlElement xml)
configure in interface Controllablexml - the XML configuration for the objectpublic void start()
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.
start in interface Controllablepublic boolean isRunning()
isRunning in interface Controllablepublic void shutdown()
Controllable.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.
shutdown in interface Controllablepublic void stop()
Controllable.shutdown() for normal service termination. Calling this method for a service that has already stopped has no effect.stop in interface Controllablepublic java.lang.ClassLoader getContextClassLoader()
getContextClassLoader in interface ClassLoaderAwareThread.getContextClassLoader()public void setContextClassLoader(java.lang.ClassLoader loader)
setContextClassLoader in interface ClassLoaderAwareloader - the context ClassLoader for this objectpublic void dispose()
dispose in interface com.oracle.common.base.Disposablepublic void close()
public int getMaxJournalFilesNumber()
getMaxJournalFilesNumber in interface JournalMBeanpublic int getBinaryStoreCount()
getBinaryStoreCount in interface JournalMBeanpublic int getFileCount()
getFileCount in interface JournalMBeanpublic long getTotalDataSize()
getTotalDataSize in interface JournalMBeanpublic long getTotalFileSize()
getTotalFileSize in interface JournalMBeanpublic int getMaxValueSize()
getMaxValueSize in interface JournalMBeanpublic long getMaxFileSize()
getMaxFileSize in interface JournalMBeanpublic double getCollectorLoadFactor()
When the portion of released data exceeds (1 - threshold), the file becomes eligible for compaction (garbage collection).
getCollectorLoadFactor in interface JournalMBeanpublic double getCurrentCollectorLoadFactor()
getCurrentCollectorLoadFactor in interface JournalMBeanpublic double getHighestLoadFactor()
getHighestLoadFactor in interface JournalMBeanpublic int getTotalCompactionCount()
getTotalCompactionCount in interface JournalMBeanpublic JournalBinaryStore createBinaryStore()
createBinaryStore in interface BinaryStoreManagerpublic void destroyBinaryStore(BinaryStore store)
destroyBinaryStore in interface BinaryStoreManagerstore - a BinaryStore object previously created by this managerpublic Journal createJournal(Journal.JournalConsumer consumer)
consumer - the JournalConsumer that will be using the Journalpublic java.lang.String toString()
public AbstractJournalRM.Dependencies getDependencies()
public abstract AbstractJournalRM.DefaultDependencies cloneDependencies(AbstractJournalRM.Dependencies deps)
deps - the populated Dependencies objectprotected void onDependencies(AbstractJournalRM.Dependencies deps)
deps - the populated Dependencies objectprotected int getState()
protected void setState(int nState)
nState - one of the STATE_* constantsprotected void startThreads()
protected void stopThreads()
protected double calculateCurrentLoadFactor()
protected static java.lang.String getStateDescription(int nState)
nState - a state identifierprotected java.lang.String getDescription()
toString() method.protected int getMaxJournalFiles()
protected long getMinCollectorSleepMillis()
protected long getMaxCollectorSleepMillis()
protected boolean isDedupEnabled()
protected boolean isSingleEvacuation()
protected void registerMBean()
protected void unregisterMBean()
protected AbstractJournalRM.JournalImpl instantiateJournal()
protected void registerJournal(AbstractJournalRM.JournalImpl journal)
journal - an instance of JournalImpl created by this Journal Resource Managerprotected void unregisterJournal(AbstractJournalRM.JournalImpl journal)
journal - an instance of JournalImpl created by this Journal Resource Managerprotected java.util.Iterator iterateJournals()
protected AbstractJournalRM.JournalFile getJournalFile(int nFileId)
nFileId - the file id (0-511)protected AbstractJournalRM.JournalFile ensureCurrentJournalFile()
protected java.util.Iterator iterateJournalFiles()
protected abstract AbstractJournalRM.JournalFile instantiateJournalFile(int nFile)
nFile - the file number in the range 0-511 (inclusive)protected AbstractJournalRM.CollectorDaemon instantiateCollectorDaemon()
protected AbstractJournalRM.CollectorDaemon getCollectorDaemon()
protected boolean isCompact(long lTicket)
lTicket - a "ticket" that was created by the Journalprotected abstract long getEvacuationMask()
protected abstract int extractFileId(long lTicket)
lTicket - a "ticket" that was created by the Journalprotected abstract long extractOffset(long lTicket)
lTicket - a "ticket" that was created by the Journalprotected abstract int extractLength(long lTicket)
lTicket - a "ticket" that was created by the Journal
protected abstract long encodeTicket(int nFile,
long of,
int cb)
nFile - a file number (aka a file index)of - a value offsetcb - a value lengthprotected long encodeTicket(ByteSequence bin)
bin - a ByteSequence with (length() <= 7)protected Binary extractBinary(long lTicket)
lTicket - a compact "ticket" that was created by the Journalprotected java.lang.String getTicketDescription(long lTicket)
lTicket - the ticket valueprotected boolean shouldNotifyCollector()
public Cluster getCluster()
Cluster for which the AbstractJournalRM is storing data.Clusterprotected abstract java.lang.String getName()
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.2) E26043-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||