Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.io.journal
Class AbstractJournalRM

java.lang.Object
  extended by com.tangosol.io.journal.AbstractJournalRM

All Implemented Interfaces:
BinaryStoreManager, ClassLoaderAware, JournalMBean, XmlConfigurable, Controllable, Disposable
Direct Known Subclasses:
FlashJournalRM, RamJournalRM

public abstract class AbstractJournalRM
extends java.lang.Object
implements Controllable, XmlConfigurable, Disposable, BinaryStoreManager, JournalMBean

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:

Since:
Coherence 3.7
Author:
cp/cf 2010-06-23

Nested Class Summary
protected  class AbstractJournalRM.CollectorDaemon
          The 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.
protected  class AbstractJournalRM.JournalFile
          A JournalFile object is created for each file used to store the journal contents.
protected  class AbstractJournalRM.JournalImpl
          A Journal implementation managed by this Journal Resource Manager.

 

Field Summary
protected  AbstractJournalRM.JournalFile[] m_ajournalfile
          Registry of JournalFile objects indexed by file id.
protected  long m_cbMaxFile
          Maximum size for any of the journal files.
protected  int m_cbMaxValue
          Configurable maximum value size.
protected  int m_cJournalFiles
          The number of JournalFiles that currently exist.
protected  AbstractJournalRM.CollectorDaemon m_daemonCollector
          The "garbage collector" thread that determines when journal files are ripe to be evacuated and deleted.
protected  double m_dflHighestLoadFactor
          The highest percentage (as a double in the range 0.00 to 1.00) of the configured capacity that this journal has reached.
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.
protected  AbstractJournalRM.JournalFile m_jrnlfile
          The current JournalFile.
protected  java.lang.ClassLoader m_loader
          The ClassLoader supplied to this Controllable instance.
protected  int m_nState
          The current state of the Resource Manager; one of the STATE_* constants.
protected  java.util.Set m_setJournals
          Registry of JournalImpl objects.
protected  XmlElement m_xmlConfig
          The configuration used by this instance.
protected static long MASK_COMPACT_FLAG
          The 64-bit bitmask for the compact flag.
protected static long MASK_COMPACT_LENGTH
          The 64-bit bitmask for the compact length.
static double MAX_COLLECT_PCT
          Maximum collection factor (0.99, i.e. files that are still almost full).
static double MIN_COLLECT_PCT
          Minimum collection factor (0.01, i.e. files that are only 1% utilized).
protected static int SHIFT_COMPACT_FLAG
          The location of the compact flag within the ticket.
protected static int SHIFT_COMPACT_LENGTH
          The location of the compact length within the ticket.
protected static int STATE_CONFIGURED
          State: Configured (ready to be started).
protected static int STATE_INITIAL
          State: Initial (unconfigured).
protected static int STATE_RUNNING
          State: Running (able to be shut down or stopped).
protected static int STATE_STOPPED
          State: Stopped.
protected static int STATE_STOPPING
          State: Stopping.

 

Constructor Summary
protected AbstractJournalRM(Cluster cluster)
          Construct an AbstractJournalRM.

 

Method Summary
protected  void applyConfig(java.lang.String sName, XmlElement xmlConfig)
          Parse the XML configuration for the specified setting name, and configure the Journal Resource Manager accordingly.
protected  void checkInitializing()
          Verify that the AbstractJournalRM is still initializing.
 void close()
          Deprecated. use the Disposable interface
 void configure(XmlElement xml)
          Configure the controllable service.
 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).
 XmlElement getConfig()
          Determine the current configuration of the object.
 java.lang.ClassLoader getContextClassLoader()
          Retrieve the context ClassLoader for this object.
protected abstract  double getDefaultCollectorLoadFactor()
          Determine the default percentage at which a file is eligible for garbage collection.
protected abstract  long getDefaultMaxFileSize()
          Determine the default maximum file size for this Journal Resource Manager.
