Package com.tangosol.io.journal
Class JournalBinaryStore.ClearListener
- java.lang.Object
-
- com.tangosol.io.journal.JournalBinaryStore.ClearListener
-
- All Implemented Interfaces:
MultiBinaryLongMap.BinaryLongMapListener
,EventListener
- Enclosing class:
- JournalBinaryStore
protected static class JournalBinaryStore.ClearListener extends Object implements MultiBinaryLongMap.BinaryLongMapListener
The ClearListener is used to ensure that entries are removed from the journal when the corresponding keys arecleared
from the ticket tree.Note: this listener directly holds references to the state members of the containing JournalBinaryStore as it could be run during the context of a
JournalBinaryStore.dispose()
call.
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicLong
f_atomicSize
The atomic holding the size counter.protected Journal
f_journal
The Journal.protected BinaryLongMap
f_tree
The BinaryLongMap mapping keys to journal tickets.
-
Constructor Summary
Constructors Constructor Description ClearListener(BinaryLongMap blm, Journal journal, AtomicLong atomicSize)
Construct a ClearListener for the specified BinaryLongMap and journal.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
keyAdded(Binary binKey)
A notification that the primary map has added a new Binary/long key/value mapping; this implicitly creates a new key/value mapping in each delegating map, with the value being 0L.void
keyRemoving(Binary binKey)
A notification that the primary map is removing a Binary/long key/value mapping; this implies that the existing key/value mapping for the same Binary key in each delegating map is also being removed.void
mapCleared()
A notification that the primary map has been cleared; this implies that all of the existing key/value mappings in each delegating map have also been removed.void
mapClearing()
A notification that the primary map is about to be cleared; this implies that all of the existing key/value mappings in each delegating map are about to be removed, but that no per-mapping events will be generated in response to those removals.
-
-
-
Field Detail
-
f_tree
protected final BinaryLongMap f_tree
The BinaryLongMap mapping keys to journal tickets.
-
f_journal
protected final Journal f_journal
The Journal.
-
f_atomicSize
protected final AtomicLong f_atomicSize
The atomic holding the size counter.
-
-
Constructor Detail
-
ClearListener
public ClearListener(BinaryLongMap blm, Journal journal, AtomicLong atomicSize)
Construct a ClearListener for the specified BinaryLongMap and journal.- Parameters:
blm
- the binary long map holding journal ticketsjournal
- the journalatomicSize
- the atomic size counter to update
-
-
Method Detail
-
keyAdded
public void keyAdded(Binary binKey)
A notification that the primary map has added a new Binary/long key/value mapping; this implicitly creates a new key/value mapping in each delegating map, with the value being 0L.- Specified by:
keyAdded
in interfaceMultiBinaryLongMap.BinaryLongMapListener
- Parameters:
binKey
- the key that was added
-
keyRemoving
public void keyRemoving(Binary binKey)
A notification that the primary map is removing a Binary/long key/value mapping; this implies that the existing key/value mapping for the same Binary key in each delegating map is also being removed.- Specified by:
keyRemoving
in interfaceMultiBinaryLongMap.BinaryLongMapListener
- Parameters:
binKey
- the key that is being removed
-
mapClearing
public void mapClearing()
A notification that the primary map is about to be cleared; this implies that all of the existing key/value mappings in each delegating map are about to be removed, but that no per-mapping events will be generated in response to those removals.- Specified by:
mapClearing
in interfaceMultiBinaryLongMap.BinaryLongMapListener
-
mapCleared
public void mapCleared()
A notification that the primary map has been cleared; this implies that all of the existing key/value mappings in each delegating map have also been removed.- Specified by:
mapCleared
in interfaceMultiBinaryLongMap.BinaryLongMapListener
-
-