Package org.apache.hadoop.fs

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


      throw new IOException("Resource " + sCopy +
          " changed on src filesystem (expected " + resource.getTimestamp() +
          ", was " + sStat.getModificationTime());
    }

    sourceFs.copyToLocalFile(sCopy, dCopy);
    return dCopy;
  }

  private long unpack(File localrsrc, File dst, Pattern pattern) throws IOException {
    switch (resource.getType()) {
View Full Code Here


    this.localJarFile = default_job_conf.getLocalPath(JobTracker.SUBDIR
                                                      +"/"+ jobid + ".jar");
    Path jobDir = jobtracker.getSystemDirectoryForJob(jobId);
    FileSystem fs = jobDir.getFileSystem(default_conf);
    jobFile = new Path(jobDir, "job.xml");
    fs.copyToLocalFile(jobFile, localJobFile);
    conf = new JobConf(localJobFile);
    this.priority = conf.getJobPriority();
    this.status.setJobPriority(this.priority);
    this.profile = new JobProfile(conf.getUser(), jobid,
                                  jobFile.toString(), url, conf.getJobName(),
View Full Code Here

    this.profile = new JobProfile(conf.getUser(), jobid,
                                  jobFile.toString(), url, conf.getJobName(),
                                  conf.getQueueName());
    String jarFile = conf.getJar();
    if (jarFile != null) {
      fs.copyToLocalFile(new Path(jarFile), localJarFile);
      conf.setJar(localJarFile.toString());
    }

    this.numMapTasks = conf.getNumMapTasks();
    this.numReduceTasks = conf.getNumReduceTasks();
View Full Code Here

    FileDataModel fileDataModel;
    try {
      FileSystem fs = FileSystem.get(jobConf);
      File tempDataFile = File.createTempFile("mahout-taste-hadoop", "txt");
      tempDataFile.deleteOnExit();
      fs.copyToLocalFile(new Path(dataModelFile), new Path(tempDataFile.getAbsolutePath()));
      fileDataModel = new FileDataModel(tempDataFile);
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
    try {
View Full Code Here

      throws IOException {
    FileSystem fs = FileSystem.get(uri, conf);
    Path cwd = new Path(System.getenv(Environment.PWD.name()));
    Path dFile = new Path(cwd, destName);
    Path srcPath = new Path(uri);
    fs.copyToLocalFile(srcPath, dFile);
    return dFile.makeQualified(FileSystem.getLocal(conf).getUri(), cwd);
  }

  public static byte[] getLocalSha(Path path, Configuration conf) throws IOException {
    InputStream is = null;
View Full Code Here

            " is not publicly accessable and as such cannot be part of the" +
            " public cache.");
      }
    }
   
    sourceFs.copyToLocalFile(sCopy, dCopy);
    return dCopy;
  }

  private long unpack(File localrsrc, File dst, Pattern pattern) throws IOException {
    switch (resource.getType()) {
View Full Code Here

    this.localJarFile = master.getLocalPath(BSPMaster.SUBDIR + "/" + jobId
        + ".jar");

    Path jobDir = master.getSystemDirectoryForJob(jobId);
    FileSystem fs = jobDir.getFileSystem(conf);
    fs.copyToLocalFile(jobFile, localJobFile);
    BSPJob job = new BSPJob(jobId, localJobFile.toString());
    this.numBSPTasks = job.getNumBspTask();

    this.profile = new JobProfile(job.getUser(), jobId, jobFile.toString(),
        job.getJobName());
View Full Code Here

    status.setUsername(job.getUser());
    status.setStartTime(startTime);

    String jarFile = job.getJar();
    if (jarFile != null) {
      fs.copyToLocalFile(new Path(jarFile), localJarFile);
    }

  }

  public JobProfile getProfile() {
View Full Code Here

            } else {
                // fetch from remote:
                File dest = new File(localTempDir, filename);
                dest.deleteOnExit();
                try {
                    srcFs.copyToLocalFile(file.getPath(), new Path(dest.getAbsolutePath()));
                } catch (IOException e) {
                    throw new ExecException("Could not copy " + filePath + " to local destination " + dest, 101, PigException.INPUT, e);
                }
                fetchFiles[idx++] = new FetchFileRet(dest, true);
            }
View Full Code Here

    String recommenderClassName = jobConf.get(RECOMMENDER_CLASS_NAME);
    Path dataModelPath = new Path(dataModelFile);
    FileSystem fs = FileSystem.get(dataModelPath.toUri(), jobConf);
    File tempDataFile = File.createTempFile("mahout-taste-hadoop", "txt");
    tempDataFile.deleteOnExit();
    fs.copyToLocalFile(dataModelPath, new Path(tempDataFile.getAbsolutePath()));
    FileDataModel fileDataModel = new FileDataModel(tempDataFile);

    try {
      Class<? extends Recommender> recommenderClass = Class.forName(recommenderClassName).asSubclass(
        Recommender.class);
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.