Tabnine Logo
UnderFileSystemUtils.mkdirIfNotExists
Code IndexAdd Tabnine to your IDE (free)

How to use
mkdirIfNotExists
method
in
alluxio.util.UnderFileSystemUtils

Best Java code snippets using alluxio.util.UnderFileSystemUtils.mkdirIfNotExists (Showing top 2 results out of 315)

origin: Alluxio/alluxio

/**
 * Sets up corresponding directories for tests.
 */
protected void setupTest() throws IOException {
 UnderFileSystem ufs = UnderFileSystem.Factory.createForRoot(ServerConfiguration.global());
 String underfsAddress = ServerConfiguration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);
 // Deletes the ufs dir for this test from to avoid permission problems
 UnderFileSystemUtils.deleteDirIfExists(ufs, underfsAddress);
 // Creates ufs dir. This must be called before starting UFS with UnderFileSystemCluster.create()
 UnderFileSystemUtils.mkdirIfNotExists(ufs, underfsAddress);
 // Creates storage dirs for worker
 int numLevel = ServerConfiguration.getInt(PropertyKey.WORKER_TIERED_STORE_LEVELS);
 for (int level = 0; level < numLevel; level++) {
  PropertyKey tierLevelDirPath =
    PropertyKey.Template.WORKER_TIERED_STORE_LEVEL_DIRS_PATH.format(level);
  String[] dirPaths = ServerConfiguration.get(tierLevelDirPath).split(",");
  for (String dirPath : dirPaths) {
   FileUtils.createDir(dirPath);
  }
 }
 // Formats the journal
 Format.format(Format.Mode.MASTER, ServerConfiguration.global());
}
origin: org.alluxio/alluxio-minicluster

/**
 * Sets up corresponding directories for tests.
 */
protected void setupTest() throws IOException {
 UnderFileSystem ufs = UnderFileSystem.Factory.createForRoot();
 String underfsAddress = Configuration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);
 // Deletes the ufs dir for this test from to avoid permission problems
 UnderFileSystemUtils.deleteDirIfExists(ufs, underfsAddress);
 // Creates ufs dir. This must be called before starting UFS with UnderFileSystemCluster.get().
 UnderFileSystemUtils.mkdirIfNotExists(ufs, underfsAddress);
 // Creates storage dirs for worker
 int numLevel = Configuration.getInt(PropertyKey.WORKER_TIERED_STORE_LEVELS);
 for (int level = 0; level < numLevel; level++) {
  PropertyKey tierLevelDirPath =
    PropertyKey.Template.WORKER_TIERED_STORE_LEVEL_DIRS_PATH.format(level);
  String[] dirPaths = Configuration.get(tierLevelDirPath).split(",");
  for (String dirPath : dirPaths) {
   FileUtils.createDir(dirPath);
  }
 }
 // Formats the journal
 Format.format(Format.Mode.MASTER);
}
alluxio.utilUnderFileSystemUtilsmkdirIfNotExists

Javadoc

Attempts to create the directory if it does not already exist.

Popular methods of UnderFileSystemUtils

  • getBucketName
  • approximateContentHash
    Returns an approximate content hash, using the length and modification time.
  • deleteFileIfExists
    Deletes the specified path from the specified under file system if it is a file and exists.
  • isHdfs
  • touch
    Creates an empty file.
  • deleteDirIfExists
    Deletes the directory at the given path if it exists.
  • isLocal

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JTable (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now