Examples of copyFromLocalFile()


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

                // DistributedCache
                if (shipToCluster) {
                    Path dst =
                        new Path(FileLocalizer.getTemporaryPath(pigContext).toString());
                    FileSystem fs = dst.getFileSystem(conf);
                    fs.copyFromLocalFile(src, dst);
                   
                    // Construct the dst#srcName uri for DistributedCache
                    URI dstURI = null;
                    try {
                        dstURI = new URI(dst.toString() + "#" + src.getName());
View Full Code Here

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

            if (outputSpecs != null) {
                for (int i=1; i < outputSpecs.size(); ++i) {
                    String fileName = outputSpecs.get(i).getName();
                    try {
                        int partition = job.getInt("mapred.task.partition", -1);
                        fs.copyFromLocalFile(false, true, new Path(fileName),
                                             new Path(
                                                     new Path(scriptOutputDir,
                                                              fileName),
                                                     getOutputName(partition))
                                            );
View Full Code Here

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

                    // DistributedCache
                    if (shipToCluster) {
                        Path dst =
                            new Path(FileLocalizer.getTemporaryPath(null, pigContext).toString());
                        FileSystem fs = dst.getFileSystem(conf);
                        fs.copyFromLocalFile(src, dst);
                       
                        // Construct the dst#srcName uri for DistributedCache
                        URI dstURI = null;
                        try {
                            dstURI = new URI(dst.toString() + "#" + src.getName());
View Full Code Here

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

    } else if (opts.action.equalsIgnoreCase("client")) {
      InetAddress addr = InetAddress.getLocalHost();
      String host = addr.getHostName();
      fs.createNewFile(new Path("/accumulo-scale/clients/" + host));
      test.client();
      fs.copyFromLocalFile(new Path("/tmp/scale.out"), new Path("/accumulo-scale/results/" + host));
    } else if (opts.action.equalsIgnoreCase("teardown")) {
      test.teardown();
    }
  }
 
View Full Code Here

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

    {
      //logger.debug("Adding " + jarFile + " to job class path");
      Path srcJarFilePath = new Path("file:///"+jarFile);
      String filename = srcJarFilePath.getName();
      Path tmpJarFilePath = makeTemporaryFile(jobConf, filename);     
      defFS.copyFromLocalFile(srcJarFilePath, tmpJarFilePath);
      DistributedCache.addFileToClassPath(tmpJarFilePath, jobConf);
    }
     DistributedCache.createSymlink(jobConf);
  }
View Full Code Here

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

          fileInfo.put(pathURI, new FileInfo(md5hash.toString(),
                md5hash.getFileLength(), 0));
        } else {
          // Otherwise we copy jar to JT's filesystem
          uploadJarPath = new Path(uploadFileDir, "job.jar");
          fs.copyFromLocalFile(originalJarPath, uploadJarPath);
        }
      } catch (URISyntaxException ue) {
        // should not throw an uri exception
        throw new IOException("Failed to create uri for " + originalJar);
      }
View Full Code Here

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

    } else if (action.equalsIgnoreCase("client")) {
      InetAddress addr = InetAddress.getLocalHost();
      String host = addr.getHostName();
      fs.createNewFile(new Path("/accumulo-scale/clients/" + host));
      test.client();
      fs.copyFromLocalFile(new Path("/tmp/scale.out"), new Path("/accumulo-scale/results/" + host));
    } else if (action.equalsIgnoreCase("teardown")) {
      test.teardown();
    }
  }
 
View Full Code Here

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

    Path inFile = new Path("file://" + localFile);
    Path outFile = new Path(hadoopConf.get("fs.default.name") + hdfsFile);

     // Read from and write to new file
    Environment.logInfo("Uploading to HDFS (file " + outFile + ") ...");
    fs.copyFromLocalFile(false, inFile, outFile);
  }

  /**
   * Close the temporary local file
   *
 
View Full Code Here

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

    for (int i = 0; i < tablepaths.length; i++) {
      Path localPath = new Path(tablepaths[i]);
      Path tablePath = new Path(rootDir, names[i]);
      fs.mkdirs(tablePath);
      Path dfsPath = new Path(tablePath, localPath.getName());
      fs.copyFromLocalFile(localPath, dfsPath);
      TableMeta meta = CatalogUtil.newTableMeta(schemas[i],
          CatalogProtos.StoreType.CSV, option);
      client.createExternalTable(names[i], tablePath, meta);
    }
View Full Code Here

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

                    FileStatus fstat = fs.getFileStatus(targetFile);
                    if (fstat.getLen() == file.length()) {
                        continue;
                    }
                }
                fs.copyFromLocalFile(false, true, new Path(file.getAbsolutePath()), targetFile);
                LOG.info("Copied " + file.getAbsolutePath() + " to " + targetFile.toString() + " in " + fs.getUri());
            }
        }
    }
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.