Package org.apache.hadoop.fs

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


    // logs under server 2
    Path log2_1 = new Path(server2Dir, "me.hbase.com%2C56074%2C1348618509998.1348618515589");
    Path log2_2 = new Path(server2Dir, "me.hbase.com%2C56073%2C1348618509968.1234567890123");

    // create all the log files
    fs.createNewFile(log1_1);
    fs.createNewFile(log1_2);
    fs.createNewFile(log2_1);
    fs.createNewFile(log2_2);

    FSUtils.logFileSystemState(fs, testDir, LOG);
View Full Code Here


    Path log2_1 = new Path(server2Dir, "me.hbase.com%2C56074%2C1348618509998.1348618515589");
    Path log2_2 = new Path(server2Dir, "me.hbase.com%2C56073%2C1348618509968.1234567890123");

    // create all the log files
    fs.createNewFile(log1_1);
    fs.createNewFile(log1_2);
    fs.createNewFile(log2_1);
    fs.createNewFile(log2_2);

    FSUtils.logFileSystemState(fs, testDir, LOG);
    FSUtils.setRootDir(conf, testDir);
View Full Code Here

    Path log2_2 = new Path(server2Dir, "me.hbase.com%2C56073%2C1348618509968.1234567890123");

    // create all the log files
    fs.createNewFile(log1_1);
    fs.createNewFile(log1_2);
    fs.createNewFile(log2_1);
    fs.createNewFile(log2_2);

    FSUtils.logFileSystemState(fs, testDir, LOG);
    FSUtils.setRootDir(conf, testDir);
    SnapshotDescription snapshot = SnapshotDescription.newBuilder()
View Full Code Here

    // create all the log files
    fs.createNewFile(log1_1);
    fs.createNewFile(log1_2);
    fs.createNewFile(log2_1);
    fs.createNewFile(log2_2);

    FSUtils.logFileSystemState(fs, testDir, LOG);
    FSUtils.setRootDir(conf, testDir);
    SnapshotDescription snapshot = SnapshotDescription.newBuilder()
        .setName("testWALReferenceSnapshot").build();
View Full Code Here

      byte[] data = new byte[] { 1, 2, 3, 4 };
      out.write(data);
      out.close();
      // make an empty file
      Path empty = new Path(edits, "empty");
      fs.createNewFile(empty);

      CopyRecoveredEditsTask task = new CopyRecoveredEditsTask(snapshot, monitor, fs, regionDir,
          snapshotRegionDir);
      CopyRecoveredEditsTask taskSpy = Mockito.spy(task);
      taskSpy.call();
View Full Code Here

    Path family2 = new Path(regionDir, "fam2");
    fs.mkdirs(family2);

    // add some files to family 1
    Path file1 = new Path(family1, "05f99689ae254693836613d1884c6b63");
    fs.createNewFile(file1);
    Path file2 = new Path(family1, "7ac9898bf41d445aa0003e3d699d5d26");
    fs.createNewFile(file2);

    // create the snapshot directory
    Path snapshotRegionDir = new Path(testdir, HConstants.SNAPSHOT_DIR_NAME);
View Full Code Here

    // add some files to family 1
    Path file1 = new Path(family1, "05f99689ae254693836613d1884c6b63");
    fs.createNewFile(file1);
    Path file2 = new Path(family1, "7ac9898bf41d445aa0003e3d699d5d26");
    fs.createNewFile(file2);

    // create the snapshot directory
    Path snapshotRegionDir = new Path(testdir, HConstants.SNAPSHOT_DIR_NAME);
    fs.mkdirs(snapshotRegionDir);
View Full Code Here

    // make sure the reference file exists
    fs.create(refFile);

    // create the hfile in the archive
    fs.mkdirs(archivedHfileDir);
    fs.createNewFile(new Path(archivedHfileDir, hfile));

    // make sure that the file isn't deletable
    assertFalse(cleaner.isFileDeletable(new Path(hfile)));
  }
}
View Full Code Here

      files.add(entry);
    }
    log.debug("tid " + tid + " importing " + files.size() + " files");

    Path writable = new Path(this.errorDir, ".iswritable");
    if (!fs.createNewFile(writable)) {
      // Maybe this is a re-try... clear the flag and try again
      fs.delete(writable, false);
      if (!fs.createNewFile(writable))
        throw new ThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY,
            "Unable to write to " + this.errorDir);
View Full Code Here

    Path writable = new Path(this.errorDir, ".iswritable");
    if (!fs.createNewFile(writable)) {
      // Maybe this is a re-try... clear the flag and try again
      fs.delete(writable, false);
      if (!fs.createNewFile(writable))
        throw new ThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY,
            "Unable to write to " + this.errorDir);
    }
    fs.delete(writable, false);
   
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.