Package org.apache.hadoop.fs

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


    b.mark("disk_loaded");

    FlumeConfiguration conf = FlumeConfiguration.get();
    Path path = new Path("hdfs://localhost/testfile");
    FileSystem hdfs = path.getFileSystem(conf);
    hdfs.deleteOnExit(path);

    Writer w = SequenceFile.createWriter(hdfs, conf, path,
        WriteableEventKey.class, WriteableEvent.class);
    b.mark("hdfs_fileopen_started");
View Full Code Here


      dataTestDirOnTestFS = new Path(dataTestDir.getAbsolutePath());
    } else {
      Path base = getBaseTestDirOnTestFS();
      String randomStr = UUID.randomUUID().toString();
      dataTestDirOnTestFS = new Path(base, randomStr);
      if (deleteOnExit()) fs.deleteOnExit(dataTestDirOnTestFS);
    }
  }

  /**
   * Cleans the test data directory on the test filesystem.
View Full Code Here

      stm3.close();

      // set delete on exit flag on files.
      fs.deleteOnExit(file1);
      fs.deleteOnExit(file2);
      localfs.deleteOnExit(file3);

      // close the file system. This should make the above files
      // disappear.
      fs.close();
      localfs.close();
View Full Code Here

      stm3.close();

      // set delete on exit flag on files.
      fs.deleteOnExit(file1);
      fs.deleteOnExit(file2);
      localfs.deleteOnExit(file3);

      // close the file system. This should make the above files
      // disappear.
      fs.close();
      localfs.close();
View Full Code Here

      db.setName(TEST_DB1_NAME);
      dbLocation =
          HiveConf.getVar(hiveConf, HiveConf.ConfVars.METASTOREWAREHOUSE) + "/_testDB_file_";
      fs = FileSystem.get(new Path(dbLocation).toUri(), hiveConf);
      fs.createNewFile(new Path(dbLocation));
      fs.deleteOnExit(new Path(dbLocation));
      db.setLocationUri(dbLocation);

      createFailed = false;
      try {
        client.createDatabase(db);
View Full Code Here

        while (sequenceFileReader.next(key, value)) {
          sequenceFileWriter.append(key, value);
        }

        if (deleteSource) {
          fs.deleteOnExit(fileStatus.getPath());
        }
      }
    } finally {
      IOUtils.closeStream(sequenceFileReader);
      IOUtils.closeStream(sequenceFileWriter);
View Full Code Here

      fs.rename(new Path(mergePath.toString() + Path.SEPARATOR + "part-00000"), outputPath);

      if (deleteSource) {
        for (FileStatus fileStatus : fs.globStatus(inputPath)) {
          fs.deleteOnExit(fileStatus.getPath());
        }
      }
    } finally {
      fs.delete(mergePath, true);
    }
View Full Code Here

        FileSystem fs = FileSystem.get(new Configuration());

        // Create the temporary directory.
        Path tmpDir = new Path("dendrite/tmp/" + UUID.randomUUID() + "/");
        fs.mkdirs(tmpDir);
        fs.deleteOnExit(tmpDir);

        try {
            FaunusGraph faunusExportGraph = new FaunusGraph();
            faunusPipelineService.configureGraph(faunusExportGraph, new Path(tmpDir, "export"), graph);
View Full Code Here

    //HBaseTestingUtility.getDataTestDirOnTestFs() has not been backported.
    FileSystem fs = FileSystem.get(getConf());
    Path base = new Path(fs.getWorkingDirectory(), "test-data");
    String randomStr = UUID.randomUUID().toString();
    Path testDir = new Path(base, randomStr);
    fs.deleteOnExit(testDir);

    return new Path(new Path(testDir, testName), subdir);
  }

  private IntegrationTestingUtility getTestingUtil() {
View Full Code Here

      dataTestDirOnTestFS = new Path(dataTestDir.getAbsolutePath());
    } else {
      Path base = getBaseTestDirOnTestFS();
      String randomStr = UUID.randomUUID().toString();
      dataTestDirOnTestFS = new Path(base, randomStr);
      if (deleteOnExit()) fs.deleteOnExit(dataTestDirOnTestFS);
    }
  }

  /**
   * Cleans the test data directory on the test filesystem.
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.