Package org.apache.giraph.graph.partition

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


            context.progress();

            partitionStatsList.clear();
            for (Partition<I, V, E, M> partition :
                    serviceWorker.getPartitionMap().values()) {
                PartitionStats partitionStats =
                    new PartitionStats(partition.getPartitionId(), 0, 0, 0);
                for (BasicVertex<I, V, E, M> basicVertex :
                        partition.getVertices()) {
                    // Make sure every vertex has the current
                    // graphState before computing
                    basicVertex.setGraphState(graphState);
                    if (basicVertex.isHalted()
                            && !Iterables.isEmpty(basicVertex.getMessages())) {
                        basicVertex.halt = false;
                    }
                    if (!basicVertex.isHalted()) {
                        Iterator<M> vertexMsgIt =
                            basicVertex.getMessages().iterator();
                        context.progress();
                        basicVertex.compute(vertexMsgIt);
                        basicVertex.releaseResources();
                    }
                    if (basicVertex.isHalted()) {
                        partitionStats.incrFinishedVertexCount();
                    }
                    partitionStats.incrVertexCount();
                    partitionStats.addEdgeCount(basicVertex.getNumOutEdges());
                }
                partitionStatsList.add(partitionStats);
            }
        } while (!serviceWorker.finishSuperstep(partitionStatsList));
        if (LOG.isInfoEnabled()) {
View Full Code Here


        // Generate the partition stats for the input superstep and process
        // if necessary
        List<PartitionStats> partitionStatsList =
            new ArrayList<PartitionStats>();
        for (Partition<I, V, E, M> partition : getPartitionMap().values()) {
            PartitionStats partitionStats =
                new PartitionStats(partition.getPartitionId(),
                                   partition.getVertices().size(),
                                   0,
                                   partition.getEdgeCount());
            partitionStatsList.add(partitionStats);
        }
View Full Code Here

TOP

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

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.