org.apache.hadoop.hbase.util
Class FSUtils

java.lang.Object
  extended by org.apache.hadoop.hbase.util.FSUtils

public class FSUtils
extends Object

Utility methods for interacting with the underlying file system.


Method Summary
static void checkFileSystemAvailable(org.apache.hadoop.fs.FileSystem fs)
          Checks to see if the specified file system is available
static void checkVersion(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir, boolean message)
          Verifies current version of file system
static String getPath(org.apache.hadoop.fs.Path p)
          Return the 'path' component of a Path.
static void setVersion(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir)
          Sets version of file system
static void validateRootPath(org.apache.hadoop.fs.Path root)
          Verifies root directory path is a valid URI with a scheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkFileSystemAvailable

public static void checkFileSystemAvailable(org.apache.hadoop.fs.FileSystem fs)
                                     throws IOException
Checks to see if the specified file system is available

Parameters:
fs -
Throws:
IOException

checkVersion

public static void checkVersion(org.apache.hadoop.fs.FileSystem fs,
                                org.apache.hadoop.fs.Path rootdir,
                                boolean message)
                         throws IOException
Verifies current version of file system

Parameters:
fs - file system
rootdir - root directory of HBase installation
message - if true, issues a message on System.out
Throws:
IOException

setVersion

public static void setVersion(org.apache.hadoop.fs.FileSystem fs,
                              org.apache.hadoop.fs.Path rootdir)
                       throws IOException
Sets version of file system

Parameters:
fs -
rootdir -
Throws:
IOException

validateRootPath

public static void validateRootPath(org.apache.hadoop.fs.Path root)
                             throws IOException
Verifies root directory path is a valid URI with a scheme

Parameters:
root - root directory path
Throws:
IOException - if not a valid URI with a scheme

getPath

public static String getPath(org.apache.hadoop.fs.Path p)
Return the 'path' component of a Path. In Hadoop, Path is an URI. This method returns the 'path' component of a Path's URI: e.g. If a Path is hdfs://example.org:9000/hbase_trunk/TestTable/compaction.dir, this method returns /hbase_trunk/TestTable/compaction.dir. This method is useful if you want to print out a Path without qualifying Filesystem instance.

Parameters:
p - Filesystem Path whose 'path' component we are to return.
Returns:
Path portion of the Filesystem


Copyright © 2008 The Apache Software Foundation