Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.io.journal
Class BackupJournalRM

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

All Implemented Interfaces:
com.oracle.common.base.Disposable, BinaryStoreManager

public class BackupJournalRM
extends java.lang.Object
implements com.oracle.common.base.Disposable, BinaryStoreManager

The BackupJournalRM is a "meta" journal resource manager that is intended to be used for storage of "backup" data. This resource manager passes all writes to a RAM journal until the RAM journal hits a certain load factor, after which it passes all writes to the flash journal that the RAM journal overflows to, and also it evacuates the items stored in RAM to flash.

Since:
Coherence 3.7.1
Author:
cp 2011-03-25

Nested Class Summary
protected  class BackupJournalRM.FlashConsumer
          The FlashConsumer is a "dummy" consumer used to obtain a flash journal instance.
protected  class BackupJournalRM.JournalImpl
          A Journal implementation managed by this Journal Resource Manager.
protected  class BackupJournalRM.RamConsumer
          The RamConsumer is a pass-through consumer used to obtain a ram journal instance.

 

Constructor Summary
BackupJournalRM(RamJournalRM jrnlrmRam, double dflLoadFactorLimit)
          Construct a BackupJournalRM based on a RamJournalRM.

 

Method Summary
 void close()
          Deprecated. use the Disposable interface
 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  void evacuateRam()
          Move all data that is owned by the consumers of this BackupJournalRM from the RAM journal to the flash journal.
 FlashJournalRM getFlashJournalRM()
          Obtain the underlying FlashJournalRM.
 double getLoadFactorLimit()
          Determine the high-water mark load factor for the RAM journal above which all writes are delegated to the flash journal.
 RamJournalRM getRamJournalRM()
          Obtain the underlying RamJournalRM.
protected  BackupJournalRM.FlashConsumer instantiateFlashConsumer()
          Factory: Instantiate a FlashConsumer object.
protected  BackupJournalRM.JournalImpl instantiateJournal()
          Instantiate a JournalImpl object.
protected  BackupJournalRM.JournalImpl instantiateJournal(Journal jrnlRam, Journal jrnlFlash)
          Factory: Instantiate a JournalImpl object.
protected  BackupJournalRM.RamConsumer instantiateRamConsumer()
          Factory: Instantiate a RamConsumer object.
 boolean isLimitExceeded()
          Determine if the RAM journal load factor has been exceeded.
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(BackupJournalRM.JournalImpl journal)
          Register a Journal that uses this Journal Resource Manager.
protected  void unregisterJournal(BackupJournalRM.JournalImpl journal)
          Register a Journal that uses this Journal Resource Manager.

 

Constructor Detail

BackupJournalRM

public BackupJournalRM(RamJournalRM jrnlrmRam,
                       double dflLoadFactorLimit)
Construct a BackupJournalRM based on a RamJournalRM.
Parameters:
jrnlrmRam - the RamJournalRM to delegate to; note that the RamJournalRM must have a FlashJournalRM behind it
dflLoadFactorLimit - the load factor of the RamJournalRM that will cause the BackupJournalRM to switch to storing data directly in the FlashJournalRM

Method Detail

getRamJournalRM

public RamJournalRM getRamJournalRM()
Obtain the underlying RamJournalRM.
Returns:
the RamJournalRM used by this BackupJournalRM

getFlashJournalRM

public FlashJournalRM getFlashJournalRM()
Obtain the underlying FlashJournalRM.
Returns:
the FlashJournalRM used by this BackupJournalRM

getLoadFactorLimit

public double getLoadFactorLimit()
Determine the high-water mark load factor for the RAM journal above which all writes are delegated to the flash journal.
Returns:
the RAM journal load factor limit

isLimitExceeded

public boolean isLimitExceeded()
Determine if the RAM journal load factor has been exceeded.

This method also has the side-effect of evacuating the RAM journal to the flash journal once the limit has been exceeded.

Returns:
true iff the RAM journal load factor has been exceeded

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

dispose

public void dispose()
Specified by:
dispose in interface com.oracle.common.base.Disposable

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.

evacuateRam

protected void evacuateRam()
Move all data that is owned by the consumers of this BackupJournalRM from the RAM journal to the flash journal.

instantiateJournal

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

instantiateJournal

protected BackupJournalRM.JournalImpl instantiateJournal(Journal jrnlRam,
                                                         Journal jrnlFlash)
Factory: Instantiate a JournalImpl object.
Parameters:
jrnlRam - the RAM journal to use
jrnlFlash - the flash journal to use
Returns:
a JournalImpl instance or subclass thereof

registerJournal

protected void registerJournal(BackupJournalRM.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(BackupJournalRM.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

instantiateRamConsumer

protected BackupJournalRM.RamConsumer instantiateRamConsumer()
Factory: Instantiate a RamConsumer object.
Returns:
an instance of RamConsumer or a subclass thereof.

instantiateFlashConsumer

protected BackupJournalRM.FlashConsumer instantiateFlashConsumer()
Factory: Instantiate a FlashConsumer object.
Returns:
an instance of FlashConsumer or a subclass thereof.

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


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