Examples of copyToLocalFile()


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

    conf = new JobConf(localJobFile);
    this.profile = new JobProfile(conf.getUser(), jobid, jobFile, 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()

            dest.deleteOnExit();
            try {
                Configuration configuration = new Configuration();
                ConfigurationUtil.mergeConf(configuration, ConfigurationUtil.toConfiguration(properties));
                FileSystem srcFs = FileSystem.get(fileUri, configuration);
                srcFs.copyToLocalFile(src, new Path(dest.getAbsolutePath()));
            } catch (IOException e) {
                throw new ExecException("Could not copy " + filePath + " to local destination " + dest, 101, PigException.INPUT, e);
            }
            return new FetchFileRet(dest, true);
        }
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()

      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

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

          if(dstFs.delete(targetPath, true) || !dstFs.exists(targetPath)) {
            console.printInfo(mesg, mesg_detail);
            // if source exists, rename. Otherwise, create a empty directory
            if (fs.exists(sourcePath))
              fs.copyToLocalFile(sourcePath, targetPath);
            else
              dstFs.mkdirs(targetPath);
          } else {
            console.printInfo("Unable to delete the existing destination directory: " + targetPath);
          }
View Full Code Here

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

        }
    }

    private void setupMainConfiguration() throws IOException {
        FileSystem fs = FileSystem.get(getJobConf());
        fs.copyToLocalFile(new Path(getJobConf().get(OOZIE_ACTION_DIR_PATH), ACTION_CONF_XML), new Path(new File(
                ACTION_CONF_XML).getAbsolutePath()));

        System.setProperty("oozie.launcher.job.id", getJobConf().get("mapred.job.id"));
        System.setProperty("oozie.job.id", getJobConf().get(OOZIE_JOB_ID));
        System.setProperty("oozie.action.id", getJobConf().get(OOZIE_ACTION_ID));
View Full Code Here

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

      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

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

        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

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

      if (dstFs.delete(targetPath, true) || !dstFs.exists(targetPath)) {
        console.printInfo(mesg, mesg_detail);
        // if source exists, rename. Otherwise, create a empty directory
        if (fs.exists(sourcePath)) {
          fs.copyToLocalFile(sourcePath, targetPath);
        } else {
          if (!dstFs.mkdirs(targetPath)) {
            throw new HiveException("Unable to make local directory: "
                + targetPath);
          }
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.