Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.io.journal
Class JournalBinaryStore

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

All Implemented Interfaces:
BinaryStore, BinaryStore.SizeAware, Journal.JournalConsumer, Disposable

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

A BinaryStore that writes to a Journal.

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

Nested Class Summary

 

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

 

Field Summary
protected  java.util.concurrent.atomic.AtomicLong m_cbTotal
          Number of bytes in the Journal currently "owned" by this BinaryStore.
protected  Journal m_journal
          The journal manager for this BinaryStore.
protected  java.util.concurrent.locks.ReentrantReadWriteLock m_lock
          The read/write lock for concurrency control for the BinaryRadixTree.
protected  java.util.concurrent.locks.Lock m_lockExclusive
          The exclusive lock for performing mutating operations against the BinaryRadixTree.
protected  java.util.concurrent.locks.Lock m_lockShared
          The shared lock for performing read operations against the BinaryRadixTree.
protected  BinaryRadixTree m_treeTickets
          Mapping from Binary keys to journal "tickets".

 

Constructor Summary
JournalBinaryStore(Journal journal)
          Construct a JournalBinaryStore.

 

Method Summary
 void close()
          Deprecated. use the Disposable interface
 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.
protected  BinaryRadixTree 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_journal

protected Journal m_journal
The journal manager for this BinaryStore.

m_treeTickets

protected BinaryRadixTree m_treeTickets
Mapping from Binary keys to journal "tickets".

m_cbTotal

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

m_lock

protected final java.util.concurrent.locks.ReentrantReadWriteLock m_lock
The read/write lock for concurrency control for the BinaryRadixTree.

m_lockShared

protected final java.util.concurrent.locks.Lock m_lockShared
The shared lock for performing read operations against the BinaryRadixTree.

m_lockExclusive

protected final java.util.concurrent.locks.Lock m_lockExclusive
The exclusive lock for performing mutating operations against the BinaryRadixTree.

Constructor Detail

JournalBinaryStore

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

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

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()

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.

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 BinaryRadixTree 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

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.