Package org.apache.hadoop.fs

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


    Path newRegionDir = HRegion.getRegionDir(a.getBaseDir(), encodedName);
    if(fs.exists(newRegionDir)) {
      throw new IOException("Cannot merge; target file collision at " +
          newRegionDir);
    }
    fs.mkdirs(newRegionDir);

    LOG.info("starting merge of regions: " + a + " and " + b +
      " into new region " + newRegionInfo.toString() +
        " with start key <" + Bytes.toString(startKey) + "> and end key <" +
        Bytes.toString(endKey) + ">");
View Full Code Here


    // create job specific temporary directory in output path
    Path outputPath = conf.getOutputPath();
    if (outputPath != null) {
      Path tmpDir = new Path(outputPath, MRConstants.TEMP_DIR_NAME);
      FileSystem fileSys = tmpDir.getFileSystem(conf);
      if (!fileSys.mkdirs(tmpDir)) {
        LOG.error("Mkdirs failed to create " + tmpDir.toString());
      }
    }

    this.status = new JobStatus(status.getJobId(), 0.0f, 0.0f, JobStatus.RUNNING);
View Full Code Here

        FileSystem outputFs = null;
        Path tmpDir = null;
        if (outputPath != null) {
          tmpDir = new Path(outputPath, MRConstants.TEMP_DIR_NAME);
          outputFs = tmpDir.getFileSystem(job);
          if (!outputFs.mkdirs(tmpDir)) {
            LOG.error("Mkdirs failed to create " + tmpDir.toString());
          }
        }

        DataOutputBuffer buffer = new DataOutputBuffer();
View Full Code Here

                                    split);
          JobConf localConf = new JobConf(job);
          if (outputFs != null) {
            if (outputFs.exists(tmpDir)) {
              Path taskTmpDir = new Path(tmpDir, "_" + mapId);
              if (!outputFs.mkdirs(taskTmpDir)) {
                throw new IOException("Mkdirs failed to create "
                                       + taskTmpDir.toString());
              }
            } else {
              throw new IOException("The directory " + tmpDir.toString()
View Full Code Here

                                                 reduceId, 0, mapIds.size());
              JobConf localConf = new JobConf(job);
              if (outputFs != null) {
                if (outputFs.exists(tmpDir)) {
                  Path taskTmpDir = new Path(tmpDir, "_" + reduceId);
                  if (!outputFs.mkdirs(taskTmpDir)) {
                    throw new IOException("Mkdirs failed to create "
                                           + taskTmpDir.toString());
                  }
                } else {
                  throw new IOException("The directory " + tmpDir.toString()
View Full Code Here

  private static final KeyValue KV_D = new KeyValue(KEY_D, 0L);

  @Before
  public void setUp() throws Exception {
    FileSystem fs = TEST_UTIL.getTestFileSystem();
    if (!fs.mkdirs(CFDIR)) {
      throw new IOException("Cannot create test directory " + CFDIR);
    }
  }

  @After
View Full Code Here

        // might throw out an exception
        // we should clean up and then try again
        Path jobDir = localJobFile.getParent();
        if (localFs.exists(jobDir)){
          localFs.delete(jobDir);
          boolean b = localFs.mkdirs(jobDir);
          if (!b)
            throw new IOException("Not able to create job directory "
                                  + jobDir.toString());
        }
        fs.copyToLocalFile(new Path(jobFile), localJobFile);
View Full Code Here

    private void localizeTask(Task task) throws IOException{
      Path localTaskDir =
        new Path(this.defaultJobConf.getLocalPath(TaskTracker.getJobCacheSubdir()),
                 (task.getJobId() + Path.SEPARATOR + task.getTaskId()));
      FileSystem localFs = FileSystem.getLocal(fConf);
      if (!localFs.mkdirs(localTaskDir)) {
        throw new IOException("Mkdirs failed to create " + localTaskDir.toString());
      }
      Path localTaskFile = new Path(localTaskDir, "job.xml");
      task.setJobFile(localTaskFile.toString());
      localJobConf.set("mapred.local.dir",
View Full Code Here

    public void mkdirs(String folder) throws IOException {
        Path path = new Path(folder);
        FileSystem fs = FileSystem.get(URI.create(hdfsPath), conf);
        if (!fs.exists(path)) {
            fs.mkdirs(path);
            System.out.println("Create: " + folder);
        }
        fs.close();
    }
View Full Code Here

  public void testPushFailureAppAlreadyInstalled() throws Exception {
    String ID = "testPushFailureAppAlreadyInstalled";

    Path path = new Path(BASE + ID);
    FileSystem fs = path.getFileSystem(configuration);
    fs.mkdirs(path);

    YarnPushApplication app = new YarnPushApplication();
    app.applicationVersion(ID);
    app.applicationBaseDir(BASE);
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.