Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.io.journal
Class FlashJournalRM

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

All Implemented Interfaces:
BinaryStoreManager, ClassLoaderAware, JournalMBean, XmlConfigurable, Controllable, Disposable

public class FlashJournalRM
extends AbstractJournalRM

A FlashJournalRM manages disk I/O for temporary journal-based files, and acts as a shared resource for any number of journals that share a common configuration.

To use the Resource Manager, configure it (either by XML using configure(XmlElement), or by calling the appropriate setter methods such as setDirectory(File)). Once configured, start the Resource Manager via the AbstractJournalRM.start() method, and then obtain BinaryStore instances via the AbstractJournalRM.createBinaryStore() method. When a BinaryStore instance is no longer required, dispose of it via the Disposable interface, and similarly stop() or AbstractJournalRM.dispose() of the Resource Manager when it is no longer needed to ensure that any resources it allocated are cleaned up and released.

While the Resource Manager is running, there will be one or more files created in the specified temporary directory (or the default temporary directory if none is specified). The number of files is not related to the number of BinaryStore instances, but rather to the total amount of data that the Resource Manager is managing at any given time. Additionally, the Resource Manager uses three daemon threads to help manage the data: "Journal-Preparer", "Journal-Writer" and "Journal-Collector". These threads respectively lay out the data to be written, write the data, and perform asynchronous GC of the storage files.

The limits on the journal are as follows:

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

Nested Class Summary
protected static class FlashJournalRM.Buffer
          A Buffer is a handy shell with some helper methods around a byte[] and a ByteBuffer.
protected static class FlashJournalRM.BufferPool
          The BufferPool class recycles up to a maximum number of Buffer objects.
protected  class FlashJournalRM.JournalFile
          A JournalFile is created for each OS file used to store the journal contents.
protected  class FlashJournalRM.PreparerDaemon
          The PreparerDaemon takes the enqueued Binary values for the JournalFile objects, and lays them out in Buffer objects from the BufferPool, enqueuing them for the WriterDaemon to write.
protected  class FlashJournalRM.WriterDaemon
          The WriterDaemon takes the enqueued Buffer objects from the PreparerDaemon, and appends them to a JournalFile.

 

Nested classes/interfaces inherited from class com.tangosol.io.journal.AbstractJournalRM
AbstractJournalRM.CollectorDaemon, AbstractJournalRM.JournalImpl

 

Field Summary
static int DFT_BACKLOG_SIZE
          Default maximum backlog (16MB).
static int DFT_BLOCK_SIZE
          Default block size (256KB).
static double DFT_COLLECT_PCT
          Default collection factor (collect files that are 25% or less utilized).
static long DFT_FILE_SIZE
          Default size of a file (2GB).
static int DFT_POOL_SIZE
          Default pool size (16MB).
static int DFT_PURGE_DELAY_MILLIS
          Default delay until a tmp file is eligible for purging. 2 hours is the default.
protected  java.util.concurrent.atomic.AtomicInteger m_cbBacklog
          Total amount of data enqueued to be written.
protected  int m_cbBlock
          Block size for appending to files.
protected  int m_cbMaxBacklog
          Configurable maximum backlog; defaults to 16MB.
protected  int m_cMaxPooledBlocks
          Maximum number of pooled blocks.
protected  long m_cPurgeDelayMillis
          The delay from the last touch of a tmp file until it is eligible for purging.
protected  FlashJournalRM.PreparerDaemon m_daemonPreparer
          The "rendering" thread that renders (copies and encrypts) the queued binaries into buffers to be written.
protected  FlashJournalRM.WriterDaemon m_daemonWriter
          The "writing" thread that just does appends of prepared buffers to journal files.
protected  java.io.File m_dirTemp
          Directory to store the temporary files.
protected  boolean m_fLoggedDirectory
          Set to true after the directory location has been logged.
