Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 新手hadoop。。分布式缓存_Java_Hadoop_Mapreduce - Fatal编程技术网

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(...) {
        ...
    }
}