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)
WorkerClientRequestProcessor
sendMessageRequest
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)
WorkerClientRequestProcessor
sendMessageToAllRequest
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)
WorkerClientRequestProcessor
sendMessageToAllRequest
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)
WorkerClientRequestProcessor
sendPartitionRequest
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)
WorkerClientRequestProcessor
sendVertexRequest
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
WorkerClientRequestProcessor
addEdgeRequest
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 addedIOException
public boolean sendEdgeRequest(I sourceVertexId, Edge<I,E> edge) throws IOException
WorkerClientRequestProcessor
sendEdgeRequest
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.IOException
public void removeEdgesRequest(I vertexIndex, I destinationVertexIndex) throws IOException
WorkerClientRequestProcessor
removeEdgesRequest
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 removedIOException
public void addVertexRequest(Vertex<I,V,E> vertex) throws IOException
WorkerClientRequestProcessor
addVertexRequest
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 addedIOException
public void removeVertexRequest(I vertexIndex) throws IOException
WorkerClientRequestProcessor
removeVertexRequest
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 removedIOException
public void flush() throws IOException
WorkerClientRequestProcessor
flush
in interface WorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
IOException
public long resetMessageCount()
WorkerClientRequestProcessor
resetMessageCount
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()
WorkerClientRequestProcessor
resetMessageBytesCount
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.