protected abstract  int getDefaultMaxValueSize()
          Determine the default maximum value size for this Journal Resource Manager.
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  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.
 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 registerJournal(AbstractJournalRM.JournalImpl journal)
          Register a Journal that uses this Journal Resource Manager.
protected  void registerMBean()
          Register an MBean for this JournalRM.
 void setCollectorLoadFactor(double dflFactor)
          Configure the use-percentage of file below which it becomes eligible for garbage collection.
 void setConfig(XmlElement xml)
          Specify the configuration for the object.
 void setContextClassLoader(java.lang.ClassLoader loader)
          Specify the context ClassLoader for this object.
abstract  void setMaxFileSize(long cb)
          Configure the maximum size of the underlying journal files.
abstract  void setMaxValueSize(int cb)
          Specify the maximum size, in bytes, of Binary values to store.
protected  void setState(int nState)
          Modify the current state of the AbstractJournalRM.
 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, getMaxBacklogSize, getMaxPoolSize, getMaxTotalRam, getPoolSize, isNioRam

 

Field Detail

STATE_INITIAL

protected static final int STATE_INITIAL
State: Initial (unconfigured).
See Also:
Constant Field Values

STATE_CONFIGURED

protected static final int STATE_CONFIGURED
State: Configured (ready to be started).
See Also:
Constant Field Values

STATE_RUNNING

protected static final int STATE_RUNNING
State: Running (able to be shut down or stopped).
See Also:
Constant Field Values

STATE_STOPPING

protected static final int STATE_STOPPING
State: Stopping.
See Also:
Constant Field Values

STATE_STOPPED

protected static final int STATE_STOPPED
State: Stopped.
See Also:
Constant Field Values

SHIFT_COMPACT_FLAG

protected static final int SHIFT_COMPACT_FLAG
The location of the compact flag within the ticket.
See Also:
Constant Field Values

MASK_COMPACT_FLAG

protected static final long MASK_COMPACT_FLAG
The 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:
Constant Field Values

SHIFT_COMPACT_LENGTH

protected static final int SHIFT_COMPACT_LENGTH
The location of the compact length within the ticket.
See Also:
Constant Field Values

MASK_COMPACT_LENGTH

protected static final long MASK_COMPACT_LENGTH
The 64-bit bitmask for the compact length.
See Also:
Constant Field Values

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

m_nState

protected int m_nState
The current state of the Resource Manager; one of the STATE_* constants.

m_xmlConfig

protected XmlElement m_xmlConfig
The configuration used by this instance.

m_loader

protected java.lang.ClassLoader m_loader
The ClassLoader supplied to this Controllable instance. (Controllable extends ClassLoaderAware.)

m_cbMaxFile

protected long m_cbMaxFile
Maximum size for any of the journal files.

m_cbMaxValue

protected int m_cbMaxValue
Configurable maximum value 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.

m_dflHighestLoadFactor

protected double m_dflHighestLoadFactor
The 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_setJournals

protected final java.util.Set m_setJournals
Registry of JournalImpl objects.

m_ajournalfile

protected final AbstractJournalRM.JournalFile[] m_ajournalfile
Registry of JournalFile objects indexed by file id.

m_cJournalFiles

protected volatile int m_cJournalFiles
The number of JournalFiles that currently exist.

m_jrnlfile

protected volatile AbstractJournalRM.JournalFile m_jrnlfile
The current JournalFile.

m_daemonCollector

protected AbstractJournalRM.CollectorDaemon m_daemonCollector
The "garbage collector" thread that determines when journal files are ripe to be evacuated and deleted.

Constructor Detail

AbstractJournalRM

protected AbstractJournalRM(Cluster cluster)
Construct an AbstractJournalRM.
Parameters:
cluster - the Cluster for which the AbstractJournalRM is storing data

Method Detail

configure

public void configure(XmlElement xml)
Configure the controllable service.

