Package com.illumon.iris.db.v2
Class TableMapImpl
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,Deflatable<TableMap>,LivenessManager,LivenessNode,LivenessReferent,DynamicNode,TableMap,TransformableTableMap,Serializable
- Direct Known Subclasses:
LocalTableMap,TableMapClient
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.TableMap
TableMap.KeyListener, TableMap.ListenerNested classes/interfaces inherited from interface com.illumon.iris.db.v2.TransformableTableMap
TransformableTableMap.AsTableBuilder -
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.TableMap
SENTINEL_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddKeyListener(TableMap.KeyListener listener) Listen to changes in the map's keys.voidaddListener(TableMap.Listener listener) Add a new listener for changes to the map.voidaddParentReference(Object parent) Called on a dependent node to ensure that a strong reference is maintained to any parent object that is required for the proper maintenance and functioning of the dependent.protected voiddestroy()Attempt to release (destructively when necessary) resources held by this object.booleanIs the node updating?protected voidnotifyKeyListeners(Object key) NotifyTableMap.KeyListeners of an inserted key.protected voidnotifyListeners(Object key, Table table) NotifyTableMap.Listeners of an inserted table.voidremoveKeyListener(TableMap.KeyListener listener) Removes a key change listener.voidremoveListener(TableMap.Listener listener) Removes a map change listener.booleansetRefreshing(boolean refreshing) Change the node's refresh mode.Methods inherited from class com.illumon.iris.db.util.liveness.LivenessArtifact
manageWithCurrentScope, unmanage, unmanageMethods inherited from class com.illumon.iris.db.util.liveness.ReferenceCountedLivenessNode
dropReference, getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryRetainReferenceMethods inherited from class com.illumon.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessManager
manage, tryManageMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods inherited from interface com.illumon.iris.db.v2.TableMap
apply, asTableMap, deflate, entrySet, flatten, get, getKeySet, getWithTransform, populateKeys, preemptiveUpdatesTable, size, transformTables, transformTables, transformTablesWithKey, transformTablesWithKey, transformTablesWithMap, valuesMethods inherited from interface com.illumon.iris.db.v2.TransformableTableMap
asTable, asTable, asTableBuilder, merge
-
Constructor Details
-
TableMapImpl
public TableMapImpl()
-
-
Method Details
-
addListener
Description copied from interface:TableMapAdd a new listener for changes to the map.- Specified by:
addListenerin interfaceTableMap- Parameters:
listener- map change listener
-
removeListener
Description copied from interface:TableMapRemoves a map change listener.- Specified by:
removeListenerin interfaceTableMap- Parameters:
listener- map change listener.
-
addKeyListener
Description copied from interface:TableMapListen to changes in the map's keys.- Specified by:
addKeyListenerin interfaceTableMap- Parameters:
listener- key change listener
-
removeKeyListener
Description copied from interface:TableMapRemoves a key change listener.- Specified by:
removeKeyListenerin interfaceTableMap- Parameters:
listener- key change listener to remove
-
notifyListeners
NotifyTableMap.Listeners of an inserted table.- Parameters:
key- the newly inserted keytable- the corresponding table
-
notifyKeyListeners
NotifyTableMap.KeyListeners of an inserted key.- Parameters:
key- the newly inserted key
-
isRefreshing
public boolean isRefreshing()Description copied from interface:DynamicNodeIs the node updating?- Specified by:
isRefreshingin interfaceDynamicNode- Returns:
- true if the node is updating; false otherwise.
-
setRefreshing
public boolean setRefreshing(boolean refreshing) Description copied from interface:DynamicNodeChange the node's refresh mode.- Specified by:
setRefreshingin interfaceDynamicNode- Parameters:
refreshing- true to cause the node to update; false otherwise.- Returns:
- new refreshing state
-
addParentReference
Description copied from interface:DynamicNodeCalled on a dependent node to ensure that a strong reference is maintained to any parent object that is required for the proper maintenance and functioning of the dependent. In the most common case, the parent object is a child listener to a parent node. The parent node only keeps a weak reference to its child listener, but the listener maintains a strong reference to the parent node. In this scenario, the only strong reference to the listener (and thus indirectly to the parent node itself) is the reference kept by the dependent node.- Specified by:
addParentReferencein interfaceDynamicNode- Parameters:
parent- A parent of this node
-
destroy
protected void destroy()Description copied from class:ReferenceCountedLivenessNodeAttempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().
This is intended to only ever be used as a side effect of decreasing the reference count to 0.
- Overrides:
destroyin classReferenceCountedLivenessNode
-