Package org.apache.hadoop.tools

Examples of org.apache.hadoop.tools.HadoopArchives$HArchivesMergingReducer


    Path archivePath = new Path(fs.getHomeDirectory(), "srcdat.har");
   
    {
      // copy from Local to hdfs
      String[] args = { "-copyFromLocal", localDir, archivePath.toString() };
      int ret = ToolRunner.run(new HadoopArchives(conf), args);
      assertTrue("failed test", ret == 0);
 
      URI uri = archivePath.toUri();
      // create appropriate har path
      Path harPath = new Path("har://" + uri.getScheme() + "-" + uri.getAuthority() + uri.getPath());
     
      FileSystem harfs = harPath.getFileSystem(conf);
      CopyFilesBase.checkFiles(harfs, archivePath.toString(), myFiles);
    }
   
    {
      // copy from hdfs to local
      localfs.mkdirs(new Path(localDir2));
      String[] args = { "-copyToLocal", archivePath.toString(), localDir2 };
      int ret = ToolRunner.run(new HadoopArchives(conf), args);
      assertTrue("failed test", ret == 0);
     
      CopyFilesBase.checkFiles(localfs, localDir2, myFiles);
    }
View Full Code Here


        rand.nextLong() + "-" + HAR_SUFFIX;

    // HadoopArchives.HAR_PARTFILE_LABEL is private, so hard-coding the label.
    conf.setLong("har.partfile.size", configMgr.getHarPartfileSize());
    conf.setLong("har.block.size", harBlockSize);
    HadoopArchives har = new HadoopArchives(conf);
    String[] args = new String[7];
    args[0] = "-Ddfs.replication=" + harReplication;
    args[1] = "-archiveName";
    args[2] = harFileSrc;
    args[3] = "-p";
View Full Code Here

    out.close();
    out = fs.create(fileb);
    out.write("b".getBytes());
    out.close();
   
    HadoopArchives har = new HadoopArchives(conf);

    String archiveName = "foo.har";
    String[] args = new String[5];
    args[0] = "-archiveName";
    args[1] = "foo.har";
View Full Code Here

TOP

Related Classes of org.apache.hadoop.tools.HadoopArchives$HArchivesMergingReducer

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.