I - Vertex idV - Vertex dataE - Edge datapublic class NettyWorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends Object implements WorkerClientRequestProcessor<I,V,E>
| Constructor and Description |
|---|
NettyWorkerClientRequestProcessor(org.apache.hadoop.mapreduce.Mapper.Context context,
ImmutableClassesGiraphConfiguration<I,V,E> conf,
CentralizedServiceWorker<I,V,E> serviceWorker,
boolean useOneMessageToManyIdsEncoding)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEdgeRequest(I vertexIndex,
Edge<I,E> edge)
Sends a request to the appropriate vertex range owner to add an edge
|
void |
addVertexRequest(Vertex<I,V,E> vertex)
Sends a request to the appropriate vertex range owner to add a vertex
|
void |
doRequest(WorkerInfo workerInfo,
WritableRequest writableRequest)
When doing the request, short circuit if it is local
|
void |
flush()
Flush all outgoing messages.
|
void |
removeEdgesRequest(I vertexIndex,
I destinationVertexIndex)
Sends a request to the appropriate vertex range owner to remove all edges
pointing to a given vertex.
|
void |
removeVertexRequest(I vertexIndex)
Sends a request to the appropriate vertex range owner to remove a vertex
|
long |
resetMessageBytesCount()
Get the message bytes sent during this superstep and clear them.
|
long |
resetMessageCount()
Get the messages sent during this superstep and clear them.
|
boolean |
sendEdgeRequest(I sourceVertexId,
Edge<I,E> edge)
Sends a request to the source vertex owner to add an edge.
|
void |
sendMessageRequest(I destVertexId,
org.apache.hadoop.io.Writable message)
Sends a message to destination vertex.
|
void |
sendMessageToAllRequest(Iterator<I> vertexIdIterator,
org.apache.hadoop.io.Writable message)
Sends a message to the targets in the iterator.
|
void |
sendMessageToAllRequest(Vertex<I,V,E> vertex,
org.apache.hadoop.io.Writable message)
Sends a message through all edges to all destinations.
|
void |
sendPartitionRequest(WorkerInfo workerInfo,
Partition<I,V,E> partition)
Send a partition request (no batching).
|
boolean |
sendVertexRequest(PartitionOwner partitionOwner,
Vertex<I,V,E> vertex)
Sends a vertex to the appropriate partition owner
|
public NettyWorkerClientRequestProcessor(org.apache.hadoop.mapreduce.Mapper.Context context,
ImmutableClassesGiraphConfiguration<I,V,E> conf,
CentralizedServiceWorker<I,V,E> serviceWorker,
boolean useOneMessageToManyIdsEncoding)
context - Contextconf - ConfigurationserviceWorker - Service workeruseOneMessageToManyIdsEncoding - should use one message to manypublic void sendMessageRequest(I destVertexId, org.apache.hadoop.io.Writable message)
WorkerClientRequestProcessorsendMessageRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>destVertexId - Destination vertex id.message - Message to send.public void sendMessageToAllRequest(Vertex<I,V,E> vertex, org.apache.hadoop.io.Writable message)
WorkerClientRequestProcessorsendMessageToAllRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>vertex - The source vertex.message - Message to send.public void sendMessageToAllRequest(Iterator<I> vertexIdIterator, org.apache.hadoop.io.Writable message)
WorkerClientRequestProcessorsendMessageToAllRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>vertexIdIterator - The iterator of target vertex ids.message - Message to send.public void sendPartitionRequest(WorkerInfo workerInfo, Partition<I,V,E> partition)
WorkerClientRequestProcessorsendPartitionRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>workerInfo - Worker to send the partition topartition - Partition to sendpublic boolean sendVertexRequest(PartitionOwner partitionOwner, Vertex<I,V,E> vertex)
WorkerClientRequestProcessorsendVertexRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>partitionOwner - Owner of the vertexvertex - Vertex to sendpublic void addEdgeRequest(I vertexIndex, Edge<I,E> edge) throws IOException
WorkerClientRequestProcessoraddEdgeRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>vertexIndex - Index of the vertex to get the requestedge - Edge to be addedIOExceptionpublic boolean sendEdgeRequest(I sourceVertexId, Edge<I,E> edge) throws IOException
WorkerClientRequestProcessorsendEdgeRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>sourceVertexId - Source vertex id.edge - Edge to be added.IOExceptionpublic void removeEdgesRequest(I vertexIndex, I destinationVertexIndex) throws IOException
WorkerClientRequestProcessorremoveEdgesRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>vertexIndex - Index of the vertex to get the requestdestinationVertexIndex - Index of the edge to be removedIOExceptionpublic void addVertexRequest(Vertex<I,V,E> vertex) throws IOException
WorkerClientRequestProcessoraddVertexRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>vertex - Vertex to be addedIOExceptionpublic void removeVertexRequest(I vertexIndex) throws IOException
WorkerClientRequestProcessorremoveVertexRequest in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>vertexIndex - Index of the vertex to be removedIOExceptionpublic void flush()
throws IOException
WorkerClientRequestProcessorflush in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>IOExceptionpublic long resetMessageCount()
WorkerClientRequestProcessorresetMessageCount in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>public long resetMessageBytesCount()
WorkerClientRequestProcessorresetMessageBytesCount in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>public void doRequest(WorkerInfo workerInfo, WritableRequest writableRequest)
workerInfo - Worker infowritableRequest - Request to either submit or run locallyCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.