Examples of WorkerInfo


Examples of org.apache.giraph.worker.WorkerInfo

  }

  @Override
  public void readFields(DataInput input) throws IOException {
    partitionId = input.readInt();
    workerInfo = new WorkerInfo();
    workerInfo.readFields(input);
    boolean hasPreviousWorkerInfo = input.readBoolean();
    if (hasPreviousWorkerInfo) {
      previousWorkerInfo = new WorkerInfo();
      previousWorkerInfo.readFields(input);
    }
    boolean hasCheckpointFilePrefix = input.readBoolean();
    if (hasCheckpointFilePrefix) {
      checkpointFilesPrefix = input.readUTF();
View Full Code Here

Examples of org.apache.giraph.worker.WorkerInfo

    usingRangePartitioner =
        SimpleLongRangePartitionerFactory.class.isAssignableFrom(
            conf.getGraphPartitionerClass());
    int numWorkers = conf.getMaxWorkers();
    List<WorkerInfo> workerInfos = Collections.nCopies(numWorkers,
        new WorkerInfo());
    numPartitions = PartitionUtils.computePartitionCount(workerInfos,
        numWorkers, conf);
    partitionSize = numVertices / numPartitions;
  }
View Full Code Here

Examples of org.apache.giraph.worker.WorkerInfo

        PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO,
        PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO_DEFAULT);
    this.numVertices = numVertices;
    int numWorkers = conf.getMaxWorkers();
    List<WorkerInfo> workerInfos = Collections.nCopies(numWorkers,
        new WorkerInfo());
    numPartitions = PartitionUtils.computePartitionCount(workerInfos,
        numWorkers, conf);
    partitionSize = numVertices / numPartitions;
  }
View Full Code Here

Examples of org.apache.giraph.worker.WorkerInfo

  }

  @Override
  public boolean sendAggregatedValue(String aggregatorName,
      Writable aggregatedValue) throws IOException {
    WorkerInfo owner =
        AggregatorUtils.getOwner(aggregatorName,
            serviceWorker.getWorkerInfoList());
    if (isThisWorker(owner)) {
      return false;
    } else {
      int currentSize = sendAggregatedValueCache.addAggregator(
          owner.getTaskId(), aggregatorName, aggregatedValue);
      if (currentSize >= maxBytesPerAggregatorRequest) {
        flushAggregatorsToWorker(owner);
      }
      return true;
    }
View Full Code Here

Examples of org.apache.giraph.worker.WorkerInfo

  @Override
  public void sendAggregator(String aggregatorName,
      Class<? extends Aggregator> aggregatorClass,
      Writable aggregatedValue) throws IOException {
    WorkerInfo owner =
        AggregatorUtils.getOwner(aggregatorName, service.getWorkerInfoList());
    int currentSize = sendAggregatorCache.addAggregator(owner.getTaskId(),
        aggregatorName, aggregatorClass, aggregatedValue);
    if (currentSize >= maxBytesPerAggregatorRequest) {
      flushAggregatorsToWorker(owner);
    }
  }
View Full Code Here

Examples of org.apache.giraph.worker.WorkerInfo

    masterInfo.readFields(input);

    int workerInfosSize = input.readInt();
    workerInfos = Lists.newArrayListWithCapacity(workerInfosSize);
    for (int i = 0; i < workerInfosSize; i++) {
      WorkerInfo workerInfo = new WorkerInfo();
      workerInfo.readFields(input);
      workerInfos.add(workerInfo);
    }

    Map<Integer, WorkerInfo> workerInfoMap = getAsWorkerInfoMap(workerInfos);
    int additionalWorkerInfos = input.readInt();
    for (int i = 0; i < additionalWorkerInfos; i++) {
      WorkerInfo workerInfo = new WorkerInfo();
      workerInfo.readFields(input);
      workerInfoMap.put(workerInfo.getTaskId(), workerInfo);
    }

    int partitionOwnersSize = input.readInt();
    partitionOwners = Lists.newArrayListWithCapacity(partitionOwnersSize);
    for (int i = 0; i < partitionOwnersSize; i++) {
View Full Code Here

Examples of org.apache.giraph.worker.WorkerInfo

      // superstep mod availableWorkerInfos
      // Guaranteed to be different if the workers (and their order)
      // do not change
      long workerIndex = superstep % availableWorkerInfos.size();
      int i = 0;
      WorkerInfo chosenWorkerInfo = null;
      for (WorkerInfo workerInfo : availableWorkerInfos) {
        if (workerIndex == i) {
          chosenWorkerInfo = workerInfo;
        }
        ++i;
      }
      if (LOG.isInfoEnabled()) {
        LOG.info("generateChangedPartitionOwners: Chosen worker " +
                 "for superstep " + superstep + " is " +
                 chosenWorkerInfo);
      }

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

Examples of org.apache.giraph.worker.WorkerInfo

  @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);
    }
View Full Code Here

Examples of org.apache.giraph.worker.WorkerInfo

  @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

Examples of org.apache.giraph.worker.WorkerInfo

        availableWorkerInfos, maxWorkers, conf);
    int rangeSize = partitionCount / availableWorkerInfos.size();

    partitionOwnerList = new ArrayList<PartitionOwner>();
    Iterator<WorkerInfo> workerIt = availableWorkerInfos.iterator();
    WorkerInfo currentWorker = null;

    int i = 0;
    for (; i < partitionCount; ++i) {
      if (i % rangeSize == 0) {
        if (!workerIt.hasNext()) {
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.