Package org.apache.hadoop.mapred.Counters

Examples of org.apache.hadoop.mapred.Counters.Group


        RunningJob job = getJob(JobID.forName(jobid));
        if (job == null) {
          System.out.println("Could not find job " + jobid);
        } else {
          Counters counters = job.getCounters();
          Group group = counters.getGroup(counterGroupName);
          Counter counter = group.getCounterForName(counterName);
          System.out.println(counter.getCounter());
          exitCode = 0;
        }
      } else if (killJob) {
        RunningJob job = getJob(JobID.forName(jobid));
View Full Code Here


              System.out.println("Counters not available for retired job "
                  + jobid);
            }
            exitCode = -1;
          } else {
            Group group = counters.getGroup(counterGroupName);
            Counter counter = group.getCounterForName(counterName);
            System.out.println(counter.getCounter());
            exitCode = 0;
          }
        }
      } else if (killJob) {
View Full Code Here

     * these values are passed via configuration file to PORank, by using the unique
     * operation identifier
     */
    private void saveCounters(Job job, String operationID) {
        Counters counters;
        Group groupCounters;

        Long previousValue = 0L;
        Long previousSum = 0L;
        ArrayList<Pair<String,Long>> counterPairs;

        try {
            counters = HadoopShims.getCounters(job);
            groupCounters = counters.getGroup(getGroupName(counters.getGroupNames()));

            Iterator<Counter> it = groupCounters.iterator();
            HashMap<Integer,Long> counterList = new HashMap<Integer, Long>();

            while(it.hasNext()) {
                try{
                    Counter c = it.next();
View Full Code Here

          if (counters == null) {
            System.out.println("Counters not available for retired job " +
                jobid);
            exitCode = -1;
          } else {
            Group group = counters.getGroup(counterGroupName);
            Counter counter = group.getCounterForName(counterName);
            System.out.println(counter.getCounter());
            exitCode = 0;
          }
        }
      } else if (killJob) {
View Full Code Here

      LOG.error(e);
      return;
    }
   
    //Adding to logMetrics
    Group counterGroup = ctrs.getGroup(LogUtils.LOG_COUNTER_GROUP_NAME);
    MetricsRegistry registry = RaidNodeMetrics.getInstance(
        RaidNodeMetrics.DEFAULT_NAMESPACE_ID).getMetricsRegistry();
    Map<String, MetricsTimeVaryingLong> logMetrics = RaidNodeMetrics.getInstance(
        RaidNodeMetrics.DEFAULT_NAMESPACE_ID).logMetrics;
    synchronized(logMetrics) {
View Full Code Here

      "Reduce Value",
      "Total Value"));
    buff.append("\n------------------------------------------"+
      "---------------------------------------------");
    for (String groupName : totalCounters.getGroupNames()) {
      Group totalGroup = totalCounters.getGroup(groupName);
      Group mapGroup = mapCounters.getGroup(groupName);
      Group reduceGroup = reduceCounters.getGroup(groupName);
      Format decimal = new DecimalFormat();
      Iterator<Counter> ctrItr = totalGroup.iterator();
      while (ctrItr.hasNext()) {
        Counter counter = ctrItr.next();
        String name = counter.getDisplayName();
        String mapValue = decimal.format(mapGroup.getCounter(name));
        String reduceValue = decimal.format(reduceGroup.getCounter(name));
        String totalValue = decimal.format(counter.getValue());
        buff.append(
          String.format("\n|%1$-30s|%2$-30s|%3$-10s|%4$-10s|%5$-10s",
          totalGroup.getDisplayName(),
          counter.getDisplayName(),
View Full Code Here

          if (counters == null) {
            System.out.println("Counters not available for retired job " +
                jobid);
            exitCode = -1;
          } else {
            Group group = counters.getGroup(counterGroupName);
            Counter counter = group.getCounterForName(counterName);
            System.out.println(counter.getCounter());
            exitCode = 0;
          }
        }
      } else if (killJob) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.Counters.Group

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.