- 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 void
bindInput(MapOutlet<K,V,? extends O> input)
void
bindInput(Outlet<? extends O> input)
Connects thisInlet
to anOutlet
from which it will acquire its state.protected void
didInvalidateOutput()
protected void
didInvalidateOutputKey(K key, KeyEffect effect)
protected void
didReconcileOutput(int version)
protected void
didReconcileOutputKey(K key, KeyEffect effect, int version)
void
disconnectInputs()
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph.void
disconnectOutputs()
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph.MapOutlet<K,V,? extends O>
input()
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.void
invalidateOutput()
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having stale state.void
invalidateOutputKey(K key, KeyEffect effect)
Marks thisMapInlet
as needing aneffect
applied to a givenkey
.protected void
onInvalidateOutput()
protected void
onInvalidateOutputKey(K key, KeyEffect effect)
protected void
onReconcileOutput(int version)
protected void
onReconcileOutputKey(K key, KeyEffect effect, int version)
void
reconcileOutput(int version)
Reconciles the state of thisInlet
, if the version of thisInlet
's state differs from the targetversion
.void
reconcileOutputKey(K key, int version)
Reconciles the state of an individualkey
in thisMapInlet
, if the version of thisMapInlet
's state differs from the targetversion
.void
unbindInput()
Disconnects thisInlet
from its inputOutlet
, if connected.protected void
willInvalidateOutput()
protected void
willInvalidateOutputKey(K key, KeyEffect effect)
protected void
willReconcileOutput(int version)
protected void
willReconcileOutputKey(K key, KeyEffect effect, int version)
-
-
-
Method Detail
-
input
public MapOutlet<K,V,? extends O> input()
Description copied from interface:Inlet
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.
-
bindInput
public void bindInput(Outlet<? extends O> input)
Description copied from interface:Inlet
Connects thisInlet
to anOutlet
from which it will acquire its state. If thisInlet
is already connected, it will first disconnect from its existing input. Then, after updating itsinput
property, theInlet
will invokeOutlet.bindOutput(Inlet)
on its newinput
.
-
unbindInput
public void unbindInput()
Description copied from interface:Inlet
Disconnects thisInlet
from its inputOutlet
, if connected. After setting itsinput
property tonull
, theInlet
will invokeOutlet.unbindOutput(Inlet)
on its old input, if defined.- Specified by:
unbindInput
in interfaceInlet<K>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:Inlet
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisInlet
.- Specified by:
disconnectInputs
in interfaceInlet<K>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:Inlet
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph. Used to recursively clean up chains of combinators passing through thisInlet
.- Specified by:
disconnectOutputs
in interfaceInlet<K>
-
invalidateOutputKey
public void invalidateOutputKey(K key, KeyEffect effect)
Description copied from interface:MapInlet
Marks thisMapInlet
as needing aneffect
applied 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:
invalidateOutputKey
in interfaceMapInlet<K,V,O>
-
invalidateOutput
public void invalidateOutput()
Description copied from interface:Inlet
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having stale state. Invalidating anInlet
will recursively invalidate all streamlets that transitively depend on the state of thisInlet
. Invalidating anInlet
does not cause its state to be recomputed. A subsequentInlet.reconcileOutput(int)
call will reconcile the state of theInlet
.- Specified by:
invalidateOutput
in interfaceInlet<K>
-
reconcileOutputKey
public void reconcileOutputKey(K key, int version)
Description copied from interface:MapInlet
Reconciles the state of an individualkey
in thisMapInlet
, if the version of thisMapInlet
's state differs from the targetversion
. To reconcile the state of a key, theMapInlet
first 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, theMapInlet
invokesStreamlet.reconcile(int)
on its attached streamlet.- Specified by:
reconcileOutputKey
in interfaceMapInlet<K,V,O>
-
reconcileOutput
public void reconcileOutput(int version)
Description copied from interface:Inlet
Reconciles the state of thisInlet
, if the version of thisInlet
's state differs from the targetversion
. To reconcile its state, theInlet
first invokesOutlet.reconcileInput(int)
on itsinput
, to ensure that its input is up-to-date. It then invokesStreamlet.reconcile(int)
on theStreamlet
to which it's attached, causing theStreamlet
to reconcile its own state.- Specified by:
reconcileOutput
in 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)
-
-