Java 新手hadoop。。分布式缓存
我有一个制图器Java 新手hadoop。。分布式缓存,java,hadoop,mapreduce,Java,Hadoop,Mapreduce,我有一个制图器 public class BuildGraph{ public void config(JobConf job){ <==this block doesnt seems to be exexcuting at all :( super.configure(job); this.currentId = job.getInt("currentId",0); if (this.currentId!=0){ // I call a metho
public class BuildGraph{
public void config(JobConf job){ <==this block doesnt seems to be exexcuting at all :(
super.configure(job);
this.currentId = job.getInt("currentId",0);
if (this.currentId!=0){
// I call a method from differnt class to build a distributed cache
}
}
public void map(....){
....
}
公共类构建图{
public void config(JobConf job){您似乎没有使用正确的契约,因为您没有扩展MapReduceBase
并且没有实现Mapper
。该方法也应该被称为configure
,而不是config
。请尝试以下方法:
public class BuildGraph extends MapReduceBase implements Mapper<K, V, K, V> {
public void configure(JobConf job) {
// this will get called once at the beginning of the task
}
public void map(...) {
...
}
}
公共类BuildGraph扩展MapReduceBase实现Mapper{
公共无效配置(JobConf作业){
//这将在任务开始时调用一次
}
公共空间映射(…){
...
}
}
@Fraz你能发布完整的映射器代码和main吗?如果太大,你可以链接到外部文本编辑器,以防万一,我希望第17行会像第93行一样执行。我正在设置一个非零值。第14行打印了什么?它会被执行吗?不:(它从未执行过该块)
public class BuildGraph extends MapReduceBase implements Mapper<K, V, K, V> {
public void configure(JobConf job) {
// this will get called once at the beginning of the task
}
public void map(...) {
...
}
}