Package org.apache.giraph.partition

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


    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

    return workerGraphPartitioner.getPartitionOwners();
  }

  @Override
  public Integer getPartitionId(I vertexId) {
    PartitionOwner partitionOwner = getVertexPartitionOwner(vertexId);
    return 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

    });
  }

  @Override
  public boolean sendMessageRequest(I destVertexId, M message) {
    PartitionOwner owner =
        serviceWorker.getVertexPartitionOwner(destVertexId);
    WorkerInfo workerInfo = owner.getWorkerInfo();
    final int partitionId = owner.getPartitionId();
    if (LOG.isTraceEnabled()) {
      LOG.trace("sendMessageRequest: Send bytes (" + message.toString() +
          ") to " + destVertexId + " on worker " + workerInfo);
    }
    ++totalMsgsSentInSuperstep;
View Full Code Here

  }

  @Override
  public void addEdgeRequest(I vertexIndex, Edge<I, E> edge) throws
      IOException {
    PartitionOwner partitionOwner =
        serviceWorker.getVertexPartitionOwner(vertexIndex);
    int partitionId = partitionOwner.getPartitionId();
    if (LOG.isTraceEnabled()) {
      LOG.trace("addEdgeRequest: Sending edge " + edge + " for index " +
          vertexIndex + " with partition " + partitionId);
    }
View Full Code Here

  }

  @Override
  public boolean sendEdgeRequest(I sourceVertexId, Edge<I, E> edge)
    throws IOException {
    PartitionOwner owner =
        serviceWorker.getVertexPartitionOwner(sourceVertexId);
    WorkerInfo workerInfo = owner.getWorkerInfo();
    final int partitionId = owner.getPartitionId();
    if (LOG.isTraceEnabled()) {
      LOG.trace("sendEdgeRequest: Send bytes (" + edge.toString() +
          ") to " + sourceVertexId + " on worker " + workerInfo);
    }
View Full Code Here

  }

  @Override
  public void removeEdgesRequest(I vertexIndex,
                                 I destinationVertexIndex) throws IOException {
    PartitionOwner partitionOwner =
        serviceWorker.getVertexPartitionOwner(vertexIndex);
    int partitionId = partitionOwner.getPartitionId();
    if (LOG.isTraceEnabled()) {
      LOG.trace("removeEdgesRequest: Removing edge " +
          destinationVertexIndex +
          " for index " + vertexIndex + " with partition " + partitionId);
    }
View Full Code Here

        partitionId, partitionOwner, partitionMutationCount);
  }

  @Override
  public void addVertexRequest(Vertex<I, V, E, M> vertex) throws IOException {
    PartitionOwner partitionOwner =
        serviceWorker.getVertexPartitionOwner(vertex.getId());
    int partitionId = partitionOwner.getPartitionId();
    if (LOG.isTraceEnabled()) {
      LOG.trace("addVertexRequest: Sending vertex " + vertex +
          " to partition " + partitionId);
    }
View Full Code Here

        partitionId, partitionOwner, partitionMutationCount);
  }

  @Override
  public void removeVertexRequest(I vertexIndex) throws IOException {
    PartitionOwner partitionOwner =
        serviceWorker.getVertexPartitionOwner(vertexIndex);
    int partitionId = partitionOwner.getPartitionId();
    if (LOG.isTraceEnabled()) {
      LOG.trace("removeVertexRequest: Removing vertex index " +
          vertexIndex + " from partition " + partitionId);
    }
View Full Code Here

TOP

Related Classes of org.apache.giraph.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.