hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijay Bharath Reddy <vijaybharathena...@gmail.com>
Subject reg : my OutputFormat class cannot recognize my WritableComparable class
Date Thu, 17 Sep 2009 18:17:02 GMT

I'm writing my own OutputFormat class and I faced the folloeing errors.

-- public class KeyDoc implements WritableComparable{

this is my WritableComparable implementation...

-- public class KeyDocOutputFormat<KeyDoc,IntWritable> implements

this is my OutputFormat implementation...

      In this KeyDocOutputFormat class I implemented RecordWriter ..

              --  public static class MyRecordWriter<KeyDoc, IntWritable>
implements RecordWriter<KeyDoc, IntWritable>{

                     In this RecordWriter  my write function goes like

                          --  public synchronized void write(KeyDoc kd,
IntWritable v) throws IOException{

And in this function when I'm accessing the KeyDoc attributes compiler is
shooting the following error..

KeyDocOutputFormat.java:55: cannot find symbol
symbol  : method get(java.lang.String)
location: class java.lang.Object

Its considering the kd as an Object not as an KeyDoc... So for checking this
I gave.....

if(kd instanceof KeyDoc)

then the error is ....

KeyDocOutputFormat.java:50: unexpected type
found   : KeyDoc
required: class or array
                if(kd instanceof KeyDoc)

Can someone help me in debugging it .....


PS :: I attached the source code..

View raw message