protected  java.util.concurrent.ConcurrentMap m_mapLocators
          Map of locators to Binary values that have been queued to be written.
protected  FlashJournalRM.BufferPool m_pool
          The BufferPool of Buffer objects that are used to format data to append to the journal.
protected static long MASK_FILE_ID
          The 64-bit bitmask for the file index.
protected static long MASK_LENGTH
          The 64-bit bitmask for the value length.
protected static long MASK_OFFSET
          The 64-bit bitmask for the value offset.
static int MAX_BACKLOG_SIZE
          Maximum backlog size (1GB).
static int MAX_BLOCK_SIZE
          Maximum block size (1MB).
static long MAX_FILE_SIZE
          Maximum size of a file (4GB).
static int MAX_POOL_SIZE
          Maximum pool size (1GB).
static int MAX_VALUE_SIZE
          Maximum value size (64MB).
static int MIN_BACKLOG_SIZE
          Minimum backlog size (4KB).
static int MIN_BLOCK_SIZE
          Minimum block size (4KB).
static long MIN_FILE_SIZE
          Minimum maximum size of a file (1MB).
protected static int SHIFT_FILE_ID
          The location of the file id within the ticket.
protected static int SHIFT_LENGTH
          The location of the value-length within the ticket.
protected static int SHIFT_OFFSET
          The location of the value-offset within the ticket.
protected static int SHIFT_OFFSET_RAW
          From an encoding point of view, the raw offset is shifted four bits less than necessary, because the four least significant bits of the offset are always zero (due to paragraph alignment).

 

Fields inherited from class com.tangosol.io.journal.AbstractJournalRM
m_ajournalfile, m_cbMaxFile, m_cbMaxValue, m_cJournalFiles, m_daemonCollector, m_dflHighestLoadFactor, m_dflLoadFactorGC, m_jrnlfile, m_loader, m_nState, m_setJournals, m_xmlConfig, MASK_COMPACT_FLAG, MASK_COMPACT_LENGTH, MAX_COLLECT_PCT, MIN_COLLECT_PCT, SHIFT_COMPACT_FLAG, SHIFT_COMPACT_LENGTH, STATE_CONFIGURED, STATE_INITIAL, STATE_RUNNING, STATE_STOPPED, STATE_STOPPING

 

Constructor Summary
FlashJournalRM(Cluster cluster)
          Construct a FlashJournalRM.

 

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.
 void configure(XmlElement xml)
          The Flash Journal Resource Manager supports the following additional configuration options above the configuration options for AbstractJournalRM.
protected  long encodeTicket(int nFile, long of, int cb)
          Encode a file number, offset and length into a "ticket".
protected  FlashJournalRM.JournalFile ensureCurrentJournalFile()
          Obtain the current JournalFile that is being appended to, creating a new one if necessary.
protected  int extractFileId(long lTicket)
          Extract a file index (a file ID) from the passed ticket.
protected  int extractLength(long lTicket)
          Extract a file offset from the passed ticket.
protected  long extractOffset(long lTicket)
          Extract a file offset from the passed ticket.
 int getBacklogCount()
          Determine the number of serialized values that have not yet been persisted to disk.
 int getBacklogSize()
          Determine the total size in bytes of the serialized values that have not yet been persisted to disk.
protected  FlashJournalRM.BufferPool getBufferPool()
          Obtain the BufferPool instance.
 int getBufferSize()
          Determine the size of the buffers used to write a chunk of data at a time to an underlying journal file.
protected  double getDefaultCollectorLoadFactor()
          Determine the default percentage at which a file is eligible for garbage collection.
protected  long getDefaultMaxFileSize()
          Determine the default maximum file size for this Journal Resource Manager.
protected  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 AbstractJournalRM.toString() method.
 java.io.File getDirectory()
          Determine the directory used to store the underlying disk files for the journal.
protected  long getEvacuationMask()
          Obtain the bit mask that is used to identify tickets that need to be evacuated for a particular file id.
