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>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidConnects 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.voiddecohere()voidMarks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.voidMarks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state.voiddecohereOutputKey(K key, KeyEffect effect) Marks thisMapInletas needing aneffectapplied to a givenkey.protected voidprotected voiddidDecohereOutputKey(K key, KeyEffect effect) protected voiddidRecohere(int version) protected voiddidRecohereOutputKey(K key, KeyEffect effect, int version) voidDisconnects allInlets dominated by thisInletin the dataflow dependency graph.voidDisconnects allOutlets dominated by thisInletin the dataflow graph.abstract Oget()Returns the current state of thisOutlet.input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.protected voidprotected voidonDecohereOutputKey(K key, KeyEffect effect) protected voidonRecohere(int version) protected voidonRecohereOutputKey(K key, KeyEffect effect, int version) Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.voidrecohere(int version) voidrecohereInput(int version) Updates the state of thisOutletto make it consistent with the targetversion.voidrecohereOutput(int version) Updates the state of thisInletto make it consistent with thetargetversion.voidrecohereOutputKey(K key, int version) Updates the state of an individualkeyin thisMapInletto make it consistent with the targetversion.voidDisconnects thisInletfrom its inputOutlet, if connected.voidunbindOutput(Inlet<? super O> output) Removes anoutputfrom the set ofInlets that depend on the state of thisOutlet.voidDisconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.protected voidprotected voidwillDecohereOutputKey(K key, KeyEffect effect) protected voidwillRecohere(int version) protected voidwillRecohereOutputKey(K key, KeyEffect effect, int version)
-
Field Details
-
input
-
effects
-
outputs
-
version
protected int version
-
-
Constructor Details
-
AbstractMapInletOutlet
public AbstractMapInletOutlet()
-
-
Method Details
-
get
Description copied from interface:OutletReturns the current state of thisOutlet. -
input
Description copied from interface:InletReturns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected. -
bindInput
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. -
bindInput
-
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
Description copied from interface:OutletReturns anIteratorover the set ofInlets that depend on the state of thisOutlet.- Specified by:
outputIteratorin interfaceOutlet<K>
-
bindOutput
Description copied from interface:OutletAdds anoutputto the set ofInlets that depend on the state of thisOutlet. Theoutputwill be decohered when the state of thisOutletis decohered, and recohered when thisOutletis recohered.- Specified by:
bindOutputin interfaceOutlet<K>
-
unbindOutput
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>
-
decohereOutputKey
Description copied from interface:MapInletMarks thisMapInletas needing aneffectapplied to a givenkey. Decohering an individual key decoheres the entire state of theInlet. But only the decoherent keys need to be updated in order to recohere the overall state of theInlet.- Specified by:
decohereOutputKeyin interfaceMapInlet<K,V, I>
-
decohereOutput
public void decohereOutput()Description copied from interface:InletMarks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state. Decohering anInletwill recursively decohere all streamlets that transitively depend on the state of thisInlet. Decohering anInletdoes not cause its state to be recomputed. A subsequentInlet.recohereOutput(int)call will eventually make the state of theInletcoherent again.- Specified by:
decohereOutputin interfaceInlet<K>
-
decohereInput
public void decohereInput()Description copied from interface:OutletMarks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.- Specified by:
decohereInputin interfaceOutlet<K>
-
decohere
public void decohere() -
recohereOutputKey
Description copied from interface:MapInletUpdates the state of an individualkeyin thisMapInletto make it consistent with the targetversion. TheMapInletonly needs to update if the currentversiondiffers from the targetversion. To update the state of a key, theMapInletfirst invokesMapOutlet.recohereInputKey(Object, int)on itsinput, if its input is aMapOutlet, or it invokesOutlet.recohereInput(int), if its input is not aMapOutlet. Then, if all decoherent keys have been recohered, theMapInletinvokesStreamlet.recohere(int)on its attached streamlet.- Specified by:
recohereOutputKeyin interfaceMapInlet<K,V, I>
-
recohereOutput
public void recohereOutput(int version) Description copied from interface:InletUpdates the state of thisInletto make it consistent with thetargetversion. TheInletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theInletfirst invokesOutlet.recohereInput(int)on itsinput, to ensure that its input is coherent. It then invokesStreamlet.recohere(int)on theStreamletto which it's attached, causing theStreamletto make its own state coherent again.- Specified by:
recohereOutputin interfaceInlet<K>
-
recohereInput
public void recohereInput(int version) Description copied from interface:OutletUpdates the state of thisOutletto make it consistent with the targetversion. TheOutletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theOutletfirst invokesStreamlet.recohere(int)on theStreamletto which it's attached. It then invokesInlet.recohereOutput(int)on each of its dependentoutputs.- Specified by:
recohereInputin interfaceOutlet<K>
-
recohere
public void recohere(int version) -
willDecohereOutputKey
-
onDecohereOutputKey
-
didDecohereOutputKey
-
willDecohere
protected void willDecohere() -
onDecohere
protected void onDecohere() -
didDecohere
protected void didDecohere() -
willRecohereOutputKey
-
onRecohereOutputKey
-
didRecohereOutputKey
-
willRecohere
protected void willRecohere(int version) -
onRecohere
protected void onRecohere(int version) -
didRecohere
protected void didRecohere(int version)
-