Examples of PigStatusReporter


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

                this.outputCollector = context;
                pigReporter.setRep(context);
                PhysicalOperator.setReporter(pigReporter);

                boolean aggregateWarning = "true".equalsIgnoreCase(pigContext.getProperties().getProperty("aggregate.warning"));
                PigStatusReporter pigStatusReporter = PigStatusReporter.getInstance();
                pigStatusReporter.setContext(new MRTaskContext(context));
                PigHadoopLogger pigHadoopLogger = PigHadoopLogger.getInstance();
                pigHadoopLogger.setReporter(pigStatusReporter);
                pigHadoopLogger.setAggregate(aggregateWarning);
                PhysicalOperator.setPigLogger(pigHadoopLogger);
View Full Code Here

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

            }
            roots = targetOpsAsList.toArray(new PhysicalOperator[1]);
            leaf = mp.getLeaves().get(0);
        }

        PigStatusReporter pigStatusReporter = PigStatusReporter.getInstance();
        pigStatusReporter.setContext(new MRTaskContext(context));

        log.info("Aliases being processed per job phase (AliasName[line,offset]): " + job.get("pig.alias.location"));

        String dtzStr = PigMapReduce.sJobConfInternal.get().get("pig.datetime.default.tz");
        if (dtzStr != null && dtzStr.length() > 0) {
View Full Code Here

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

            this.outputCollector = context;
            pigReporter.setRep(context);
            PhysicalOperator.setReporter(pigReporter);

            boolean aggregateWarning = "true".equalsIgnoreCase(pigContext.getProperties().getProperty("aggregate.warning"));
            PigStatusReporter pigStatusReporter = PigStatusReporter.getInstance();
            pigStatusReporter.setContext(new MRTaskContext(context));
            PigHadoopLogger pigHadoopLogger = PigHadoopLogger.getInstance();
            pigHadoopLogger.setReporter(pigStatusReporter);
            pigHadoopLogger.setAggregate(aggregateWarning);
            PhysicalOperator.setPigLogger(pigHadoopLogger);
View Full Code Here

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

    public static class ErrorCallback {

        @SuppressWarnings("unchecked")
        public static void handleError(EvalFunc evalFunc, Exception e) {
            evalFunc.getLogger().error(e);
            PigStatusReporter reporter = PigStatusReporter.getInstance();
            if (reporter != null) {
                reporter.incrCounter(evalFunc.getClass().getName(), e.toString(), 1);
            }
        }
View Full Code Here

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

        }

        @SuppressWarnings("unchecked")
        public static void handleTimeout(EvalFunc evalFunc, Exception e) {
            evalFunc.getLogger().error(e);
            PigStatusReporter reporter = PigStatusReporter.getInstance();
            if (reporter != null) {
                reporter.incrCounter(evalFunc.getClass().getName(), "MonitoredUDF Timeout", 1);
            }
        }
View Full Code Here

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

            // ensure that the internal timezone is uniformly in UTC offset style
            DateTimeZone.setDefault(DateTimeZone.forOffsetMillis(DateTimeZone.forID(dtzStr).getOffset(null)));
        }

        boolean aggregateWarning = "true".equalsIgnoreCase(conf.get("aggregate.warning"));
        PigStatusReporter pigStatusReporter = PigStatusReporter.getInstance();
        pigStatusReporter.setContext(new FetchTaskContext(new FetchContext()));
        PigHadoopLogger pigHadoopLogger = PigHadoopLogger.getInstance();
        pigHadoopLogger.setReporter(pigStatusReporter);
        pigHadoopLogger.setAggregate(aggregateWarning);
        PhysicalOperator.setPigLogger(pigHadoopLogger);
    }
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 && reporter.incrCounter(group, counterName, incr)) { // common case
            if (counterStringMap_.size() > 0) {
                for (Map.Entry<Pair<String, String>, Long> entry : counterStringMap_.entrySet()) {
                    reporter.incrCounter(entry.getKey().first, entry.getKey().second, 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.incrCounter(key, incr)) { // common case
            if (counterEnumMap_.size() > 0) {
                for (Map.Entry<Enum<?>, Long> entry : counterEnumMap_.entrySet()) {
                    reporter.getCounter(entry.getKey()).increment(entry.getValue());
                }
                counterEnumMap_.clear();
            }
            return;
        }
View Full Code Here

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

        incSpillCount(counter, 1);
    }

    @SuppressWarnings("rawtypes")
    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 void collect(Context context, Tuple tuple)
        throws InterruptedException, IOException {
            context.write(null, tuple);
            try {
                PigStatusReporter reporter = PigStatusReporter.getInstance();
                if (reporter != null) {
                    reporter.incrCounter(
                            JobControlCompiler.PIG_MAP_RANK_NAME
                            + context.getJobID().toString(), taskID, 1);
                }
            } catch (Exception ex) {
                log.error("Error on incrementer of PigMapCounter");
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.