protected  FlashJournalRM.JournalFile getJournalFile(int nFileId)
          Obtain a JournalFile by its ID.
 int getMaxBacklogSize()
          Determine the maximum allowable size, in bytes, of the backlog; when the backlog reaches this level, writes are delayed until the backlog drops below its maximum.
 long getMaxPoolSize()
          Determine the maximum size (in bytes) of the buffers that can be held by the pool.
 long getMaxTotalRam()
          Determine the total amount, in bytes, of RAM that will be used for the Journal.
 int getPoolSize()
          Determine the size (in bytes) of the buffers that are currently available in the pool.
protected  FlashJournalRM.PreparerDaemon getPreparerDaemon()
          Obtain the PreparerDaemon instance.
 long getPurgeDelayMillis()
          Return the delay since the last touch of a tmp file until it is eligible for purging.
protected  FlashJournalRM.WriterDaemon getWriterDaemon()
          Obtain the WriterDaemon instance.
protected  FlashJournalRM.BufferPool instantiateBufferPool()
          Factory: Instantiate a pool of buffers.
protected  FlashJournalRM.JournalFile instantiateJournalFile(int nFile)
          Factory: Instantiate a JournalFile or subclass thereof.
protected  FlashJournalRM.PreparerDaemon instantiatePreparerDaemon()
          Factory: Instantiate a PreparerDaemon.
protected  FlashJournalRM.WriterDaemon instantiateWriterDaemon()
          Factory: Instantiate a WriterDaemon.
 boolean isNioRam()
          Determine if the journal will use direct buffers (NIO RAM) instead of on-heap buffers (byte arrays).
protected  void purgeOldTempFiles()
          Delete any old temp files that weren't cleaned up properly by a previous instance of the FlashJournalRM.
 void setBufferSize(int cb)
          Configure the size of the write buffers.
 void setDirectory(java.io.File dirTemp)
          Configure the directory to use for journal files.
 void setMaxBacklogSize(int cb)
          Specify the size, in bytes, of the maximum backlog.
 void setMaxFileSize(long cb)
          Configure the maximum size of the underlying journal files.
 void setMaxPoolSize(int cb)
          Configure the size of the write buffers pool.
 void setMaxValueSize(int cb)
          Specify the maximum size, in bytes, of Binary values to store.
 void setPurgeDelayMillis(long cPurgeDelayMillis)
          Sets the delay from the last touch of a tmp file until it is eligible for purging.
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.

 

Methods inherited from class com.tangosol.io.journal.AbstractJournalRM
checkInitializing, close, createBinaryStore, createJournal, destroyBinaryStore, dispose, encodeTicket, extractBinary, getBinaryStoreCount, getCluster, getCollectorDaemon, getCollectorLoadFactor, getConfig, getContextClassLoader, getFileCount, getHighestLoadFactor, getMaxCollectorSleepMillis, getMaxFileSize, getMaxJournalFiles, getMaxJournalFilesNumber, getMaxValueSize, getMinCollectorSleepMillis, getState, getStateDescription, getTicketDescription, getTotalDataSize, getTotalFileSize, instantiateCollectorDaemon, instantiateJournal, isCompact, isDedupEnabled, isRunning, isSingleEvacuation, iterateJournalFiles, iterateJournals, registerJournal, registerMBean, setCollectorLoadFactor, setConfig, setContextClassLoader, setState, shutdown, start, toString, unregisterJournal, unregisterMBean

 

Field Detail

SHIFT_FILE_ID

protected static final int SHIFT_FILE_ID
The location of the file id within the ticket.
See Also:
Constant Field Values

MASK_FILE_ID

protected static final long MASK_FILE_ID
The 64-bit bitmask for the file index. The 9 bits from 62-54.
See Also:
Constant Field Values

SHIFT_OFFSET

