Package org.apache.hadoop.mapreduce.v2.api.records

Examples of org.apache.hadoop.mapreduce.v2.api.records.Counters


    final JobId id = newJobID(appID, i);
    final String name = newJobName();
    final JobReport report = newJobReport(id);
    final Map<TaskId, Task> tasks = newTasks(id, n, m);
    final TaskCount taskCount = getTaskCount(tasks.values());
    final Counters counters = getCounters(tasks.values());
    return new Job() {
      @Override
      public JobId getID() {
        return id;
      }
View Full Code Here


    return isUber;
  }

  @Override
  public Counters getCounters() {
    Counters counters = newCounters();
    readLock.lock();
    try {
      incrAllCounters(counters, jobCounters);
      return incrTaskCounters(counters, tasks.values());
    } finally {
View Full Code Here

      readLock.unlock();
    }
  }

  private Counters getTypeCounters(Set<TaskId> taskIds) {
    Counters counters = newCounters();
    for (TaskId taskId : taskIds) {
      Task task = tasks.get(taskId);
      incrAllCounters(counters, task.getCounters());
    }
    return counters;
View Full Code Here

      readLock.unlock();
    }
  }
 
  public static Counters newCounters() {
    Counters counters = RecordFactoryProvider.getRecordFactory(null)
        .newRecordInstance(Counters.class);
    return counters;
  }
View Full Code Here

  @Override
  public Counters getCounters() {
    readLock.lock();
    try {
      Counters counters = reportedStatus.counters;
      if (counters == null) {
        counters = recordFactory.newRecordInstance(Counters.class);
//        counters.groups = new HashMap<String, CounterGroup>();
      }
      return counters;
View Full Code Here

    }
  }
 
  private void updateProgressSplits() {
    double newProgress = reportedStatus.progress;
    Counters counters = reportedStatus.counters;
    if (counters == null)
      return;

    WrappedProgressSplitsBlock splitsBlock = getProgressSplitBlock();
    if (splitsBlock != null) {
      long now = clock.getTime();
      long start = getLaunchTime(); // TODO Ensure not 0

      if (start != 0 && now - start <= Integer.MAX_VALUE) {
        splitsBlock.getProgressWallclockTime().extend(newProgress,
            (int) (now - start));
      }

      Counter cpuCounter = counters.getCounter(
          TaskCounter.CPU_MILLISECONDS);
      if (cpuCounter != null && cpuCounter.getValue() <= Integer.MAX_VALUE) {
        splitsBlock.getProgressCPUTime().extend(newProgress,
            (int) cpuCounter.getValue());
      }

      Counter virtualBytes = counters.getCounter(
          TaskCounter.VIRTUAL_MEMORY_BYTES);
      if (virtualBytes != null) {
        splitsBlock.getProgressVirtualMemoryKbytes().extend(newProgress,
            (int) (virtualBytes.getValue() / (MEMORY_SPLITS_RESOLUTION)));
      }

      Counter physicalBytes = counters.getCounter(
          TaskCounter.PHYSICAL_MEMORY_BYTES);
      if (physicalBytes != null) {
        splitsBlock.getProgressPhysicalMemoryKbytes().extend(newProgress,
            (int) (physicalBytes.getValue() / (MEMORY_SPLITS_RESOLUTION)));
      }
View Full Code Here

  private void initTaskAttemptStatus(TaskAttemptStatus result) {
    result.progress = 0.0f;
    result.phase = Phase.STARTING;
    result.stateString = "NEW";
    result.taskState = TaskAttemptState.NEW;
    Counters counters = recordFactory.newRecordInstance(Counters.class);
//    counters.groups = new HashMap<String, CounterGroup>();
    result.counters = counters;
  }
View Full Code Here

    }
  }

  @Override
  public Counters getCounters() {
    Counters counters = null;
    readLock.lock();
    try {
      TaskAttempt bestAttempt = selectBestAttempt();
      if (bestAttempt != null) {
        counters = bestAttempt.getCounters();
View Full Code Here

    }

    @Override
    public GetCountersResponse getCounters(GetCountersRequest request) throws YarnRemoteException {
      hsContact = true;
      Counters counters = getMyCounters();
      GetCountersResponse response = recordFactory.newRecordInstance(GetCountersResponse.class);
      response.setCounters(counters);
      return response;
   }
View Full Code Here

        throws YarnRemoteException {
      JobId jobID = request.getJobId();

      amContact = true;

      Counters counters = getMyCounters();
      GetCountersResponse response = recordFactory
          .newRecordInstance(GetCountersResponse.class);
      response.setCounters(counters);
      return response;
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapreduce.v2.api.records.Counters

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.