hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deyaa Adranale <deyaa.adran...@iais.fraunhofer.de>
Subject non-static map or reduce classes?
Date Wed, 21 May 2008 10:17:55 GMT
why do we have to set the map and reduce classes as static?
i need inside them to access some data which is not static. what i 
should do?

non static map or reduce classes generates the following exception:

java.lang.RuntimeException: java.lang.NoSuchMethodException: hadoop.examples.Simple$MyMapper.()
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:45)
    at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:32)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:53)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:209)
    at org.apache.hadoop.mapred.TaskTracker$Child.main(TaskTracker.java:1210)
Caused by: java.lang.NoSuchMethodException: hadoop.examples.Simple$MyMapper.()
    at java.lang.Class.getConstructor0(Class.java:2705)
    at java.lang.Class.getDeclaredConstructor(Class.java:1984)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:41)
    ... 4 more

any ideas?

thanks in advance,


View raw message