- 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
All Methods Instance Methods Concrete Methods 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.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 voiddidDecohereOutput()protected voiddidDecohereOutputKey(K key, KeyEffect effect)protected voiddidRecohereOutput(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.MapOutlet<K,V,? extends O>input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.protected voidonDecohereOutput()protected voidonDecohereOutputKey(K key, KeyEffect effect)protected voidonRecohereOutput(int version)protected voidonRecohereOutputKey(K key, KeyEffect effect, int version)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.protected voidwillDecohereOutput()protected voidwillDecohereOutputKey(K key, KeyEffect effect)protected voidwillRecohereOutput(int version)protected voidwillRecohereOutputKey(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>
-
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,O>
-
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>
-
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,O>
-
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>
-
willDecohereOutput
protected void willDecohereOutput()
-
onDecohereOutput
protected void onDecohereOutput()
-
didDecohereOutput
protected void didDecohereOutput()
-
willRecohereOutput
protected void willRecohereOutput(int version)
-
onRecohereOutput
protected void onRecohereOutput(int version)
-
didRecohereOutput
protected void didRecohereOutput(int version)
-
-