Examples of PigStatusReporter


Examples of org.apache.pig.tools.pigstats.PigStatusReporter

    @Override
    public Integer exec(Tuple input) throws IOException {
       
        try {
            Thread.sleep(7500);
            PigStatusReporter reporter = PigStatusReporter.getInstance();
            reporter.progress();
            Thread.sleep(7500);
        } catch (InterruptedException e) {
        }
       
        return 100;
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

                Object convertedKey = convertOrcToPig(entry.getKey(), keyObjectInspector, null);
                Object convertedValue = convertOrcToPig(entry.getValue(), valueObjectInspector, null);
                if (convertedKey!=null) {
                    ((Map)result).put(convertedKey.toString(), convertedValue);
                } else {
                    PigStatusReporter reporter = PigStatusReporter.getInstance();
                    if (reporter != null) {
                       reporter.incrCounter(PigWarning.UDF_WARNING_1, 1);
                    }
                }
            }
            break;
        case LIST:
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

    }

    @Override
    public Tuple getCurrentValue() throws IOException, InterruptedException {   
        if (inputRecordCounter == null && counterName != null) {
            PigStatusReporter reporter = PigStatusReporter.getInstance();
            if (reporter != null) {
                inputRecordCounter = reporter.getCounter(
                        PigStatsUtil.MULTI_INPUTS_COUNTER_GROUP,
                        counterName);
                LOG.info("Created input record counter: " + counterName);
            } else {
                LOG.warn("Get null reporter for " + counterName);
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

  /**
   * Mocks the Reporter.incrCounter, but adds buffering.
   * See org.apache.hadoop.mapred.Reporter's incrCounter.
   */
  public void incrCounter(String group, String counterName, long incr) {
    PigStatusReporter reporter = PigStatusReporter.getInstance();
    if (reporter != null) { // common case
      Counter counter = reporter.getCounter(group, counterName);
      if (counter != null) {
        counter.increment(incr);

        if (counterStringMap_.size() > 0) {
          for (Map.Entry<Pair<String, String>, Long> entry : counterStringMap_.entrySet()) {
            reporter.getCounter(entry.getKey().first, entry.getKey().second).increment(entry.getValue());
          }
          counterStringMap_.clear();
        }
        return;
      }
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

  /**
   * Mocks the Reporter.incrCounter, but adds buffering.
   * See org.apache.hadoop.mapred.Reporter's incrCounter.
   */
  public void incrCounter(Enum<?> key, long incr) {
    PigStatusReporter reporter = PigStatusReporter.getInstance();
    if (reporter != null && reporter.getCounter(key) != null) {
      reporter.getCounter(key).increment(incr);
      if (counterEnumMap_.size() > 0) {
        for (Map.Entry<Enum<?>, Long> entry : counterEnumMap_.entrySet()) {
          reporter.getCounter(entry.getKey()).increment(entry.getValue());
        }
        counterEnumMap_.clear();
      }
    } else { // buffer the increments
      Long currentValue = counterEnumMap_.get(key);
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

    protected void incSpillCount(Enum counter) {
        incSpillCount(counter, 1);
    }

    protected void incSpillCount(Enum counter, long numRecsSpilled) {
        PigStatusReporter reporter = PigStatusReporter.getInstance();
        if (reporter != null && reporter.getCounter(counter)!=null) {
            reporter.getCounter(counter).increment(numRecsSpilled);
        } else {
            PigHadoopLogger.getInstance().warn(this, "Spill counter incremented", counter);
        }
    }
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

    }

    @Override
    public Tuple getCurrentValue() throws IOException, InterruptedException {   
        if (inputRecordCounter == null && counterName != null) {
            PigStatusReporter reporter = PigStatusReporter.getInstance();
            if (reporter != null) {
                inputRecordCounter = reporter.getCounter(
                        PigStatsUtil.MULTI_INPUTS_COUNTER_GROUP,
                        counterName);
                LOG.info("Created input record counter: " + counterName);
            } else {
                LOG.warn("Get null reporter for " + counterName);
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

    }

    @Override
    public Tuple getCurrentValue() throws IOException, InterruptedException {   
        if (inputRecordCounter == null && counterName != null) {
            PigStatusReporter reporter = PigStatusReporter.getInstance();
            if (reporter != null) {
                inputRecordCounter = reporter.getCounter(
                        PigStatsUtil.MULTI_INPUTS_COUNTER_GROUP,
                        counterName);
                LOG.info("Created input record counter: " + counterName);
            } else {
                LOG.warn("Get null reporter for " + counterName);
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

        @Override
        public void collect(Context context, Tuple tuple)
        throws InterruptedException, IOException {
            context.write(null, tuple);
            try {
                PigStatusReporter reporter = PigStatusReporter.getInstance();
                if (reporter != null) {
                    reporter.getCounter(
                            JobControlCompiler.PIG_MAP_RANK_NAME
                            + context.getJobID().toString(), taskID)
                            .increment(1);
                }
            } catch (Exception ex) {
View Full Code Here

Examples of org.apache.pig.tools.pigstats.PigStatusReporter

         * of the size of bag in the tuple.
         * @param increment is the value to add to the corresponding global counter.
         **/
        public static void incrementCounter(Long increment) {
            try {
                PigStatusReporter reporter = PigStatusReporter.getInstance();
                if (reporter != null) {

                    if(leaf instanceof POCounter){
                        reporter.getCounter(
                                JobControlCompiler.PIG_MAP_RANK_NAME
                                + context.getJobID().toString(), taskID).increment(increment);

                    }

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.