* - a Vertex to be sent
*/
public void sendVertex(Vertex<?,?,?> v) {
synchronized (pvo) {
int vertexHash = Math.abs(v.getVertexID().hashCode()) % numberOfPartitions;
Vertices currentPartition = pvo.partitionVertexList.get(vertexHash);
Integer vertexCounter;
synchronized (pvo.partitionVertexCounter) {
synchronized (currentPartition) {
vertexCounter = pvo.partitionVertexCounter.get(vertexHash);
vertexCounter++;
pvo.partitionVertexCounter.set(vertexHash, vertexCounter);
currentPartition.add(v);
// once the expected number of vertices is met, begins the send operation
if (vertexCounter >= maxVertices) {
Vertices verticesToBeSent = currentPartition;
Vertices vs = new Vertices(vertexClass);
// logger stuff
ovqLogger.info(this.toString() + " Partition: " + Integer.toString(partitionId)
+ " Sending bulk vertices. Count: " + vertexCounter + ", "
+ verticesToBeSent.size());