Package org.apache.hadoop.fs

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


            }
        }

        for(String additional: additionalJars) {
            Path path = new Path(additional);
            depJars.add(path.makeQualified(localFs).toString());
        }

        String[] tmpjars = conf.get("tmpjars", "").split(",");
        for(String tmpjar: tmpjars) {
            if(!StringUtils.isEmpty(tmpjar)) {
View Full Code Here


    conf.setInt("mapred.job.reuse.jvm.num.tasks", -1);
   
    FileSystem fs = FileSystem.get(conf);
    Path hfileDir = new Path("/texaspete/ev/tmp", UUID.randomUUID().toString());
    hfileDir = hfileDir.makeQualified(fs);
    LOG.info("Hashes will be written temporarily to " + hfileDir);
   
    HFileOutputFormat.setOutputPath(job, hfileDir);

    final Path extp = new Path(extentsPath);
View Full Code Here

     * Deletes content of the repository files in the bucket
     */
    public void cleanRepositoryFiles(String basePath) throws IOException {
        LocalFileSystem fs = FileSystem.getLocal(new Configuration());
        Path p = new Path(path);
        fs.delete(p.makeQualified(fs), true);
    }
}
View Full Code Here

    List<StoreFile> outputStoreFiles = new ArrayList<StoreFile>(compactionOutputs.size());
    for (String compactionOutput : compactionOutputs) {
      //we should have this store file already
      boolean found = false;
      Path outputPath = new Path(fs.getStoreDir(family.getNameAsString()), compactionOutput);
      outputPath = outputPath.makeQualified(fs.getFileSystem());
      for (StoreFile sf : this.getStorefiles()) {
        if (sf.getPath().makeQualified(sf.getPath().getFileSystem(conf)).equals(outputPath)) {
          found = true;
          break;
        }
View Full Code Here

    }

    List<Path> inputPaths = new ArrayList<Path>(compactionInputs.size());
    for (String compactionInput : compactionInputs) {
      Path inputPath = new Path(fs.getStoreDir(family.getNameAsString()), compactionInput);
      inputPath = inputPath.makeQualified(fs.getFileSystem());
      inputPaths.add(inputPath);
    }

    //some of the input files might already be deleted
    List<StoreFile> inputStoreFiles = new ArrayList<StoreFile>(compactionInputs.size());
View Full Code Here

  private void testExportFileSystemState(final TableName tableName, final byte[] snapshotName,
      int filesExpected) throws Exception {
    Path copyDir = TEST_UTIL.getDataTestDir("export-" + System.currentTimeMillis());
    URI hdfsUri = FileSystem.get(TEST_UTIL.getConfiguration()).getUri();
    FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration());
    copyDir = copyDir.makeQualified(fs);

    // Export Snapshot
    int res = ExportSnapshot.innerMain(TEST_UTIL.getConfiguration(), new String[] {
      "-snapshot", Bytes.toString(snapshotName),
      "-copy-to", copyDir.toString()
View Full Code Here

   * @throws IOException e
   */
  public static Path getRootDir(final Configuration c) throws IOException {
    Path p = new Path(c.get(HConstants.HBASE_DIR));
    FileSystem fs = p.getFileSystem(c);
    return p.makeQualified(fs);
  }

  public static void setRootDir(final Configuration c, final Path root) throws IOException {
    c.set(HConstants.HBASE_DIR, root.toString());
  }
View Full Code Here

  private void runTest(String testName, BloomType bloomType,
          byte[][][] hfileRanges) throws Exception {
    Path dir = util.getDataTestDirOnTestFS(testName);
    FileSystem fs = util.getTestFileSystem();
    dir = dir.makeQualified(fs);
    Path familyDir = new Path(dir, Bytes.toString(FAMILY));

    int hfileIdx = 0;
    for (byte[][] range : hfileRanges) {
      byte[] from = range[0];
View Full Code Here

      new byte[][]{ Bytes.toBytes("ddd"), Bytes.toBytes("ooo") },
    };

    Path dir = util.getDataTestDirOnTestFS(testName);
    FileSystem fs = util.getTestFileSystem();
    dir = dir.makeQualified(fs);
    Path familyDir = new Path(dir, Bytes.toString(FAMILY));

    int hFileIdx = 0;
    for (byte[][] range : hFileRanges) {
      byte[] from = range[0];
View Full Code Here

      // Verify the policies are parsed correctly
      for (PolicyInfo p: cnode.getAllPolicies()) {
          if (p.getName().equals("policy1")) {
            Path srcPath = new Path("/user/dhruba/raidtest");
            assertTrue(p.getSrcPath().equals(
                srcPath.makeQualified(srcPath.getFileSystem(conf))));
          } else if (p.getName().equals("policy2")) {
            Path srcPath = new Path("/user/dhruba/raidtest2");
            assertTrue(p.getSrcPath().equals(
                srcPath.makeQualified(srcPath.getFileSystem(conf))));
          } else if (p.getName().equals("policy3")){
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.