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 Threaded View
Hadoop >> mail # user >> Deserialization in ReduceContext


Copy link to this message
-
Deserialization in ReduceContext
Hi,

Would someone please explain why ReduceContext.nextKeyValue() creates only a
single instance of the deserializing class?
This is a rather non-standard semantics for deserialization and drove me
insane.

E.g., the following code is rather intuitive but patently wrong; it always
adds a single instance of V to the set.

void reduce(K key, Iterable<V> values, Context context) {
    TreeSet<V> union = new TreeSet<V>();
    for (V v : values) {
        union.add(v);
    }
}

Thanks,

stan
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