Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> Pig 0.9 UDF Counters


+
Ahmed Sobhi 2012-03-30, 08:59
Copy link to this message
-
Re: Pig 0.9 UDF Counters
Hi Ahmed,

What are you using as key?
The method should work with both Strings and Enums.
If you are using one, can you try with the other?

If it is only a temporary null, you can probably work around it by using
ElephantBird as suggested in the blog post you linked.

Cheers,
--
Gianmarco

On Fri, Mar 30, 2012 at 10:59, Ahmed Sobhi <[EMAIL PROTECTED]> wrote:

> As I wanted to increment some counters in some UDFs I wrote, I came across
>
> http://squarecog.wordpress.com/2010/12/24/incrementing-hadoop-counters-in-apache-pig/
>  as
> THE answer
> which basically says I should use something like
>
> PigStatusReporter reporter = PigStatusReporter.getInstance();
> if (reporter != null) {
>   reporter.getCounter(key).increment(incr);
> }
>
>
> My issue however lies in that reporter.getCounter(key) always returns null
>
> Also, I'm not sure what to do for the case when the reporter itself is null
>
> Any ideas?
>
> --
> Best Regards,
> Ahmed Sobhi
> http://about.me/humanzz/bio
>
+
Ahmed Sobhi 2012-03-30, 09:54
+
Jonathan Coveney 2012-03-30, 15:57
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB