public interface GraphTransformationEngine extends AutoCloseable
GraphComputation
. This engine is able to asynchronously run graph based computation, reusing
results when possible. Note that the computation graph must be an acyclic graph.
This engine is able to deal with dependencies in the computation graph by having GraphComputation
request dependent results of other transformations through GraphComputation.discoverPreliminaryDeps(ComputeKey)
and GraphComputation.discoverDeps(ComputeKey, ComputationEnvironment)
Modifier and Type | Method and Description |
---|---|
void |
close()
Shuts down the engine and rejects any future computations
|
<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> |
compute(KeyType key)
Asynchronously computes the result for the given key
|
<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> |
computeAll(Set<KeyType> keys)
Asynchronously computes the result for multiple keys
|
<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> |
computeAllUnchecked(Set<KeyType> keys)
Synchronously computes the result for multiple keys
|
<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> |
computeUnchecked(KeyType key)
Synchronously computes the given key
|
void close()
close
in interface AutoCloseable
<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> Future<ResultType> compute(KeyType key)
key
- the specific Key on the graph to compute<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> ResultType computeUnchecked(KeyType key)
key
- the specific Key on the graph to compute<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> com.google.common.collect.ImmutableMap<KeyType,Future<ResultType>> computeAll(Set<KeyType> keys)
keys
- iterable of keys to compute on the graph<KeyType extends ComputeKey<ResultType>,ResultType extends ComputeResult> com.google.common.collect.ImmutableMap<KeyType,ResultType> computeAllUnchecked(Set<KeyType> keys)
keys
- iterable of the keys to compute on the graph