任何人都可以为我提供hadoop文件shell命令到java类的映射吗?

时间:2015-06-30 23:05:21

标签: hadoop hdfs

我是Hadoop的新手,正在开发Java API来管理HDFS中的文件,我正在寻找hadoop文件shell命令到java类的映射(种类)。

2 个答案:

答案 0 :(得分:0)

您在寻找这种地图信息吗?

每个shell命令的Java类:

factory.addClass(Merge.class, "-getmerge");
factory.addClass(Cp.class, "-cp");
factory.addClass(CopyFromLocal.class, "-copyFromLocal");
factory.addClass(CopyToLocal.class, "-copyToLocal");
factory.addClass(Get.class, "-get");
factory.addClass(Put.class, "-put");
factory.addClass(AppendToFile.class, "-appendToFile");

答案 1 :(得分:0)

org.apache.hadoop.fs.shell.CopyCommands

class CopyCommands {  
  public static void registerCommands(CommandFactory factory) {
    factory.addClass(Merge.class, "-getmerge");
    factory.addClass(Cp.class, "-cp");
    factory.addClass(CopyFromLocal.class, "-copyFromLocal");
    factory.addClass(CopyToLocal.class, "-copyToLocal");
    factory.addClass(Get.class, "-get");
    factory.addClass(Put.class, "-put");
    factory.addClass(AppendToFile.class, "-appendToFile");
  }