Examples of PartitionOwner


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

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

            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

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

            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

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

            }
            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

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

    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

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

        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

Examples of org.apache.giraph.partition.PartitionOwner

      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

Examples of org.apache.giraph.partition.PartitionOwner

    int partitionOwnersSize = input.readInt();
    partitionOwners = Lists.newArrayListWithCapacity(partitionOwnersSize);
    for (int i = 0; i < partitionOwnersSize; i++) {
      try {
        PartitionOwner partitionOwner = partitionOwnerClass.newInstance();
        partitionOwner.readFieldsWithWorkerIds(input, workerInfoMap);
        partitionOwners.add(partitionOwner);
      } catch (InstantiationException e) {
        throw new IllegalStateException("readFields: " +
            "InstantiationException on partition owner class " +
            partitionOwnerClass, e);
View Full Code Here

Examples of org.apache.giraph.partition.PartitionOwner

    return workerGraphPartitioner.getPartitionOwners();
  }

  @Override
  public Integer getPartitionId(I vertexId) {
    PartitionOwner partitionOwner = getVertexPartitionOwner(vertexId);
    return partitionOwner.getPartitionId();
  }
View Full Code Here

Examples of org.apache.giraph.partition.PartitionOwner

      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
TOP
Copyright © 2018 www.massapi.com. 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.