public class Pieces extends Object
Modifier and Type | Method and Description |
---|---|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> |
forAllVertices(String pieceName,
Consumer<Vertex<I,V,E>> process)
For each vertex execute given process function.
|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> |
forAllVerticesOnReceive(String pieceName,
Consumer<Vertex<I,V,E>> process)
For each vertex execute given process function.
|
static Piece<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,NoMessage,Object> |
masterCompute(String pieceName,
Consumer<BlockMasterApi> process)
Execute given function on master.
|
static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> |
reduce(String name,
ReduceOperation<S,R> reduceOp,
SupplierFromVertex<I,V,E,S> valueSupplier,
Consumer<R> reducedValueConsumer)
Creates single reducer piece - given reduce class, supplier of values on
worker, reduces and passes the result to given consumer on master.
|
static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> |
reduceAndBroadcast(String name,
ReduceOperation<S,R> reduceOp,
SupplierFromVertex<I,V,E,S> valueSupplier,
ConsumerWithVertex<I,V,E,R> reducedValueConsumer)
Creates single reducer and broadcast piece - given reduce class, supplier
of values on worker, reduces and broadcasts the value, passing it to the
consumer on worker for each vertex.
|
static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> |
reduceAndBroadcastWithArrayOfHandles(String name,
int numHandles,
Supplier<ReduceOperation<S,R>> reduceOp,
SupplierFromVertex<I,V,E,Long> handleHashSupplier,
SupplierFromVertex<I,V,E,S> valueSupplier,
ConsumerWithVertex<I,V,E,R> reducedValueConsumer)
Like reduceAndBroadcast, but uses array of handles for reducers and
broadcasts, to make it feasible and performant when values are large.
|
static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> |
reduceWithMaster(String name,
ReduceOperation<S,R> reduceOp,
SupplierFromVertex<I,V,E,S> valueSupplier,
PairConsumer<R,BlockMasterApi> reducedValueConsumer)
Creates single reducer piece - given reduce class, supplier of values on
worker, reduces and passes the result to given consumer on master.
|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> |
removeVertices(String pieceName,
SupplierFromVertex<I,V,E,Boolean> shouldRemoveVertex)
Creates Piece which removes vertices for which supplier returns true.
|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> |
sendMessage(String name,
Class<M> messageClass,
SupplierFromVertex<I,V,E,M> messageSupplier,
SupplierFromVertex<I,V,E,Iterator<I>> targetsSupplier,
ConsumerWithVertex<I,V,E,Iterable<M>> messagesConsumer)
Creates Piece that for each vertex, sends message provided by
messageSupplier to all targets provided by targetsSupplier.
|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> |
sendMessage(String name,
MessageCombiner<? super I,M> messageCombiner,
SupplierFromVertex<I,V,E,M> messageSupplier,
SupplierFromVertex<I,V,E,Iterator<I>> targetsSupplier,
ConsumerWithVertex<I,V,E,M> messagesConsumer)
Creates Piece that for each vertex, sends message provided by
messageSupplier to all targets provided by targetsSupplier,
and uses given messageCombiner to combine messages together.
|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> |
sendMessageToNeighbors(String name,
Class<M> messageClass,
SupplierFromVertex<I,V,E,M> messageSupplier,
ConsumerWithVertex<I,V,E,Iterable<M>> messagesConsumer)
Creates Piece that for each vertex, sends message provided by
messageSupplier to all neighbors of current vertex.
|
static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> |
sendMessageToNeighbors(String name,
MessageCombiner<? super I,M> messageCombiner,
SupplierFromVertex<I,V,E,M> messageSupplier,
ConsumerWithVertex<I,V,E,M> messagesConsumer)
Creates Piece that for each vertex, sends message provided by
messageSupplier to all neighbors of current vertex,
and uses given messageCombiner to combine messages together.
|
public static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> Piece<I,V,E,NoMessage,Object> forAllVertices(String pieceName, Consumer<Vertex<I,V,E>> process)
public static Piece<org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,NoMessage,Object> masterCompute(String pieceName, Consumer<BlockMasterApi> process)
public static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> Piece<I,V,E,NoMessage,Object> forAllVerticesOnReceive(String pieceName, Consumer<Vertex<I,V,E>> process)
public static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> Piece<I,V,E,NoMessage,Object> removeVertices(String pieceName, SupplierFromVertex<I,V,E,Boolean> shouldRemoveVertex)
public static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> Piece<I,V,E,NoMessage,Object> reduce(String name, ReduceOperation<S,R> reduceOp, SupplierFromVertex<I,V,E,S> valueSupplier, Consumer<R> reducedValueConsumer)
S
- Single value type, objects passed on workersR
- Reduced value typeI
- Vertex id typeV
- Vertex value typeE
- Edge value typepublic static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> Piece<I,V,E,NoMessage,Object> reduceWithMaster(String name, ReduceOperation<S,R> reduceOp, SupplierFromVertex<I,V,E,S> valueSupplier, PairConsumer<R,BlockMasterApi> reducedValueConsumer)
S
- Single value type, objects passed on workersR
- Reduced value typeI
- Vertex id typeV
- Vertex value typeE
- Edge value typepublic static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> Piece<I,V,E,NoMessage,Object> reduceAndBroadcast(String name, ReduceOperation<S,R> reduceOp, SupplierFromVertex<I,V,E,S> valueSupplier, ConsumerWithVertex<I,V,E,R> reducedValueConsumer)
S
- Single value type, objects passed on workersR
- Reduced value typeI
- Vertex id typeV
- Vertex value typeE
- Edge value typepublic static <S,R extends org.apache.hadoop.io.Writable,I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> Piece<I,V,E,NoMessage,Object> reduceAndBroadcastWithArrayOfHandles(String name, int numHandles, Supplier<ReduceOperation<S,R>> reduceOp, SupplierFromVertex<I,V,E,Long> handleHashSupplier, SupplierFromVertex<I,V,E,S> valueSupplier, ConsumerWithVertex<I,V,E,R> reducedValueConsumer)
S
- Single value type, objects passed on workersR
- Reduced value typeI
- Vertex id typeV
- Vertex value typeE
- Edge value typepublic static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> SendMessagePiece<I,V,E,M> sendMessage(String name, Class<M> messageClass, SupplierFromVertex<I,V,E,M> messageSupplier, SupplierFromVertex<I,V,E,Iterator<I>> targetsSupplier, ConsumerWithVertex<I,V,E,Iterable<M>> messagesConsumer)
public static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> SendMessagePiece<I,V,E,M> sendMessageToNeighbors(String name, Class<M> messageClass, SupplierFromVertex<I,V,E,M> messageSupplier, ConsumerWithVertex<I,V,E,Iterable<M>> messagesConsumer)
public static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> SendMessageWithCombinerPiece<I,V,E,M> sendMessage(String name, MessageCombiner<? super I,M> messageCombiner, SupplierFromVertex<I,V,E,M> messageSupplier, SupplierFromVertex<I,V,E,Iterator<I>> targetsSupplier, ConsumerWithVertex<I,V,E,M> messagesConsumer)
public static <I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> SendMessageWithCombinerPiece<I,V,E,M> sendMessageToNeighbors(String name, MessageCombiner<? super I,M> messageCombiner, SupplierFromVertex<I,V,E,M> messageSupplier, ConsumerWithVertex<I,V,E,M> messagesConsumer)
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.