Package org.apache.pig.tools.pigstats

Examples of org.apache.pig.tools.pigstats.PigStatusReporter.incrCounter()


        @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);
            }
        }

        @SuppressWarnings("unchecked")
        public static void handleTimeout(EvalFunc evalFunc, Exception e) {
View Full Code Here


        @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);
            }
        }
    }

    public Object monitorExec(final Tuple input) throws IOException {
View Full Code Here

    * 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();
View Full Code Here

    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

    * 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();
View Full Code Here

        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

            try {
                PigStatusReporter reporter = PigStatusReporter.getInstance();
                if (reporter != null) {

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

                }
View Full Code Here

                }
            }

            PigStatusReporter reporter = PigStatusReporter.getInstance();
            if (reporter != null) {
                reporter.incrCounter(
                        JobControlCompiler.PIG_MAP_RANK_NAME
                        + context.getJobID().toString(), taskID, 0);
            }
        }
View Full Code Here

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

         **/
        public static void incrementCounter(Long increment) {
            PigStatusReporter reporter = PigStatusReporter.getInstance();
            if (reporter != null) {
                if(leaf instanceof POCounter){
                    reporter.incrCounter(
                            JobControlCompiler.PIG_MAP_RANK_NAME
                            + context.getJobID().toString(), taskID, 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.