- java.lang.Object
-
- swim.streamlet.AbstractMapInletOutlet<K,V,I,O>
-
- All Implemented Interfaces:
Inlet<I>,MapInlet<K,V,I>,MapInletOutlet<K,V,I,O>,Outlet<O>
- Direct Known Subclasses:
ReduceFieldsOperator
public abstract class AbstractMapInletOutlet<K,V,I,O> extends Object implements MapInletOutlet<K,V,I,O>
-
-
Constructor Summary
Constructors Constructor Description AbstractMapInletOutlet()
-
Method Summary
Modifier and Type Method Description voidbindInput(MapOutlet<K,V,? extends I> input)voidbindInput(Outlet<? extends I> input)Connects thisInletto anOutletfrom which it will acquire its state.voidbindOutput(Inlet<? super O> output)Adds anoutputto the set ofInlets that depend on the state of thisOutlet.protected voiddidInvalidate()protected voiddidInvalidateOutputKey(K key, KeyEffect effect)protected voiddidReconcile(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.abstract Oget()Returns the current state of thisOutlet.MapOutlet<K,V,? extends I>input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.voidinvalidate()voidinvalidateInput()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 voidonInvalidate()protected voidonInvalidateOutputKey(K key, KeyEffect effect)protected voidonReconcile(int version)protected voidonReconcileOutputKey(K key, KeyEffect effect, int version)Iterator<Inlet<? super O>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.voidreconcile(int version)voidreconcileInput(int version)Reconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion.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.voidunbindOutput(Inlet<? super O> output)Removes anoutputfrom the set ofInlets that depend on the state of thisOutlet.voidunbindOutputs()Disconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.protected voidwillInvalidate()protected voidwillInvalidateOutputKey(K key, KeyEffect effect)protected voidwillReconcile(int version)protected voidwillReconcileOutputKey(K key, KeyEffect effect, int version)
-
-
-
Method Detail
-
get
public abstract O get()
Description copied from interface:OutletReturns the current state of thisOutlet.
-
input
public MapOutlet<K,V,? extends I> input()
Description copied from interface:InletReturns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.
-
bindInput
public void bindInput(Outlet<? extends I> 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>- Specified by:
disconnectInputsin interfaceOutlet<K>
-
outputIterator
public Iterator<Inlet<? super O>> outputIterator()
Description copied from interface:OutletReturns anIteratorover the set ofInlets that depend on the state of thisOutlet.- Specified by:
outputIteratorin interfaceOutlet<K>
-
bindOutput
public void bindOutput(Inlet<? super O> output)
Description copied from interface:OutletAdds anoutputto the set ofInlets that depend on the state of thisOutlet. Theoutputwill be invalidated when the state of thisOutletis invalidated, and updated when thisOutletis updated.- Specified by:
bindOutputin interfaceOutlet<K>
-
unbindOutput
public void unbindOutput(Inlet<? super O> output)
Description copied from interface:OutletRemoves anoutputfrom the set ofInlets that depend on the state of thisOutlet.- Specified by:
unbindOutputin interfaceOutlet<K>
-
unbindOutputs
public void unbindOutputs()
Description copied from interface:OutletDisconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.- Specified by:
unbindOutputsin interfaceOutlet<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>- Specified by:
disconnectOutputsin interfaceOutlet<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,I>
-
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>
-
invalidateInput
public void invalidateInput()
Description copied from interface:Outlet- Specified by:
invalidateInputin interfaceOutlet<K>
-
invalidate
public void invalidate()
-
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,I>
-
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>
-
reconcileInput
public void reconcileInput(int version)
Description copied from interface:OutletReconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion. To reconcile its state, theOutletfirst invokesStreamlet.reconcile(int)on theStreamletto which it's attached. It then invokesInlet.reconcileOutput(int)on each of its dependentoutputs.- Specified by:
reconcileInputin interfaceOutlet<K>
-
reconcile
public void reconcile(int version)
-
willInvalidate
protected void willInvalidate()
-
onInvalidate
protected void onInvalidate()
-
didInvalidate
protected void didInvalidate()
-
willReconcile
protected void willReconcile(int version)
-
onReconcile
protected void onReconcile(int version)
-
didReconcile
protected void didReconcile(int version)
-
-