BaseKey
- the key of the base computationResult1
- the result type of the base computationResult2
- the result type of this computationpublic class LeftComposingComputation<BaseKey extends ComputeKey<?>,Key1 extends ComputeKey<Result1>,Result1 extends ComputeResult,Result2 extends ComputeResult> extends Object implements ComposedComputation<BaseKey,Result2>
ComposedComputation
that takes a base ComposedComputation
, a
Composer
, and Transformer
and returns a new ComposedResult
of Result2
type. This is composing from the left to the right.Modifier and Type | Method and Description |
---|---|
GraphComputationStage<ComposedKey<BaseKey,Result2>,ComposedResult<ComputeKey<Result2>,Result2>> |
asStage() |
com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> |
discoverDeps(ComposedKey<BaseKey,Result2> key,
ComputationEnvironment env)
Compute dependent keys required to compute given key, and a set of dependencies as listed by
GraphComputation.discoverPreliminaryDeps(ComputeKey) . |
com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> |
discoverPreliminaryDeps(ComposedKey<BaseKey,Result2> key)
Compute dependent keys required to compute given the current key.
|
ComposedComputationIdentifier<Result2> |
getIdentifier() |
ComposedResult<ComputeKey<Result2>,Result2> |
transform(ComposedKey<BaseKey,Result2> key,
ComputationEnvironment env)
Perform a transformation identified by key
Key into a final type Result . |
public ComposedComputationIdentifier<Result2> getIdentifier()
getIdentifier
in interface ComposedComputation<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>
getIdentifier
in interface GraphComputation<ComposedKey<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>,ComposedResult<ComputeKey<Result2 extends ComputeResult>,Result2 extends ComputeResult>>
ComputeKey.getIdentifier()
public ComposedResult<ComputeKey<Result2>,Result2> transform(ComposedKey<BaseKey,Result2> key, ComputationEnvironment env) throws Exception
GraphComputation
Key
into a final type Result
. This
transformation should be performed synchronously.transform
in interface ComposedComputation<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>
transform
in interface GraphComputation<ComposedKey<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>,ComposedResult<ComputeKey<Result2 extends ComputeResult>,Result2 extends ComputeResult>>
key
- The Key of the requested resultenv
- The execution environment containing results of keys from GraphComputation.discoverDeps(ComputeKey, ComputationEnvironment)
and GraphComputation.discoverPreliminaryDeps(ComputeKey)
Exception
public com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> discoverDeps(ComposedKey<BaseKey,Result2> key, ComputationEnvironment env) throws Exception
GraphComputation
GraphComputation.discoverPreliminaryDeps(ComputeKey)
. The results of those computations will be
available in GraphComputation.transform(ComputeKey, ComputationEnvironment)
as a part of ComputationEnvironment
discoverDeps
in interface ComposedComputation<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>
discoverDeps
in interface GraphComputation<ComposedKey<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>,ComposedResult<ComputeKey<Result2 extends ComputeResult>,Result2 extends ComputeResult>>
key
- the current key to transformenv
- The execution environment containing results of keys from GraphComputation.discoverPreliminaryDeps(ComputeKey)
Exception
public com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> discoverPreliminaryDeps(ComposedKey<BaseKey,Result2> key)
GraphComputation
GraphComputation.discoverDeps(ComputeKey, ComputationEnvironment)
as
a part of ComputationEnvironment
, and GraphComputation.transform(ComputeKey,
ComputationEnvironment)
discoverPreliminaryDeps
in interface ComposedComputation<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>
discoverPreliminaryDeps
in interface GraphComputation<ComposedKey<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>,ComposedResult<ComputeKey<Result2 extends ComputeResult>,Result2 extends ComputeResult>>
key
- the current key to transformGraphComputation.discoverDeps(ComputeKey, ComputationEnvironment)
and
GraphComputation.transform(ComputeKey, ComputationEnvironment)
of the current key depends onpublic GraphComputationStage<ComposedKey<BaseKey,Result2>,ComposedResult<ComputeKey<Result2>,Result2>> asStage()
asStage
in interface ComposedComputation<BaseKey extends ComputeKey<?>,Result2 extends ComputeResult>
GraphComputationStage
for registering this computation with the
GraphTransformationEngine