Package org.apache.giraph.graph.partition

Examples of org.apache.giraph.graph.partition.PartitionOwner


     *
     * @param destVertex vertex to be sent
     * @return address of the vertex range server containing this vertex
     */
    private InetSocketAddress getInetSocketAddress(I destVertex) {
        PartitionOwner partitionOwner =
            service.getVertexPartitionOwner(destVertex);
        return getInetSocketAddress(partitionOwner.getWorkerInfo(),
                                    partitionOwner.getPartitionId());
    }
View Full Code Here


            for (PartitionOwner partitionOwner :
                    getCurrentPartitionOwners()) {
                WorkerInfo prevWorkerinfo =
                    partitionOwner.getWorkerInfo().equals(chosenWorkerInfo) ?
                        null : partitionOwner.getWorkerInfo();
                PartitionOwner tmpPartitionOwner =
                    new BasicPartitionOwner(partitionOwner.getPartitionId(),
                                            chosenWorkerInfo,
                                            prevWorkerinfo,
                                            null);
                partitionOwnerList.add(tmpPartitionOwner);
View Full Code Here

            DataInputStream metadataStream = fs.open(metadataPath);
            long partitions = metadataStream.readInt();
            for (long i = 0; i < partitions; ++i) {
                long dataPos = metadataStream.readLong();
                int partitionId = metadataStream.readInt();
                PartitionOwner partitionOwner = idOwnerMap.get(partitionId);
                if (LOG.isInfoEnabled()) {
                    LOG.info("prepareSuperstepRestart: File " + metadataPath +
                              " with position " + dataPos +
                              ", partition id = " + partitionId +
                              " assigned to " + partitionOwner);
                }
                partitionOwner.setCheckpointFilesPrefix(checkpointFilePrefix);
            }
            metadataStream.close();
        }
    }
View Full Code Here

            }
            if (readerVertex.getVertexValue() == null) {
                readerVertex.setVertexValue(
                    BspUtils.<V>createVertexValue(getConfiguration()));
            }
            PartitionOwner partitionOwner =
                workerGraphPartitioner.getPartitionOwner(
                    readerVertex.getVertexId());
            Partition<I, V, E, M> partition =
                inputSplitCache.get(partitionOwner);
            if (partition == null) {
                partition = new Partition<I, V, E, M>(
                    getConfiguration(),
                    partitionOwner.getPartitionId());
                inputSplitCache.put(partitionOwner, partition);
            }
            BasicVertex<I, V, E, M> oldVertex =
                partition.putVertex(readerVertex);
            if (oldVertex != null) {
                LOG.warn("readVertices: Replacing vertex " + oldVertex +
                        " with " + readerVertex);
            }
            if (partition.getVertices().size() >= maxVerticesPerPartition) {
                commService.sendPartitionReq(partitionOwner.getWorkerInfo(),
                                             partition);
                partition.getVertices().clear();
            }
            ++vertexCount;
            edgeCount += readerVertex.getNumOutEdges();
View Full Code Here

    public PartitionOwner getVertexPartitionOwner(I vertexIndex) {
        return workerGraphPartitioner.getPartitionOwner(vertexIndex);
    }

    public Partition<I, V, E, M> getPartition(I vertexIndex) {
        PartitionOwner partitionOwner = getVertexPartitionOwner(vertexIndex);
        return workerPartitionMap.get(partitionOwner.getPartitionId());
    }
View Full Code Here

        return workerPartitionMap.get(partitionOwner.getPartitionId());
    }

    @Override
    public BasicVertex<I, V, E, M> getVertex(I vertexIndex) {
        PartitionOwner partitionOwner = getVertexPartitionOwner(vertexIndex);
        if (workerPartitionMap.containsKey(partitionOwner.getPartitionId())) {
            return workerPartitionMap.get(
                partitionOwner.getPartitionId()).getVertex(vertexIndex);
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.giraph.graph.partition.PartitionOwner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.