protected static final int SHIFT_OFFSET
The location of the value-offset within the ticket.
See Also:
Constant Field Values

SHIFT_OFFSET_RAW

protected static final int SHIFT_OFFSET_RAW
From an encoding point of view, the raw offset is shifted four bits less than necessary, because the four least significant bits of the offset are always zero (due to paragraph alignment).
See Also:
Constant Field Values

MASK_OFFSET

protected static final long MASK_OFFSET
The 64-bit bitmask for the value offset. The 28 bits 53-26.

Note that the least significant four bits of the offset MUST ALWAYS be zero, because they are NOT encoded into the ticket -- hence the 16-byte paragraph boundary for entries.

See Also:
Constant Field Values

SHIFT_LENGTH

protected static final int SHIFT_LENGTH
The location of the value-length within the ticket.
See Also:
Constant Field Values

MASK_LENGTH

protected static final long MASK_LENGTH
The 64-bit bitmask for the value length. The 26 bits 25-0.
See Also:
Constant Field Values

MAX_VALUE_SIZE

public static final int MAX_VALUE_SIZE
Maximum value size (64MB).
See Also:
Constant Field Values

MIN_BACKLOG_SIZE

public static final int MIN_BACKLOG_SIZE
Minimum backlog size (4KB).
See Also:
Constant Field Values

MAX_BACKLOG_SIZE

public static final int MAX_BACKLOG_SIZE
Maximum backlog size (1GB).
See Also:
Constant Field Values

DFT_BACKLOG_SIZE

public static final int DFT_BACKLOG_SIZE
Default maximum backlog (16MB).
See Also:
Constant Field Values

MIN_FILE_SIZE

public static final long MIN_FILE_SIZE
Minimum maximum size of a file (1MB).
See Also:
Constant Field Values

MAX_FILE_SIZE

public static final long MAX_FILE_SIZE
Maximum size of a file (4GB).
See Also:
Constant Field Values

DFT_FILE_SIZE

public static final long DFT_FILE_SIZE
Default size of a file (2GB).
See Also:
Constant Field Values

MIN_BLOCK_SIZE

public static final int MIN_BLOCK_SIZE
Minimum block size (4KB).
See Also:
Constant Field Values

MAX_BLOCK_SIZE

public static final int MAX_BLOCK_SIZE
Maximum block size (1MB).
See Also:
Constant Field Values

DFT_BLOCK_SIZE

public static final int DFT_BLOCK_SIZE
Default block size (256KB).
See Also:
Constant Field Values

MAX_POOL_SIZE

public static final int MAX_POOL_SIZE
Maximum pool size (1GB).
See Also:
Constant Field Values

DFT_POOL_SIZE

public static final int DFT_POOL_SIZE
Default pool size (16MB).
See Also:
Constant Field Values

DFT_COLLECT_PCT

public static final double DFT_COLLECT_PCT
Default collection factor (collect files that are 25% or less utilized).
See Also:
Constant Field Values

DFT_PURGE_DELAY_MILLIS

public static final int DFT_PURGE_DELAY_MILLIS
Default delay until a tmp file is eligible for purging. 2 hours is the default.
See Also:
Constant Field Values

m_dirTemp

protected java.io.File m_dirTemp
Directory to store the temporary files.

m_fLoggedDirectory

protected boolean m_fLoggedDirectory
Set to true after the directory location has been logged.

m_cbBacklog

protected java.util.concurrent.atomic.AtomicInteger m_cbBacklog
Total amount of data enqueued to be written.

m_cbMaxBacklog

protected int m_cbMaxBacklog
Configurable maximum backlog; defaults to 16MB.

m_cbBlock

protected int m_cbBlock
Block size for appending to files. Default is 256KB.

m_cMaxPooledBlocks

protected int m_cMaxPooledBlocks
Maximum number of pooled blocks. Default is 16MB of blocks.

m_cPurgeDelayMillis

