Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.Path.toUri()


      new File(scriptPath.toUri().getPath()).setExecutable(true);

      URI uri = scriptPath.toUri();
      DistributedCache.createSymlink(conf);
      DistributedCache.addCacheFile(uri, conf);
      conf.setMapDebugScript(scriptPath.toUri().getPath());

      RunningJob job = null;
      try {
        JobClient jc = new JobClient(conf);
        job = jc.submitJob(conf);
View Full Code Here


      url = getProxy().getJobHistoryLocationForRetiredJob(jobId);
    } else {
      url = info.getHistoryUrl();
    }
    Path p = new Path(url);
    if (p.toUri().getScheme().equals("file:/")) {
      FileStatus st = getFileStatus(url, true);
      Assert.assertNotNull("Job History file for " + jobId + " not present " +
          "when job is completed" , st);
    } else {
      FileStatus st = getFileStatus(url, false);
View Full Code Here

      if (fs.exists(TEST_DIR) && !fs.delete(TEST_DIR, true)) {
        fail("Cannot delete TEST_DIR!");
      }

      if (fs.mkdirs(new Path(TEST_DIR, parent))) {
        if (!(new File(parent.toUri().getPath()).setWritable(false, false))) {
          fail("Cannot chmod parent!");
        }
      } else {
        fail("Cannot create parent dir!");
      }
View Full Code Here

      mr = new MiniMRCluster(0, "file:///", 4, null, null, config);
      assertFalse(
          "CompletedJobStore is unexpectly active!",
          mr.getJobTrackerRunner().getJobTracker().completedJobStatusStore.isActive());
    } finally {
      new File(parent.toUri().getPath()).setWritable(true, false);
      if (mr != null) {
        mr.shutdown();
      }
    }
  }
View Full Code Here

            jobId.toString()), fConf);
    if (!localFs.mkdirs(workDir)) {
      throw new IOException("Mkdirs failed to create "
          + workDir.toString());
    }
    System.setProperty(JOB_LOCAL_DIR, workDir.toUri().getPath());
    localJobConf.set(JOB_LOCAL_DIR, workDir.toUri().getPath());

    // Download the job.jar for this job from the system FS
    localizeJobJarFile(userName, jobId, userFs, localJobConf);
View Full Code Here

    if (!localFs.mkdirs(workDir)) {
      throw new IOException("Mkdirs failed to create "
          + workDir.toString());
    }
    System.setProperty(JOB_LOCAL_DIR, workDir.toUri().getPath());
    localJobConf.set(JOB_LOCAL_DIR, workDir.toUri().getPath());

    // Download the job.jar for this job from the system FS
    localizeJobJarFile(userName, jobId, userFs, localJobConf);

    return localJobConf;
View Full Code Here

    Credentials ts =
      Credentials.readTokenStorageFile(localJobTokenFile, conf);

    if(LOG.isDebugEnabled()) {
      LOG.debug("Task: Loaded jobTokenFile from: "+
          localJobTokenFile.toUri().getPath()
        +"; num of sec keys  = " + ts.numberOfSecretKeys() +
        " Number of tokens " +
        ts.numberOfTokens());
    }
    return ts;
View Full Code Here

        // Set up the user-directory.
        if (fs.exists(userDir) || fs.mkdirs(userDir)) {

          // Set permissions on the user-directory
          PermissionsHandler.setPermissions(
              new File(userDir.toUri().getPath()),
              PermissionsHandler.sevenZeroZero);
          userDirStatus = true;

          // Set up the jobcache directory
          File jobCacheDir =
View Full Code Here

      }

      initJobDirStatus = initJobDirStatus || jobDirStatus;

      // job-dir has to be private to the TT
      Localizer.PermissionsHandler.setPermissions(new File(jobDir.toUri()
          .getPath()), Localizer.PermissionsHandler.sevenZeroZero);
    }

    if (!initJobDirStatus) {
      throw new IOException("Not able to initialize job directories "
View Full Code Here

       
       
        public static String parseThedate(Path base,Path p)
        {
          Path parent=p.getParent();
          while(!parent.toUri().equals(base.toUri())&&base.toUri().compareTo(parent.toUri())<=0)
          {
            String name=parseThedate(parent.getName());
            if(name!=null)
            {
              return name;
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.