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 JournalBinaryStore

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

All Implemented Interfaces:
com.oracle.common.base.Disposable, BinaryStore, BinaryStore.KeySetAware, BinaryStore.SizeAware, Journal.JournalConsumer

public class JournalBinaryStore
extends java.lang.Object
implements BinaryStore.KeySetAware, Journal.JournalConsumer

A BinaryStore that writes to a Journal.

Since:
Coherence 3.7
Author:
cp 2010-06-10; rhl 2013-01-18

Nested Class Summary
protected static class JournalBinaryStore.ClearListener
          The ClearListener is used to ensure that entries are removed from the journal when the corresponding keys are cleared from the ticket tree.

 

Nested classes/interfaces inherited from interface com.tangosol.io.BinaryStore
BinaryStore.KeySetAware, BinaryStore.SizeAware

 

Field Summary
protected  MultiBinaryLongMap f_mblm
          The MultiBinaryLongMap.
protected  BinaryLongMap m_blmTickets
          Mapping from Binary keys to journal "tickets".
protected  java.util.concurrent.atomic.AtomicLong m_cbTotal
          Number of bytes in the Journal currently "owned" by this BinaryStore.
protected  long m_cEvacuations
          The number of evacuations occurred on this Journal.JournalConsumer.
protected  Journal m_journal
          The journal manager for this BinaryStore.

 

Constructor Summary
JournalBinaryStore(Journal journal)
          Construct a JournalBinaryStore.
JournalBinaryStore(Journal journal, MultiBinaryLongMap mblm)
          Construct a JournalBinaryStore.

 

Method Summary
protected  BinaryLongMap configureTicketTree()
          Configure and return the BinaryLongMap to be used to store journal tickets.
 boolean containsKey(Binary binKey)
          Return true iff this BinaryStore contains a mapping for the specified key.
 void dedupe(byte[][] aab)
          This method may be invoked by the Journal implementation to request that any immutable byte arrays managed by the consumer be de-duplicated.
 void dispose()
          
 void erase(Binary binKey)
          Remove the specified key from the underlying store if present.
 void eraseAll()
          Remove all data from the underlying store.
 void evacuate(long lTicketMask, long lTicketValue)
          This method may be invoked by the Journal implementation to request that the consumer evacuate a particular journal file.
 long getByteCount()
          Calculate the total amount of data currently stored in the journal by this BinaryStore.
 java.lang.String getDescription()
          Format a String description of the Consumer.
 Journal getJournal()
          Obtain the underlying journaling system used by this BinaryStore.
 int getKeyCount()
          Determine the number of keys currently stored in the journal by this BinaryStore.
 MultiBinaryLongMap getMultiBinaryLongMap()
          Return the MultiBinaryLongMap used to store the underlying keys in this KeySetAware BinaryStore.
protected  BinaryLongMap getTicketTree()
          An internal accessor for the "tree of tickets"; this accessor is used only by client threads, and has a built-in check for if the journal has already been disposed of (which could occur on a different thread).
 java.util.Iterator keys()
          Iterate all keys in the underlying store.
 Binary load(Binary binKey)
          Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
 int size()
          Determine the number of keys in the BinaryStore.
 void store(Binary binKey, Binary binValue)
          Store the specified value under the specific key in the underlying store.
 java.lang.String toString()
          

 

Field Detail

m_cEvacuations

protected volatile long m_cEvacuations
The number of evacuations occurred on this Journal.JournalConsumer.

m_journal

protected Journal m_journal
The journal manager for this BinaryStore.

m_blmTickets

protected BinaryLongMap m_blmTickets
Mapping from Binary keys to journal "tickets".

f_mblm

protected final MultiBinaryLongMap f_mblm
The MultiBinaryLongMap.

m_cbTotal

protected final java.util.concurrent.atomic.AtomicLong m_cbTotal
Number of bytes in the Journal currently "owned" by this BinaryStore.

Constructor Detail

JournalBinaryStore

public JournalBinaryStore(Journal journal)
Construct a JournalBinaryStore.
Parameters:
journal - the Journal to write to and read from

JournalBinaryStore

