public class DAG extends Object implements com.hazelcast.nio.serialization.IdentifiedDataSerializable, Iterable<Vertex>
vertex represents a unit of data processing and an
edge represents the path along which the data travels to
the next vertex.
The work of a single vertex is parallelized and distributed, so that there are
several instances of the Processor type on each member
corresponding to it. Whenever possible, each instance should be
tasked with only a slice of the total data and a partitioning strategy
can be employed to ensure that the data sent to each vertex is collated
by a partitioning key.
There are three basic kinds of vertices:
| Constructor and Description |
|---|
DAG() |
| Modifier and Type | Method and Description |
|---|---|
DAG |
edge(Edge edge)
Adds an edge to this DAG.
|
int |
getFactoryId() |
int |
getId() |
List<Edge> |
getInboundEdges(String vertexName)
Returns the inbound edges connected to the vertex with the given name.
|
List<Edge> |
getOutboundEdges(String vertexName)
Returns the outbound edges connected to the vertex with the given name.
|
Vertex |
getVertex(String vertexName)
Returns the vertex with the given name.
|
Iterator<Vertex> |
iterator()
Returns an iterator over the DAG's vertices in topological order.
|
Vertex |
newVertex(String name,
DistributedSupplier<? extends Processor> simpleSupplier)
Creates a vertex from a
Supplier<Processor> and adds it to this DAG. |
Vertex |
newVertex(String name,
ProcessorMetaSupplier metaSupplier)
Creates a vertex from a
ProcessorMetaSupplier and adds it to this DAG. |
Vertex |
newVertex(String name,
ProcessorSupplier processorSupplier)
Creates a vertex from a
ProcessorSupplier and adds it to this DAG. |
void |
readData(com.hazelcast.nio.ObjectDataInput in) |
String |
toString() |
DAG |
vertex(Vertex vertex)
Adds a vertex to this DAG.
|
void |
writeData(com.hazelcast.nio.ObjectDataOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic Vertex newVertex(String name, DistributedSupplier<? extends Processor> simpleSupplier)
Supplier<Processor> and adds it to this DAG.name - the unique name of the vertexsimpleSupplier - the simple, parameterless supplier of Processor instancesVertex.Vertex(String, DistributedSupplier)public Vertex newVertex(String name, ProcessorSupplier processorSupplier)
ProcessorSupplier and adds it to this DAG.name - the unique name of the vertexprocessorSupplier - the supplier of Processor instances which will be used on all membersVertex.Vertex(String, ProcessorSupplier)public Vertex newVertex(String name, ProcessorMetaSupplier metaSupplier)
ProcessorMetaSupplier and adds it to this DAG.name - the unique name of the vertexmetaSupplier - the meta-supplier of ProcessorSuppliers for each memberVertex.Vertex(String, ProcessorMetaSupplier)public DAG edge(Edge edge)
public List<Edge> getInboundEdges(String vertexName)
public List<Edge> getOutboundEdges(String vertexName)
public Iterator<Vertex> iterator()
public void writeData(com.hazelcast.nio.ObjectDataOutput out)
throws IOException
writeData in interface com.hazelcast.nio.serialization.DataSerializableIOExceptionpublic void readData(com.hazelcast.nio.ObjectDataInput in)
throws IOException
readData in interface com.hazelcast.nio.serialization.DataSerializableIOExceptionpublic int getFactoryId()
getFactoryId in interface com.hazelcast.nio.serialization.IdentifiedDataSerializablepublic int getId()
getId in interface com.hazelcast.nio.serialization.IdentifiedDataSerializableCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.