Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FileSystem.copyToLocalFile()


                pathSrc.getName());
            // LOG.info("user.dir: "+System.getProperty("user.dir"));
            // LOG.info("WorkingDirectory: "+local.getWorkingDirectory());
            // LOG.info("pathDst: " + pathDst);
            LOG.debug("copyToLocalFile: " + pathDst);
            hdfs.copyToLocalFile(pathSrc, pathDst);
            local.deleteOnExit(pathDst);
            files.append(pathDst.toUri().getPath());
          }
          first = false;
        }
View Full Code Here


            // File dst = File.createTempFile(pathSrc.getName() + "-", ".jar");
            Path pathDst = new Path(local.getWorkingDirectory(),
                pathSrc.getName());

            LOG.debug("copyToLocalFile: " + pathDst);
            hdfs.copyToLocalFile(pathSrc, pathDst);
            local.deleteOnExit(pathDst);

            libjars[i] = new URL(local.makeQualified(pathDst).toString());
          }
View Full Code Here

   
    Configuration conf = CachedConfiguration.getInstance();
    FileSystem fs;
    fs = FileSystem.get(conf);
   
    fs.copyToLocalFile(new Path("/accumulo-scale/conf/site.conf"), new Path(sitePath));
    fs.copyToLocalFile(new Path(String.format("/accumulo-scale/conf/%s.conf", testId)), new Path(testPath));
   
    // load configuration file properties
    Properties scaleProps = new Properties();
    Properties testProps = new Properties();
View Full Code Here

    Configuration conf = CachedConfiguration.getInstance();
    FileSystem fs;
    fs = FileSystem.get(conf);
   
    fs.copyToLocalFile(new Path("/accumulo-scale/conf/site.conf"), new Path(sitePath));
    fs.copyToLocalFile(new Path(String.format("/accumulo-scale/conf/%s.conf", testId)), new Path(testPath));
   
    // load configuration file properties
    Properties scaleProps = new Properties();
    Properties testProps = new Properties();
    try {
View Full Code Here

          if (isZip) {
            FileUtil.unzip(path, shardTmpFolder, fileSystem, System.getProperty("katta.spool.zip.shards", "false")
                    .equalsIgnoreCase("true"));
          } else {
            fileSystem.copyToLocalFile(path, new Path(shardTmpFolder.getAbsolutePath()));
          }
          shardTmpFolder.renameTo(localShardFolder);
        } finally {
          // Ensure that the tmp folder is deleted on an error
          FileUtil.deleteFolder(shardTmpFolder);
View Full Code Here

                for (String filename : filenames) {
                    Path src = new Path(filename);
                    Path dst = new Path(src.getName());
                    FileSystem fs = src.getFileSystem(conf);
                    System.err.println("templeton: copy " + src + " => " + dst);
                    fs.copyToLocalFile(src, dst);
                }
            }
        }

        @Override
View Full Code Here

      if ( ! resourceDir.exists() && ! resourceDir.mkdirs() ) {
        throw new RuntimeException("Couldn't create directory " + resourceDir);
      }
      try {
        FileSystem fs = FileSystem.get(new URI(value), conf);
        fs.copyToLocalFile(new Path(value), new Path(destinationFile.getCanonicalPath()));
        value = destinationFile.getCanonicalPath();
        if (convertToUnix && DosToUnix.isWindowsScript(destinationFile)) {
          try {
            DosToUnix.convertWindowsScriptToUnix(destinationFile);
          } catch (Exception e) {
View Full Code Here

   
    Configuration conf = CachedConfiguration.getInstance();
    FileSystem fs;
    fs = FileSystem.get(conf);
   
    fs.copyToLocalFile(new Path("/accumulo-scale/conf/site.conf"), new Path(sitePath));
    fs.copyToLocalFile(new Path(String.format("/accumulo-scale/conf/%s.conf", opts.testId)), new Path(testPath));
   
    // load configuration file properties
    Properties scaleProps = new Properties();
    Properties testProps = new Properties();
View Full Code Here

    Configuration conf = CachedConfiguration.getInstance();
    FileSystem fs;
    fs = FileSystem.get(conf);
   
    fs.copyToLocalFile(new Path("/accumulo-scale/conf/site.conf"), new Path(sitePath));
    fs.copyToLocalFile(new Path(String.format("/accumulo-scale/conf/%s.conf", opts.testId)), new Path(testPath));
   
    // load configuration file properties
    Properties scaleProps = new Properties();
    Properties testProps = new Properties();
    try {
View Full Code Here

      }
      FileSystem fs = path.getFileSystem(HBaseConfiguration.create());
      Path dst = new Path(System.getProperty("java.io.tmpdir") +
          java.io.File.separator +"." + pathPrefix +
          "." + className + "." + System.currentTimeMillis() + ".jar");
      fs.copyToLocalFile(path, dst);
      fs.deleteOnExit(dst);

      // TODO: code weaving goes here

      // TODO: wrap heap allocations and enforce maximum usage limits
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.