protected long m_cPurgeDelayMillis
The delay from the last touch of a tmp file until it is eligible for purging. Default is 2 hours.

m_mapLocators

protected java.util.concurrent.ConcurrentMap m_mapLocators
Map of locators to Binary values that have been queued to be written. A "locator" is a ticket without an encoded length.

m_pool

protected FlashJournalRM.BufferPool m_pool
The BufferPool of Buffer objects that are used to format data to append to the journal.

m_daemonPreparer

protected FlashJournalRM.PreparerDaemon m_daemonPreparer
The "rendering" thread that renders (copies and encrypts) the queued binaries into buffers to be written.

m_daemonWriter

protected FlashJournalRM.WriterDaemon m_daemonWriter
The "writing" thread that just does appends of prepared buffers to journal files.

Constructor Detail

FlashJournalRM

public FlashJournalRM(Cluster cluster)
Construct a FlashJournalRM.
Parameters:
cluster - the Cluster for which the FlashJournalRM is storing data

Method Detail

configure

public void configure(XmlElement xml)
The Flash Journal Resource Manager supports the following additional configuration options above the configuration options for AbstractJournalRM.
Specified by:
configure in interface Controllable
Overrides:
configure in class AbstractJournalRM
Parameters:
xml - the XmlElement containing the configuration

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
Overrides:
stop in class AbstractJournalRM

getMaxTotalRam

public long getMaxTotalRam()
Determine the total amount, in bytes, of RAM that will be used for the Journal.

This property is specific to a RamJournalRM implementation.

Returns:
the maximum number of bytes that will be allocated for Journal storage

isNioRam

public boolean isNioRam()
Determine if the journal will use direct buffers (NIO RAM) instead of on-heap buffers (byte arrays).

This property is specific to a RamJournalRM implementation.

Returns:
true iff the journal is configured to use NIO "direct buffer" RAM

getMaxBacklogSize

public int getMaxBacklogSize()
Determine the maximum allowable size, in bytes, of the backlog; when the backlog reaches this level, writes are delayed until the backlog drops below its maximum.

This property is specific to a FlashJournalRM implementation.

Returns:
the maximum allowable size of the backlog

getBacklogSize

public int getBacklogSize()
Determine the total size in bytes of the serialized values that have not yet been persisted to disk. This value is also referred to as the "backlog".

This property is specific to a FlashJournalRM implementation.

Returns:
the number of bytes queued to be written

getBacklogCount

public int getBacklogCount()
Determine the number of serialized values that have not yet been persisted to disk.

This property is specific to a FlashJournalRM implementation.

Returns:
the number of serialized values queued to be written

getBufferSize

public int getBufferSize()
Determine the size of the buffers used to write a chunk of data at a time to an underlying journal file.

This property is specific to a FlashJournalRM implementation.

Returns:
the size, in bytes, of each buffer

getMaxPoolSize

public long getMaxPoolSize()
Determine the maximum size (in bytes) of the buffers that can be held by the pool. This is not a limit of how many buffers can be allocated, since some may be in use at any time, but rather how many will be held by the pool (i.e. recycled) as they are released.
Returns:
the maximum size in bytes of all of the buffers that the buffer pool can hold onto

getPoolSize

public int getPoolSize()
Determine the size (in bytes) of the buffers that are currently available in the pool. This is not a measurement of how many buffers are currently in use or how many have been allocated.

This property is specific to a FlashJournalRM implementation.

Returns:
the total size in bytes of all of the buffers that are currently in the buffer pool

setMaxValueSize

public void setMaxValueSize(int cb)
Specify the maximum size, in bytes, of Binary values to store. This property is provided to prevent unexpectedly large data from clogging up the journal write-behind, and by default it is set to the maximum supported size of 64MB, as defined by MAX_VALUE_SIZE.

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

Specified by:
setMaxValueSize in class AbstractJournalRM
Parameters:
cb - the maximum allowable size for a Binary value, or zero to specify no configured maximum for the value size

