Dear All,

I get the following NoSuchMethodException

Exception in thread "main" java.lang.NoSuchMethodException:
PositionCounter.main([Ljava.lang.String;)
at java.lang.Class.getMethod(Class.java:1605)
at org.apache.hadoop.util.RunJar.main(RunJar.java:150)

when running the following PositionCounter class:


public class PositionCounter {


 @SuppressWarnings("deprecation")

public static class Map extends MapReduceBase implements

Mapper<LongWritable, Text, Text, IntWritable> {


 public void map(LongWritable key, Text value,

  OutputCollector<Text, IntWritable> output, Reporter reporter)

 throws IOException {


  String line = value.toString();

 StringTokenizer tokenizer = new StringTokenizer(line);


  for (int i = 0; i < line.length(); i++) {


  String s = new StringBuilder().append(line.charAt(i)).toString();

  output.collect(new Text(s), new IntWritable(i));


  }

 }


 @SuppressWarnings("deprecation")

 public static void main(String[] args) throws Exception {

 JobConf conf = new JobConf(PositionCounter.class);

 conf.setJobName("positioncounter");


  conf.setOutputKeyClass(Text.class);

 conf.setOutputValueClass(IntWritable.class);


  conf.setMapperClass(Map.class);

 // conf.setCombinerClass(Reduce.class);

 //conf.setReducerClass(Reduce.class);


  conf.setInputFormat(TextInputFormat.class);

 conf.setOutputFormat(TextOutputFormat.class);


  //conf.setNumReduceTasks(new Integer(1));


  FileInputFormat.setInputPaths(conf, new Path(args[0]));

 FileOutputFormat.setOutputPath(conf, new Path(args[1]));


  JobClient.runJob(conf);

 }

}

}

Any help is greatly appreciated,
Best,
Attila



On Thu, Nov 18, 2010 at 11:46 PM, Attila Csordas <attilacsor...@gmail.com>wrote:

> Dear All,
>
> Java, Hadoop rookie here coming from biology, more wet lab than dry lab so
> far.
>
> I'd like to build a mapper which emits (charAt(i), i+1) (in
> StandardStringJava not in HadoopTextJava) pairs from lines containing
> a sequence.
>
> Which is the more easier and obvious way to implement this: using Text
> and charAt() and IntWritable within the Mapper or build a
> CustomWritable class?
>
> Hints, not total solutions please (so I can write again if unable to
> figure it out shortly)
> Best,
> --
> Attila Csordas
> Bioinformatician
> EMBL European Bioinformatics Institute
> Wellcome Trust Genome Campus
> Hinxton, Cambridge, UK
>

Reply via email to