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
Hadoop >> mail # user >> implementing comparable


+
Keith Thompson 2011-10-15, 21:26
+
Brock Noland 2011-10-15, 23:36
+
Keith Thompson 2011-10-17, 01:40
Copy link to this message
-
Re: implementing comparable
Hi,

Inline..

On Sun, Oct 16, 2011 at 9:40 PM, Keith Thompson <[EMAIL PROTECTED]>wrote:

> Thanks.  I went back and changed to WritableComparable instead of just
> Comparable.  So, I added the readFields and write methods.   I also took
> care of the typo in the constructor. :P
>
> Now I am getting this error:
>
> 11/10/16 21:34:08 INFO mapred.JobClient: Task Id :
> attempt_201110162105_0002_m_000001_1, Status : FAILED
> java.lang.RuntimeException: java.lang.NoSuchMethodException:
> edu.bing.vfi5.KeyList.<init>()
> at
>
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:115)
> at
> org.apache.hadoop.io.WritableComparator.newKey(WritableComparator.java:84)
> at
> org.apache.hadoop.io.WritableComparator.<init>(WritableComparator.java:70)
> at org.apache.hadoop.io.WritableComparator.get(WritableComparator.java:44)
> at
> org.apache.hadoop.mapred.JobConf.getOutputKeyComparator(JobConf.java:599)
> at
> org.apache.hadoop.mapred.MapTask$MapOutputBuffer.<init>(MapTask.java:791)
> at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:350)
> at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
> at org.apache.hadoop.mapred.Child.main(Child.java:170)
> Caused by: java.lang.NoSuchMethodException: edu.bing.vfi5.KeyList.<init>()
> at java.lang.Class.getConstructor0(Class.java:2706)
> at java.lang.Class.getDeclaredConstructor(Class.java:1985)
> at
>
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:109)
>
> Is it saying it can't find the constructor?
>
>
Writables and by extension WritableComparables need a default Constructor.
This makes logical sense. If hadoop is going to call the readFields()
method, it needs  a previously constructed object.

Brock
+
Keith Thompson 2011-10-17, 02:12
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