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

How to use
deleteDirIfExists
method
in
alluxio.util.UnderFileSystemUtils

Best Java code snippets using alluxio.util.UnderFileSystemUtils.deleteDirIfExists (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.utilUnderFileSystemUtilsdeleteDirIfExists

Javadoc

Deletes the directory at the given path if it exists.

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.
  • isLocal
  • mkdirIfNotExists
    Attempts to create the directory if it does not already exist.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JButton (javax.swing)
  • Top Sublime Text plugins
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