Examples of copyToLocalFile()


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

          if (!b)
            throw new IOException("Not able to create job directory "
                                  + jobDir.toString());
        }
        FileSystem fs =FileSystem.getNamed(jobClient.getFilesystemName(),fConf);
        fs.copyToLocalFile(new Path(jobFile), localJobFile);
        JobConf localJobConf = new JobConf(localJobFile);
       
        // create the 'work' directory
        File workDir = new File(new File(localJobFile.toString()).getParent(),
                                "work");
View Full Code Here

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

       
        // unjar the job.jar files in workdir
        String jarFile = localJobConf.getJar();
        if (jarFile != null) {
          localJarFile = new Path(jobDir,"job.jar");
          fs.copyToLocalFile(new Path(jarFile), localJarFile);
          localJobConf.setJar(localJarFile.toString());
          OutputStream out = localFs.create(localJobFile);
          try {
            localJobConf.write(out);
          } finally {
View Full Code Here

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

                                                      +"/"+jobid + ".xml");
    this.localJarFile = default_job_conf.getLocalPath(JobTracker.SUBDIR
                                                      +"/"+ jobid + ".jar");
    FileSystem fs = FileSystem.get(default_conf);
    Path jobFile = new Path(default_conf.getSystemDir(), jobid + "/job.xml");
    fs.copyToLocalFile(jobFile, localJobFile);
    conf = new JobConf(localJobFile);
    this.priority = conf.getJobPriority();
    this.profile = new JobProfile(conf.getUser(), jobid,
                                  jobFile.toString(), url, conf.getJobName());
    String jarFile = conf.getJar();
View Full Code Here

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

    this.priority = conf.getJobPriority();
    this.profile = new JobProfile(conf.getUser(), jobid,
                                  jobFile.toString(), url, conf.getJobName());
    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

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

    }

    public void download(String remote, String local) throws IOException {
        Path path = new Path(remote);
        FileSystem fs = FileSystem.get(URI.create(hdfsPath), conf);
        fs.copyToLocalFile(path, new Path(local));
        System.out.println("download: from" + remote + " to " + local);
        fs.close();
    }

    public String cat(String remoteFile) throws IOException {
View Full Code Here

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

                    targetDirectory));
        }
        for (FileStatus status : list) {
            Path p = status.getPath();
            try {
                fs.copyToLocalFile(p, new Path(new File(targetDirectory, p.getName()).toURI()));
            } catch (IOException e) {
                throw new IOException(MessageFormat.format(
                        "Failed to fs -get: source={0}, destination={1}",
                        p,
                        targetDirectory), e);
View Full Code Here

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

      }
      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

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

    try {
      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 = new FileDataModel(tempDataFile);
      String usersFilePathString = jobConf.get(USERS_FILE);
      if (usersFilePathString == null) {
        usersToRecommendFor = null;
      } else {
View Full Code Here

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

    }

    FileSystem fs = path.getFileSystem(conf);
    File dst = new File(parentDir, "." + pathPrefix + "."
      + path.getName() + "." + System.currentTimeMillis() + ".jar");
    fs.copyToLocalFile(path, new Path(dst.toString()));
    dst.deleteOnExit();

    addURL(dst.getCanonicalFile().toURI().toURL());

    JarFile jarFile = new JarFile(dst.toString());
View Full Code Here

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

    this.localJobFile = default_job_conf.getLocalPath(JobTracker.SUBDIR
                                                      +"/"+jobid + ".xml");
    this.localJarFile = default_job_conf.getLocalPath(JobTracker.SUBDIR
                                                      +"/"+ jobid + ".jar");
    FileSystem fs = FileSystem.get(default_conf);
    fs.copyToLocalFile(new Path(jobFile), localJobFile);
    conf = new JobConf(localJobFile);
    this.profile = new JobProfile(conf.getUser(), jobid, jobFile, url,
                                  conf.getJobName());
    String jarFile = conf.getJar();
    if (jarFile != null) {
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.