Package org.apache.hadoop.mapreduce

Examples of org.apache.hadoop.mapreduce.Counter.increment()


    try {
      for (Map.Entry<String, Long> entry:scanMetrics.getMetricsMap().entrySet()) {
        Counter ct = (Counter)getCounter.invoke(context,
            HBASE_COUNTER_GROUP_NAME, entry.getKey());

        ct.increment(entry.getValue());
      }
      ((Counter) getCounter.invoke(context, HBASE_COUNTER_GROUP_NAME,
          "NUM_SCANNER_RESTARTS")).increment(numScannerRestarts);
    } catch (Exception e) {
      LOG.debug("can't update counter." + StringUtils.stringifyException(e));
View Full Code Here


    //

    private void incrementCounter(Context context,Enum <?> counterId,long amount) {
        Counter counter=context.getCounter(counterId);
        if(counter!=null) {
            counter.increment(amount);
        };
    };
}
View Full Code Here

    //
   
    private void incrementCounter(Context context,Enum <?> counterId,long amount) {
        Counter counter=context.getCounter(counterId);
        if(counter!=null) {
            counter.increment(amount);
        };
    };

}
View Full Code Here

    //

    private void incrementCounter(Context context,Enum <?> counterId,long amount) {
        Counter counter=context.getCounter(counterId);
        if(counter!=null) {
            counter.increment(amount);
        };
    };
}
View Full Code Here

    try {
      for (MetricsTimeVaryingLong mlv : mlvs) {
        Counter ct = (Counter)this.getCounter.invoke(context,
          HBASE_COUNTER_GROUP_NAME, mlv.getName());
        ct.increment(mlv.getCurrentIntervalValue());
      }
      ((Counter) this.getCounter.invoke(context, HBASE_COUNTER_GROUP_NAME,
          "NUM_SCANNER_RESTARTS")).increment(numRestarts);
    } catch (Exception e) {
      LOG.debug("can't update counter." + StringUtils.stringifyException(e));
View Full Code Here

      try {
        for (MetricsTimeVaryingLong mlv : mlvs) {
          Counter ct = (Counter)this.getCounter.invoke(context,
            HBASE_COUNTER_GROUP_NAME, mlv.getName());
          ct.increment(mlv.getCurrentIntervalValue());
        }
      } catch (Exception e) {
        LOG.debug("can't update counter." + StringUtils.stringifyException(e));
      }
    }
View Full Code Here

    @Override
    protected void map(ImmutableBytesWritable key, Result value, Context context)
        throws IOException, InterruptedException {
      byte[] row = value.getRow();
      Counter c = getCounter(row);
      c.increment(1);
    }

    private Counter getCounter(byte[] row) {
      Counter c = null;
      if (Bytes.indexOf(row, Bytes.toBytes(VISIBILITY_EXPS[0])) != -1) {
View Full Code Here

    public void warn(Object o, String msg, Enum warningEnum) {
        String displayMessage = o.getClass().getName() + ": " + msg;
        if(aggregate) {
            if(taskIOContext != null) {
                Counter c = taskIOContext.getCounter(warningEnum);
                c.increment(1);
            } else {
                //TODO:
                //in local mode of execution if the PigHadoopLogger is used initially,
                //then aggregation cannot be performed as the reporter will be null.
                //The reference to a reporter is given by Hadoop at run time.
View Full Code Here

  public void skip() throws Exception {

    Counter skippedInstances = EasyMock.createMock(Counter.class);

    EasyMock.expect(ctx.getCounter(IndexInstancesMapper.Counter.SKIPPED_INSTANCES)).andReturn(skippedInstances);
    skippedInstances.increment(1);

    EasyMock.replay(ctx, skippedInstances);

    IndexInstancesMapper indexInstances = new IndexInstancesMapper();
    setField(indexInstances, "labelIndex", labelIndex);
View Full Code Here

    try {
      for (Map.Entry<String, Long> entry:scanMetrics.getMetricsMap().entrySet()) {
        Counter ct = (Counter)this.getCounter.invoke(context,
            HBASE_COUNTER_GROUP_NAME, entry.getKey());

        ct.increment(entry.getValue());
      }

      ((Counter) this.getCounter.invoke(context, HBASE_COUNTER_GROUP_NAME,
          "NUM_SCANNER_RESTARTS")).increment(numRestarts);
    } catch (Exception e) {
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.