Beispiel #1
0
  /**
   * Creates a new local alluxio master with a isolated home and port.
   *
   * @throws IOException when unable to do file operation or listen on port
   * @return an instance of Alluxio master
   */
  public static LocalAlluxioMaster create() throws IOException {
    final String alluxioHome = uniquePath();
    UnderFileSystemUtils.deleteDir(alluxioHome);
    UnderFileSystemUtils.mkdirIfNotExists(alluxioHome);

    // Update Alluxio home in the passed Alluxio configuration instance.
    Configuration.set(Constants.HOME, alluxioHome);

    return new LocalAlluxioMaster();
  }
Beispiel #2
0
  /**
   * Creates a new local alluxio master with a isolated port.
   *
   * @param alluxioHome Alluxio home directory, if the directory already exists, this method will
   *     reuse any directory/file if possible, no deletion will be made
   * @return an instance of Alluxio master
   * @throws IOException when unable to do file operation or listen on port
   */
  public static LocalAlluxioMaster create(final String alluxioHome) throws IOException {
    UnderFileSystemUtils.mkdirIfNotExists(alluxioHome);

    return new LocalAlluxioMaster();
  }