- 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
All Methods Instance Methods Abstract Methods Concrete Methods 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.voiddecohere()voiddecohereInput()Marks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.voiddecohereOutput()Marks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state.voiddecohereOutputKey(K key, KeyEffect effect)Marks thisMapInletas needing aneffectapplied to a givenkey.protected voiddidDecohere()protected voiddidDecohereOutputKey(K key, KeyEffect effect)protected voiddidRecohere(int version)protected voiddidRecohereOutputKey(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.protected voidonDecohere()protected voidonDecohereOutputKey(K key, KeyEffect effect)protected voidonRecohere(int version)protected voidonRecohereOutputKey(K key, KeyEffect effect, int version)Iterator<Inlet<? super O>>outputIterator()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.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 voidwillDecohere()protected voidwillDecohereOutputKey(K key, KeyEffect effect)protected voidwillRecohere(int version)protected voidwillRecohereOutputKey(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 decohered when the state of thisOutletis decohered, and recohered when thisOutletis recohered.- 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>
-
decohereOutputKey
public void decohereOutputKey(K key, KeyEffect effect)
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
public void recohereOutputKey(K key, int version)
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)
-
willDecohere
protected void willDecohere()
-
onDecohere
protected void onDecohere()
-
didDecohere
protected void didDecohere()
-
willRecohere
protected void willRecohere(int version)
-
onRecohere
protected void onRecohere(int version)
-
didRecohere
protected void didRecohere(int version)
-
-