/** * Creates a vertex from a {@code ProcessorSupplier} and adds it to this DAG. * * @see Vertex#Vertex(String, ProcessorSupplier) * * @param name the unique name of the vertex * @param processorSupplier the supplier of {@code Processor} instances which will be used on all members */ @Nonnull public Vertex newVertex(@Nonnull String name, @Nonnull ProcessorSupplier processorSupplier) { return addVertex(new Vertex(name, processorSupplier)); }
/** * Creates a vertex from a {@code ProcessorMetaSupplier} and adds it to this DAG. * * @see Vertex#Vertex(String, ProcessorMetaSupplier) * * @param name the unique name of the vertex * @param metaSupplier the meta-supplier of {@code ProcessorSupplier}s for each member * */ @Nonnull public Vertex newVertex(@Nonnull String name, @Nonnull ProcessorMetaSupplier metaSupplier) { return addVertex(new Vertex(name, metaSupplier)); }
/** * Creates a vertex from a {@code Supplier<Processor>} and adds it to this DAG. * * @see Vertex#Vertex(String, DistributedSupplier) * * @param name the unique name of the vertex * @param simpleSupplier the simple, parameterless supplier of {@code Processor} instances */ @Nonnull public Vertex newVertex( @Nonnull String name, @Nonnull DistributedSupplier<? extends Processor> simpleSupplier ) { return addVertex(new Vertex(name, simpleSupplier)); }
@Override public IdentifiedDataSerializable create(int typeId) { switch (typeId) { case DAG: return new DAG(); case EDGE: return new Edge(); case VERTEX: return new Vertex(); case APPLY_FN_ENTRY_PROCESSOR: return new ApplyFnEntryProcessor(); default: throw new IllegalArgumentException("Unknown type id " + typeId); } } }