- java.lang.Object
-
- swim.streamlet.AbstractMapInlet<K,V,O>
-
- Direct Known Subclasses:
MapOutput,OutletMapInlet,WatchFieldsOperator
public abstract class AbstractMapInlet<K,V,O> extends Object implements MapInlet<K,V,O>
-
-
Constructor Summary
Constructors Constructor Description AbstractMapInlet()
-
Method Summary
Modifier and Type Method Description voidbindInput(MapOutlet<K,V,? extends O> input)voidbindInput(Outlet<? extends O> input)Connects thisInletto anOutletfrom which it will acquire its state.protected voiddidInvalidateOutput()protected voiddidInvalidateOutputKey(K key, KeyEffect effect)protected voiddidReconcileOutput(int version)protected voiddidReconcileOutputKey(K key, KeyEffect effect, int version)voiddisconnectInputs()Disconnects allInlets dominated by thisInletin the dataflow dependency graph.voiddisconnectOutputs()Disconnects allOutlets dominated by thisInletin the dataflow graph.MapOutlet<K,V,? extends O>input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.voidinvalidateOutput()Marks thisInlet—and theStreamletto which thisInletis attached—as having stale state.voidinvalidateOutputKey(K key, KeyEffect effect)Marks thisMapInletas needing aneffectapplied to a givenkey.protected voidonInvalidateOutput()protected voidonInvalidateOutputKey(K key, KeyEffect effect)protected voidonReconcileOutput(int version)protected voidonReconcileOutputKey(K key, KeyEffect effect, int version)voidreconcileOutput(int version)Reconciles the state of thisInlet, if the version of thisInlet's state differs from the targetversion.voidreconcileOutputKey(K key, int version)Reconciles the state of an individualkeyin thisMapInlet, if the version of thisMapInlet's state differs from the targetversion.voidunbindInput()Disconnects thisInletfrom its inputOutlet, if connected.protected voidwillInvalidateOutput()protected voidwillInvalidateOutputKey(K key, KeyEffect effect)protected voidwillReconcileOutput(int version)protected voidwillReconcileOutputKey(K key, KeyEffect effect, int version)
-
-
-
Method Detail
-
input
public MapOutlet<K,V,? extends O> input()
Description copied from interface:InletReturns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.
-
bindInput
public void bindInput(Outlet<? extends O> input)
Description copied from interface:InletConnects thisInletto anOutletfrom which it will acquire its state. If thisInletis already connected, it will first disconnect from its existing input. Then, after updating itsinputproperty, theInletwill invokeOutlet.bindOutput(Inlet)on its newinput.
-
unbindInput
public void unbindInput()
Description copied from interface:InletDisconnects thisInletfrom its inputOutlet, if connected. After setting itsinputproperty tonull, theInletwill invokeOutlet.unbindOutput(Inlet)on its old input, if defined.- Specified by:
unbindInputin interfaceInlet<K>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:InletDisconnects allInlets dominated by thisInletin the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisInlet.- Specified by:
disconnectInputsin interfaceInlet<K>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:InletDisconnects allOutlets dominated by thisInletin the dataflow graph. Used to recursively clean up chains of combinators passing through thisInlet.- Specified by:
disconnectOutputsin interfaceInlet<K>
-
invalidateOutputKey
public void invalidateOutputKey(K key, KeyEffect effect)
Description copied from interface:MapInletMarks thisMapInletas needing aneffectapplied to a givenkey. Invalidating an individual key invalidates the entire state of theInlet. But only the invalidated keys need to be updated in order to reconcile the overall state of theInlet.- Specified by:
invalidateOutputKeyin interfaceMapInlet<K,V,O>
-
invalidateOutput
public void invalidateOutput()
Description copied from interface:InletMarks thisInlet—and theStreamletto which thisInletis attached—as having stale state. Invalidating anInletwill recursively invalidate all streamlets that transitively depend on the state of thisInlet. Invalidating anInletdoes not cause its state to be recomputed. A subsequentInlet.reconcileOutput(int)call will reconcile the state of theInlet.- Specified by:
invalidateOutputin interfaceInlet<K>
-
reconcileOutputKey
public void reconcileOutputKey(K key, int version)
Description copied from interface:MapInletReconciles the state of an individualkeyin thisMapInlet, if the version of thisMapInlet's state differs from the targetversion. To reconcile the state of a key, theMapInletfirst invokesMapOutlet.reconcileInputKey(Object, int)on itsinput, if its input is aMapOutlet, or it invokesOutlet.reconcileInput(int), if its input is not aMapOutlet. Then, if all invalid keys have been reconciled, theMapInletinvokesStreamlet.reconcile(int)on its attached streamlet.- Specified by:
reconcileOutputKeyin interfaceMapInlet<K,V,O>
-
reconcileOutput
public void reconcileOutput(int version)
Description copied from interface:InletReconciles the state of thisInlet, if the version of thisInlet's state differs from the targetversion. To reconcile its state, theInletfirst invokesOutlet.reconcileInput(int)on itsinput, to ensure that its input is up-to-date. It then invokesStreamlet.reconcile(int)on theStreamletto which it's attached, causing theStreamletto reconcile its own state.- Specified by:
reconcileOutputin interfaceInlet<K>
-
willInvalidateOutput
protected void willInvalidateOutput()
-
onInvalidateOutput
protected void onInvalidateOutput()
-
didInvalidateOutput
protected void didInvalidateOutput()
-
willReconcileOutput
protected void willReconcileOutput(int version)
-
onReconcileOutput
protected void onReconcileOutput(int version)
-
didReconcileOutput
protected void didReconcileOutput(int version)
-
-