开发者社区 问答 正文

Hadoop中CopyMapper.class的源代码以及操作示例是什么?

Hadoop中CopyMapper.class的源代码以及操作示例是什么?

展开
收起
游客yzrzs5mf6j7yy 2021-12-06 06:32:36 287 分享 版权
2 条回答
写回答
取消 提交回答
  • public void setup(Context context) throws IOException,    InterruptedException {
    
    conf = context.getConfiguration();
    
     
    
           targetWorkPath = new Path(conf.get(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH));
    
        Path    targetFinalPath = new Path(conf.get(
    
                DistCpConstants.CONF_LABEL_TARGET_FINAL_PATH));
    
        targetFS =    targetFinalPath.getFileSystem(conf);
    
     
    
        if    (targetFS.exists(targetFinalPath) &&    targetFS.isFile(targetFinalPath)) {
    
             overWrite = true; // When target is an existing file,    overwrite it.
    
        }
    
    }
    
     
    
    2021-12-06 06:32:56
    赞同 展开评论
  • public void setup(Context context) throws IOException,    InterruptedException {
    
    conf = context.getConfiguration();
    
     
    
           targetWorkPath = new Path(conf.get(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH));
    
        Path    targetFinalPath = new Path(conf.get(
    
                DistCpConstants.CONF_LABEL_TARGET_FINAL_PATH));
    
        targetFS =    targetFinalPath.getFileSystem(conf);
    
     
    
        if    (targetFS.exists(targetFinalPath) &&    targetFS.isFile(targetFinalPath)) {
    
             overWrite = true; // When target is an existing file,    overwrite it.
    
        }
    
    }
    
     
    
    2021-12-06 06:32:55
    赞同 展开评论