public final class ComputeGraphBuilder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
ComputeConnection |
addCompute(java.lang.String name,
ICompute compute)
Add a compute node to the graph
|
ComputeConnection |
addCompute(java.lang.String name,
ICompute compute,
int parallel)
Add a compute node to the graph
|
java.util.Map<java.lang.String,java.lang.String> |
addGraphConstraints(java.util.Map<java.lang.String,java.lang.String> graphconstraints)
Adding Graph Constraints
|
java.util.Map<java.lang.String,java.lang.String> |
addGraphConstraints(java.lang.String constraintName,
java.lang.String constraintValue)
Adding Graph Constraints
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
addNodeConstraints(java.lang.String nodeName,
java.util.Map<java.lang.String,java.lang.String> nodeconstraints) |
SourceConnection |
addSource(java.lang.String name,
ISource source)
Add a source node to the graph
|
SourceConnection |
addSource(java.lang.String name,
ISource source,
int parallel)
Add a source node to the graph
|
ComputeGraph |
build() |
OperationMode |
getMode()
Get the operation mode
|
static ComputeGraphBuilder |
newBuilder(Config cfg)
Create an instance of the task builder.
|
void |
setMode(OperationMode mode)
Set the operation mode, we default to streaming mode
|
void |
setTaskGraphName(java.lang.String taskGraphName) |
public static ComputeGraphBuilder newBuilder(Config cfg)
cfg
- configurationpublic void setMode(OperationMode mode)
mode
- the operation mode (streaming, batch)public void setTaskGraphName(java.lang.String taskGraphName)
public ComputeConnection addCompute(java.lang.String name, ICompute compute)
name
- name of the nodecompute
- number of parallel instancespublic ComputeConnection addCompute(java.lang.String name, ICompute compute, int parallel)
name
- name of the nodecompute
- implementation of the nodeparallel
- number of parallel instancespublic SourceConnection addSource(java.lang.String name, ISource source)
name
- name of the nodesource
- implementation of the nodepublic SourceConnection addSource(java.lang.String name, ISource source, int parallel)
name
- name of the nodesource
- implementation of the nodeparallel
- parallelism of the nodepublic OperationMode getMode()
public java.util.Map<java.lang.String,java.lang.String> addGraphConstraints(java.lang.String constraintName, java.lang.String constraintValue)
public java.util.Map<java.lang.String,java.lang.String> addGraphConstraints(java.util.Map<java.lang.String,java.lang.String> graphconstraints)
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> addNodeConstraints(java.lang.String nodeName, java.util.Map<java.lang.String,java.lang.String> nodeconstraints)
public ComputeGraph build()