setMaxBacklogSize

public void setMaxBacklogSize(int cb)
Specify the size, in bytes, of the maximum backlog. The backlog defaults to 16MB as defined by DFT_BACKLOG_SIZE, with a minimum defined by MIN_BACKLOG_SIZE and a maximum defined by MAX_BACKLOG_SIZE. The backlog is the amount of data that has been "dropped off" for the journal to write to disk, but which has not yet been written to disk; when the amount of backlog exceeds the maximum configured backlog, client threads attempting to "drop off" data are blocked until the backlog recedes below the maximum, thus helping to prevent out-of-memory conditions. Note that the maximum amount of memory used by the backlog is at least twice the configured amount, since the data dropped off is held in it Binary form and rendered to the write-behind buffers.

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

Parameters:
cb - the maximum allowable size of the backlog

setBufferSize

public void setBufferSize(int cb)
Configure the size of the write buffers. This is the size that writes to an underlying disk file will occur in, and the size should match or be a multiple of the physical device's optimal block size. The value must be a power of two. The default is 256KB, as specified by DFT_BLOCK_SIZE, with a minimum defined by MIN_BLOCK_SIZE and a maximum defined by MAX_BLOCK_SIZE.

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

Parameters:
cb - the size, in bytes, for the buffers to write to the underlying journal files

setMaxPoolSize

public void setMaxPoolSize(int cb)
Configure the size of the write buffers pool. The default is defined by DFT_POOL_SIZE, with a maximum defined by MAX_POOL_SIZE and a minimum enforced as the size of a single buffer.

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

Parameters:
cb - the size, in bytes, for the buffer pool

getDirectory

public java.io.File getDirectory()
Determine the directory used to store the underlying disk files for the journal.
Returns:
the directory that is used to hold the journal files, or null if the default temporary directory is used

setDirectory

public void setDirectory(java.io.File dirTemp)
Configure the directory to use for journal files. This property is provided so that servers with multiple physical storage devices and/or file systems can select an ideal storage location for a journal; the ideal device is a flash (solid state disk, aka SSD) device, since the journal is designed as a block-writing, append-only implementation.

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

Parameters:
dirTemp - the directory to use for journal files

setMaxFileSize

public 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.

The file size must be a multiple of the block size; if it is not, it will be rounded down to the nearest block size, but will not result in a file size less than one block. If setting both the block and file size, set the block size first, since changing the block size will adjust the file size to ensure that it is a multiple of the block size.

Specified by:
setMaxFileSize in class AbstractJournalRM
Parameters:
cb - the maximum size, in bytes, for journal files

getPurgeDelayMillis

public long getPurgeDelayMillis()
Return the delay since the last touch of a tmp file until it is eligible for purging. Tmp files are purged at startup of the FlashJournalRM to clean up tmp files from a previous instance of the FlashJournalRM.
Returns:
the delay in milliseconds

setPurgeDelayMillis

public void setPurgeDelayMillis(long cPurgeDelayMillis)
Sets the delay from the last touch of a tmp file until it is eligible for purging.
Parameters:
cPurgeDelayMillis - the delay in milliseconds

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.
Overrides:
applyConfig in class AbstractJournalRM
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.
Overrides:
startThreads in class AbstractJournalRM

purgeOldTempFiles

protected void purgeOldTempFiles()
Delete any old temp files that weren't cleaned up properly by a previous instance of the FlashJournalRM. While all temp files that are created are configured to be "deleted on exit", it is possible that the temp files would not have been deleted if the JVM crashed or if there was a fault at the physical machine level.

stopThreads

protected void stopThreads()
Stop the various threads used by this Journal Resource Manager.
Overrides:
stopThreads in class AbstractJournalRM

getDescription

