Package org.apache.hadoop.fs

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


   
    Properties config = new Properties();
    config.setProperty("mapred.job.tracker.persist.jobstatus.active", "true");
    config.setProperty("mapred.job.tracker.persist.jobstatus.hours", "1");
    config.setProperty("mapred.job.tracker.persist.jobstatus.dir",
                       fs.makeQualified(TEST_DIR).toString());
    stopCluster();
    startCluster(false, config);
    JobID jobId = runJob();
    JobClient jc = new JobClient(createJobConf());
    RunningJob rj = jc.getJob(jobId);
View Full Code Here


        } catch (Throwable th) {
          // IGNORED because we are cleaning up
        }
      }
    }
    return fileSys.makeQualified(localFilename);
  }

}
View Full Code Here

    // Check the output specification
    job.getOutputFormat().checkOutputSpecs(fs, job);

    // Create the splits for the job
    LOG.debug("Creating splits at " + fs.makeQualified(submitSplitFile));
    InputSplit[] splits =
      job.getInputFormat().getSplits(job, job.getNumMapTasks());
    // sort the splits into order based on size, so that the biggest
    // go first
    Arrays.sort(splits, new Comparator<InputSplit>() {
View Full Code Here

    for (Path p: dirs) {
      FileSystem fs = p.getFileSystem(job);
      Path[] matches =
        fs.listPaths(fs.globPaths(p, hiddenFileFilter), hiddenFileFilter);
      for (Path match: matches) {
        result.add(fs.makeQualified(match));
      }
    }

    return result.toArray(new Path[result.size()]);
  }
View Full Code Here

    {
      FileSystem localfs = FileSystem.getLocal(jobConf);
      String TEST_ROOT_DIR =
        new File(System.getProperty("test.build.data","/tmp"))
        .toString().replace(' ', '+');
      Path localIn = localfs.makeQualified
                        (new Path(TEST_ROOT_DIR + "/local/in"));
      Path localOut = localfs.makeQualified
                        (new Path(TEST_ROOT_DIR + "/local/out"));
      result = launchWordCount(jobConf, localIn, localOut,
                               "all your base belong to us", 1, 1);
View Full Code Here

      String TEST_ROOT_DIR =
        new File(System.getProperty("test.build.data","/tmp"))
        .toString().replace(' ', '+');
      Path localIn = localfs.makeQualified
                        (new Path(TEST_ROOT_DIR + "/local/in"));
      Path localOut = localfs.makeQualified
                        (new Path(TEST_ROOT_DIR + "/local/out"));
      result = launchWordCount(jobConf, localIn, localOut,
                               "all your base belong to us", 1, 1);
      assertEquals("all\t1\nbase\t1\nbelong\t1\nto\t1\nus\t1\nyour\t1\n",
                   result.output);
View Full Code Here

        // ignore
      }

      LOG.info("Starting upgrade" + (readOnly ? " check" : ""));

      Path rootdir = fs.makeQualified(new Path(           // get HBase root dir
          conf.get(HConstants.HBASE_DIR, HConstants.DEFAULT_HBASE_DIR)));

      if (!fs.exists(rootdir)) {
        throw new FileNotFoundException("HBase root directory " +
            rootdir.toString() + " does not exist.");
View Full Code Here

  public void testGetClosest() throws Exception {
    // Write a mapfile of simple data: keys are
    Path dirName = new Path(System.getProperty("test.build.data",".") +
      getName() + ".mapfile");
    FileSystem fs = FileSystem.getLocal(conf);
    Path qualifiedDirName = fs.makeQualified(dirName);
    MapFile.Writer writer = new MapFile.Writer(conf, fs,
      qualifiedDirName.toString(), Text.class, Text.class);
    // Make an index entry for each insertion.
    writer.setIndexInterval(1);
    // Add entries up to 100 in intervals of ten.
View Full Code Here

      // Set the hbase.rootdir to be the home directory in mini dfs.
      this.conf.set(HConstants.HBASE_DIR, new Path(
        dfsCluster.getFileSystem().getHomeDirectory(), "hbase").toString());
      FileSystem dfs = dfsCluster.getFileSystem();
      Path rootDir =
        dfs.makeQualified(new Path(conf.get(HConstants.HBASE_DIR)));
      dfs.mkdirs(rootDir);
      loadTestData(dfs, rootDir);
      listPaths(dfs, rootDir, rootDir.toString().length() + 1);
     
      Migrate u = new Migrate(conf);
View Full Code Here

   * @throws IOException
   */
  public static Path getRootDir(final HBaseConfiguration c) throws IOException {
    FileSystem fs = FileSystem.get(c);
    // Get root directory of HBase installation
    Path rootdir = fs.makeQualified(new Path(c.get(HConstants.HBASE_DIR)));
    if (!fs.exists(rootdir)) {
      String message = "HBase root directory " + rootdir.toString() +
        " does not exist.";
      LOG.error(message);
      throw new FileNotFoundException(message);
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.