public JournalBinaryStore(Journal journal,
                          MultiBinaryLongMap mblm)
Construct a JournalBinaryStore.
Parameters:
journal - the Journal to write to and read from
mblm - the MultiBinaryLongMap used to store the keys and tickets

Method Detail

load

public Binary load(Binary binKey)
Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
Specified by:
load in interface BinaryStore
Parameters:
binKey - key whose associated value is to be returned
Returns:
the value associated with the specified key, or null if no value is available for that key

store

public void store(Binary binKey,
                  Binary binValue)
Store the specified value under the specific key in the underlying store. This method is intended to support both key/value creation and value update for a specific key.
Specified by:
store in interface BinaryStore
Parameters:
binKey - key to store the value under
binValue - value to be stored

erase

public void erase(Binary binKey)
Remove the specified key from the underlying store if present.
Specified by:
erase in interface BinaryStore
Parameters:
binKey - key whose mapping is to be removed from the map

eraseAll

public void eraseAll()
Remove all data from the underlying store.
Specified by:
eraseAll in interface BinaryStore

keys

public java.util.Iterator keys()
Iterate all keys in the underlying store.
Specified by:
keys in interface BinaryStore
Returns:
a read-only iterator of the keys in the underlying store

size

public int size()
Determine the number of keys in the BinaryStore.
Specified by:
size in interface BinaryStore.SizeAware
Returns:
the number of keys in the BinaryStore

containsKey

public boolean containsKey(Binary binKey)
Return true iff this BinaryStore contains a mapping for the specified key.
Specified by:
containsKey in interface BinaryStore.KeySetAware
Parameters:
binKey - key whose presence in the BinaryStore is to be tested
Returns:
true iff this BinaryStore contains a mapping for the specified key

getMultiBinaryLongMap

public MultiBinaryLongMap getMultiBinaryLongMap()
Return the MultiBinaryLongMap used to store the underlying keys in this KeySetAware BinaryStore.
Specified by:
getMultiBinaryLongMap in interface BinaryStore.KeySetAware
Returns:
the MultiBinaryLongMap used to store the keys in this BinaryStore

evacuate

public void evacuate(long lTicketMask,
                     long lTicketValue)
This method may be invoked by the Journal implementation to request that the consumer evacuate a particular journal file.
Specified by:
evacuate in interface Journal.JournalConsumer
Parameters:
lTicketMask - indicates which bits of the tickets to check
lTicketValue - indicates what bit pattern needs to be matched on the tickets in order to select them for evacuation

dedupe

public void dedupe(byte[][] aab)
This method may be invoked by the Journal implementation to request that any immutable byte arrays managed by the consumer be de-duplicated.
Specified by:
dedupe in interface Journal.JournalConsumer
Parameters:
aab - an array of byte[] objects for intern-ing byte[] references

getDescription

public java.lang.String getDescription()
Format a String description of the Consumer.
Specified by:
getDescription in interface Journal.JournalConsumer
Returns:
a comma-delimited key-value description of this object

dispose

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

toString

public java.lang.String toString()

getJournal

public Journal getJournal()
Obtain the underlying journaling system used by this BinaryStore.
Returns:
the Journal that this JournalBinaryStore uses.

getKeyCount

public int getKeyCount()
Determine the number of keys currently stored in the journal by this BinaryStore. Note that this doesn't including data that has been released but whose space has not yet been reclaimed by the journal.
Returns:
the number of keys in the journal held for this BinaryStore

getByteCount

public long getByteCount()
Calculate the total amount of data currently stored in the journal by this BinaryStore. Note that this doesn't including data that has been released but whose space has not yet been reclaimed by the journal.
Returns:
the number of bytes in the journal used by this BinaryStore

getTicketTree

protected BinaryLongMap getTicketTree()
An internal accessor for the "tree of tickets"; this accessor is used only by client threads, and has a built-in check for if the journal has already been disposed of (which could occur on a different thread).
Returns:
the tree of tickets

configureTicketTree

protected BinaryLongMap configureTicketTree()
Configure and return the BinaryLongMap to be used to store journal tickets.
Returns:
the BinaryLongMap to be used to store journal tickets

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.