protected java.lang.String getDescription()
Format the object attributes into a String for inclusion in the String returned from the AbstractJournalRM.toString() method.
Overrides:
getDescription in class AbstractJournalRM
Returns:
a comma-delimited String listing the attributes of this object in the form "attribute=value"

getDefaultMaxFileSize

protected long getDefaultMaxFileSize()
Determine the default maximum file size for this Journal Resource Manager.
Specified by:
getDefaultMaxFileSize in class AbstractJournalRM
Returns:
the default maximum file size

getDefaultMaxValueSize

protected int getDefaultMaxValueSize()
Determine the default maximum value size for this Journal Resource Manager.
Specified by:
getDefaultMaxValueSize in class AbstractJournalRM
Returns:
the default maximum value size

getDefaultCollectorLoadFactor

protected double getDefaultCollectorLoadFactor()
Determine the default percentage at which a file is eligible for garbage collection.
Specified by:
getDefaultCollectorLoadFactor in class AbstractJournalRM
Returns:
the default garbage collection load factor

getJournalFile

protected FlashJournalRM.JournalFile getJournalFile(int nFileId)
Obtain a JournalFile by its ID.
Overrides:
getJournalFile in class AbstractJournalRM
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 FlashJournalRM.JournalFile ensureCurrentJournalFile()
Obtain the current JournalFile that is being appended to, creating a new one if necessary.
Overrides:
ensureCurrentJournalFile in class AbstractJournalRM
Returns:
the current JournalFile, or null if the storage is full and no new JournalFile can be created as a result

instantiateJournalFile

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

instantiateBufferPool

protected FlashJournalRM.BufferPool instantiateBufferPool()
Factory: Instantiate a pool of buffers.
Returns:
a BufferPool or subclass thereof

getBufferPool

protected FlashJournalRM.BufferPool getBufferPool()
Obtain the BufferPool instance.
Returns:
the BufferPool for this FlashJournalRM

instantiatePreparerDaemon

protected FlashJournalRM.PreparerDaemon instantiatePreparerDaemon()
Factory: Instantiate a PreparerDaemon.
Returns:
a PreparerDaemon or a sub-class thereof

getPreparerDaemon

protected FlashJournalRM.PreparerDaemon getPreparerDaemon()
Obtain the PreparerDaemon instance.
Returns:
the PreparerDaemon for this FlashJournalRM

instantiateWriterDaemon

protected FlashJournalRM.WriterDaemon instantiateWriterDaemon()
Factory: Instantiate a WriterDaemon.
Returns:
a WriterDaemon or a sub-class thereof

getWriterDaemon

protected FlashJournalRM.WriterDaemon getWriterDaemon()
Obtain the WriterDaemon instance.
Returns:
the WriterDaemon for this FlashJournalRM

getEvacuationMask

protected long getEvacuationMask()
Obtain the bit mask that is used to identify tickets that need to be evacuated for a particular file id.
Specified by:
getEvacuationMask in class AbstractJournalRM
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 int extractFileId(long lTicket)
Extract a file index (a file ID) from the passed ticket.
Specified by:
extractFileId in class AbstractJournalRM
Parameters:
lTicket - a "ticket" that was created by the Journal
Returns:
the file index for the value represented by that ticket

extractOffset

protected long extractOffset(long lTicket)
Extract a file offset from the passed ticket.
Specified by:
extractOffset in class AbstractJournalRM
Parameters:
lTicket - a "ticket" that was created by the Journal
Returns:
the file offset for the value represented by that ticket

extractLength

protected int extractLength(long lTicket)
Extract a file offset from the passed ticket.
Specified by:
extractLength in class AbstractJournalRM
Parameters:
lTicket - a "ticket" that was created by the Journal
Returns:
the file offset for the value represented by that ticket

encodeTicket

protected long encodeTicket(int nFile,
                            long of,
                            int cb)
Encode a file number, offset and length into a "ticket".
Specified by:
encodeTicket in class AbstractJournalRM
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

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.