Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.CopyFiles


      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster(65318, conf, false);
      namenode = conf.get("fs.default.name", "local");
      if (!"local".equals(namenode)) {
        MyFile[] files = createFiles(namenode, "/srcdat");
        new CopyFiles().doMain(conf, new String[] {"dfs://"+namenode+"/srcdat",
        "file://"+TEST_ROOT_DIR+"/destdat"});
        assertTrue("Source and destination directories do not match.",
            checkFiles("local", TEST_ROOT_DIR+"/destdat", files));
        deldir("local", TEST_ROOT_DIR+"/destdat");
        deldir(namenode, "/srcdat");
View Full Code Here


  }
 
  /** copy files from local file system to local file system */
  public void testCopyFromLocalToLocal() throws Exception {
    MyFile[] files = createFiles("local", TEST_ROOT_DIR+"/srcdat");
    new CopyFiles().doMain(new Configuration(),
        new String[] {"file://"+TEST_ROOT_DIR+"/srcdat",
          "file://"+TEST_ROOT_DIR+"/destdat"});
    assertTrue("Source and destination directories do not match.",
        checkFiles("local", TEST_ROOT_DIR+"/destdat", files));
    deldir("local", TEST_ROOT_DIR+"/destdat");
View Full Code Here

      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster(65314, conf, 2, false);
      namenode = conf.get("fs.default.name", "local");
      if (!"local".equals(namenode)) {
        MyFile[] files = createFiles(namenode, "/srcdat");
        new CopyFiles().doMain(conf, new String[] {"hdfs://"+namenode+"/srcdat",
        "hdfs://"+namenode+"/destdat"});
        assertTrue("Source and destination directories do not match.",
            checkFiles(namenode, "/destdat", files));
        deldir(namenode, "/destdat");
        deldir(namenode, "/srcdat");
View Full Code Here

      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster(65316, conf, false);
      namenode = conf.get("fs.default.name", "local");
      if (!"local".equals(namenode)) {
        MyFile[] files = createFiles("local", TEST_ROOT_DIR+"/srcdat");
        new CopyFiles().doMain(conf, new String[] {"file://"+TEST_ROOT_DIR+"/srcdat",
        "hdfs://"+namenode+"/destdat"});
        assertTrue("Source and destination directories do not match.",
            checkFiles(namenode, "/destdat", files));
        deldir(namenode, "/destdat");
        deldir("local", TEST_ROOT_DIR+"/srcdat");
View Full Code Here

      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster(65318, conf, false);
      namenode = conf.get("fs.default.name", "local");
      if (!"local".equals(namenode)) {
        MyFile[] files = createFiles(namenode, "/srcdat");
        new CopyFiles().doMain(conf, new String[] {"hdfs://"+namenode+"/srcdat",
        "file://"+TEST_ROOT_DIR+"/destdat"});
        assertTrue("Source and destination directories do not match.",
            checkFiles("local", TEST_ROOT_DIR+"/destdat", files));
        deldir("local", TEST_ROOT_DIR+"/destdat");
        deldir(namenode, "/srcdat");
View Full Code Here

  }
 
  /** copy files from local file system to local file system */
  public void testCopyFromLocalToLocal() throws Exception {
    MyFile[] files = createFiles("local", TEST_ROOT_DIR+"/srcdat");
    new CopyFiles().doMain(new Configuration(),
        new String[] {"file://"+TEST_ROOT_DIR+"/srcdat",
          "file://"+TEST_ROOT_DIR+"/destdat"});
    assertTrue("Source and destination directories do not match.",
        checkFiles("local", TEST_ROOT_DIR+"/destdat", files));
    deldir("local", TEST_ROOT_DIR+"/destdat");
View Full Code Here

      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster(65314, conf, false);
      namenode = conf.get("fs.default.name", "local");
      if (!"local".equals(namenode)) {
        MyFile[] files = createFiles(namenode, "/srcdat");
        new CopyFiles().doMain(conf, new String[] {"dfs://"+namenode+"/srcdat",
        "dfs://"+namenode+"/destdat"});
        assertTrue("Source and destination directories do not match.",
            checkFiles(namenode, "/destdat", files));
        deldir(namenode, "/destdat");
        deldir(namenode, "/srcdat");
View Full Code Here

      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster(65316, conf, false);
      namenode = conf.get("fs.default.name", "local");
      if (!"local".equals(namenode)) {
        MyFile[] files = createFiles("local", TEST_ROOT_DIR+"/srcdat");
        new CopyFiles().doMain(conf, new String[] {"file://"+TEST_ROOT_DIR+"/srcdat",
        "dfs://"+namenode+"/destdat"});
        assertTrue("Source and destination directories do not match.",
            checkFiles(namenode, "/destdat", files));
        deldir(namenode, "/destdat");
        deldir("local", TEST_ROOT_DIR+"/srcdat");
View Full Code Here

      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster(65318, conf, false);
      namenode = conf.get("fs.default.name", "local");
      if (!"local".equals(namenode)) {
        MyFile[] files = createFiles(namenode, "/srcdat");
        new CopyFiles().doMain(conf, new String[] {"dfs://"+namenode+"/srcdat",
        "file://"+TEST_ROOT_DIR+"/destdat"});
        assertTrue("Source and destination directories do not match.",
            checkFiles("local", TEST_ROOT_DIR+"/destdat", files));
        deldir("local", TEST_ROOT_DIR+"/destdat");
        deldir(namenode, "/srcdat");
View Full Code Here

  }
 
  /** copy files from local file system to local file system */
  public void testCopyFromLocalToLocal() throws Exception {
    MyFile[] files = createFiles(LOCAL_FS, TEST_ROOT_DIR+"/srcdat");
    ToolRunner.run(new CopyFiles(new Configuration()),
                           new String[] {"file:///"+TEST_ROOT_DIR+"/srcdat",
                                         "file:///"+TEST_ROOT_DIR+"/destdat"});
    assertTrue("Source and destination directories do not match.",
               checkFiles("file:///", TEST_ROOT_DIR+"/destdat", files));
    deldir("file:///", TEST_ROOT_DIR+"/destdat");
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.CopyFiles

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.