This method can only be called before the controllable service is started.

The Journal Resource Manager supports the following configuration options:

Specified by:
configure in interface Controllable
Parameters:
xml - an XmlElement carrying configuration information specific to the Controllable 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:
start in interface Controllable

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:
isRunning in interface Controllable
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 the 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.

Specified by:
shutdown in interface Controllable

stop

public void stop()
Hard-stop the controllable service. Use Controllable.shutdown() for normal service termination. Calling this method for a service that has already stopped has no effect.
Specified by:
stop in interface Controllable

getContextClassLoader

public java.lang.ClassLoader 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:
getContextClassLoader in interface ClassLoaderAware
Returns:
the context ClassLoader for this object
See Also:
Thread.getContextClassLoader()

setContextClassLoader

public void setContextClassLoader(java.lang.ClassLoader loader)
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:
setContextClassLoader in interface ClassLoaderAware
Parameters:
loader - the context ClassLoader for this object

getConfig

public XmlElement getConfig()
Determine the current configuration of the object.
Specified by:
getConfig in interface XmlConfigurable
Returns:
the XML configuration or null

setConfig

public void setConfig(XmlElement xml)
Specify the configuration for the object.
Specified by:
setConfig in interface XmlConfigurable
Parameters:
xml - the XML configuration for the object

dispose

public void dispose()

close

public void close()
Deprecated. use the Disposable interface
Previous to the Disposable interface, clean-up was performed by invoking a close method via reflection.

getMaxJournalFilesNumber

public int getMaxJournalFilesNumber()
Determine the maximum number of Journal files.
Specified by:
getMaxJournalFilesNumber in interface JournalMBean
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:
getBinaryStoreCount in interface JournalMBean
Returns:
the number of BinaryStore objects that are currently active

getMaxValueSize

public int getMaxValueSize()
Determine the maximum allowable size, in bytes, of a Binary value.
Specified by:
getMaxValueSize in interface JournalMBean
Returns:
the maximum allowable size for a value to write

getFileCount

public int getFileCount()
Determine the number of Journal files used by this Journal.
Specified by:
getFileCount in interface JournalMBean
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:
getTotalDataSize in interface JournalMBean
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:
getTotalFileSize in interface JournalMBean
Returns:
the total size of all Journal files for this Journal

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:
getMaxFileSize in interface JournalMBean
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:
getCollectorLoadFactor in interface JournalMBean
Returns:
the compaction 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:
getHighestLoadFactor in interface JournalMBean
Returns:
the high-water journal load factor in the range 0.00 to 1.00

createBinaryStore

public JournalBinaryStore createBinaryStore()
Create a new BinaryStore that will journal its information using this Journal Resource Manager.
Specified by:
createBinaryStore in interface BinaryStoreManager
Returns:
a new instance of JournalBinaryStore that uses this Journal Resource Manager for storage

destroyBinaryStore

public void destroyBinaryStore(BinaryStore store)
Lifecycle method: Destroy a BinaryStore previously created by this manager.
Specified by:
destroyBinaryStore in interface BinaryStoreManager
Parameters:
store - a BinaryStore object previously created by this manager

createJournal

public Journal createJournal(Journal.JournalConsumer consumer)
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

public java.lang.String toString()

setMaxValueSize

public abstract void setMaxValueSize(int cb)
Specify the maximum size, in bytes, of Binary values to store.

Note: This value can be modified while the ResourceManager is running.

Parameters:
cb - the maximum allowable size for a Binary value, or zero to specify no configured maximum for the value size

setMaxFileSize

public abstract void setMaxFileSize(long cb)
Configure the maximum size of the underlying journal files.

Note: This value can only be set before the ResourceManager is started.

Parameters:
cb - the maximum size, in bytes, for journal files

setCollectorLoadFactor

public void setCollectorLoadFactor(double dflFactor)
Configure the use-percentage of file below which it becomes eligible for garbage collection. The minimum is defined by MIN_COLLECT_PCT and a maximum defined by MAX_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.

Note: This value can only be set before the ResourceManager is started.

Parameters:
dflFactor - the garbage collector factor in the range 0.01 to 0.99

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

checkInitializing

protected void checkInitializing()
Verify that the AbstractJournalRM is still initializing.

applyConfig

protected void applyConfig(java.lang.String sName,
                           XmlElement xmlConfig)
Parse the XML configuration for the specified setting name, and configure the Journal Resource Manager accordingly.
Parameters:
sName - the name of the XML setting
xmlConfig - the XML element containing the setting

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.

getStateDescription

protected static java.lang.String getStateDescription(int nState)
Format the passed state identifier into a human-readable string.
Parameters:
nState - a state identifier
Returns:
a human-readable string for the state

getDescription

protected java.lang.String getDescription()
Format the object attributes into a String for inclusion in the String returned from the toString() 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

getDefaultMaxFileSize

protected abstract long getDefaultMaxFileSize()
Determine the default maximum file size for this Journal Resource Manager.
Returns:
the default maximum file size

getDefaultMaxValueSize

protected abstract int getDefaultMaxValueSize()
Determine the default maximum value size for this Journal Resource Manager.
Returns:
the default maximum value size

getDefaultCollectorLoadFactor

protected abstract double getDefaultCollectorLoadFactor()
Determine the default percentage at which a file is eligible for garbage collection.
Returns:
the default garbage collection load factor

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

registerMBean

protected void registerMBean()
Register an MBean for this JournalRM.

unregisterMBean

protected void unregisterMBean()
Unregister an MBean for this JournalRM.

instantiateJournal

protected AbstractJournalRM.JournalImpl instantiateJournal()
Factory: Instantiate a JournalImpl object.
Returns:
a JournalImpl instance or subclass thereof

registerJournal

protected void registerJournal(AbstractJournalRM.JournalImpl journal)
Register a Journal that uses this Journal Resource Manager.
Parameters:
journal - an instance of JournalImpl created by this Journal Resource Manager

unregisterJournal

protected void unregisterJournal(AbstractJournalRM.JournalImpl journal)
Register a Journal that uses this Journal Resource Manager.
Parameters:
journal - an instance of JournalImpl created by this Journal Resource Manager

iterateJournals

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.
Returns:
an Iterator of the current JournalImpl instances

getJournalFile

protected AbstractJournalRM.JournalFile getJournalFile(int nFileId)
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

protected AbstractJournalRM.JournalFile 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

protected java.util.Iterator iterateJournalFiles()
Iterate all of the JournalFile objects.
Returns:
an Iterator of the existing JournalFile instances

instantiateJournalFile

protected abstract AbstractJournalRM.JournalFile instantiateJournalFile(int nFile)
Factory: Instantiate a JournalFile or subclass thereof.
Parameters:
nFile - the file number in the range 0-511 (inclusive)
Returns:
a new JournalFile instance

instantiateCollectorDaemon

protected AbstractJournalRM.CollectorDaemon instantiateCollectorDaemon()
Factory: Instantiate a CollectorDaemon.
Returns:
a CollectorDaemon or a sub-class thereof

getCollectorDaemon

protected AbstractJournalRM.CollectorDaemon 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 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 offset
cb - a value length
Returns:
a "ticket" containing the file number, offset and length

encodeTicket

protected long encodeTicket(ByteSequence bin)
Encode a Binary into a "ticket".
Parameters:
bin - a ByteSequence with (length() <= 7)
Returns:
a compact "ticket" containing the passed Binary value

extractBinary

protected Binary extractBinary(long lTicket)
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

protected java.lang.String getTicketDescription(long lTicket)
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

getCluster

public Cluster getCluster()
Returns the Cluster for which the AbstractJournalRM is storing data.
Returns:
the Cluster

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.