|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.util.FSUtils
public class FSUtils
Utility methods for interacting with the underlying file system.
Nested Class Summary | |
---|---|
static class |
FSUtils.DirFilter
A PathFilter that returns directories. |
Method Summary | |
---|---|
org.apache.hadoop.fs.Path |
checkdir(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path dir)
Check if directory exists. |
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 org.apache.hadoop.fs.Path |
create(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path p)
Create file. |
static boolean |
deleteDirectory(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path dir)
Delete if exists. |
static String |
getPath(org.apache.hadoop.fs.Path p)
Return the 'path' component of a Path. |
static org.apache.hadoop.fs.Path |
getRootDir(HBaseConfiguration c)
|
static String |
getVersion(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootdir)
Verifies current version of file system |
static boolean |
isMajorCompacted(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path hbaseRootDir)
Runs through the hbase rootdir and checks all stores have only one file in them -- that is, they've been major compacted. |
static boolean |
isMajorCompactedPre020(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path hbaseRootDir)
Runs through the hbase rootdir and checks all stores have only one file in them -- that is, they've been major compacted. |
static boolean |
isPre020FileLayout(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path hbaseRootDir)
Expects to find -ROOT- directory. |
static boolean |
rootRegionExists(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootdir)
Checks if root region exists |
static void |
setVersion(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootdir)
Sets version of file system |
static void |
setVersion(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootdir,
String version)
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 |
static void |
waitOnSafeMode(HBaseConfiguration conf,
long wait)
If DFS, check safe mode and if so, wait until we clear it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean deleteDirectory(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path dir) throws IOException
fs
- dir
-
dir
IOException
public org.apache.hadoop.fs.Path checkdir(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path dir) throws IOException
fs
- dir
-
IOException
public static org.apache.hadoop.fs.Path create(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p) throws IOException
fs
- p
-
IOException
public static void checkFileSystemAvailable(org.apache.hadoop.fs.FileSystem fs) throws IOException
fs
-
IOException
public static void waitOnSafeMode(HBaseConfiguration conf, long wait) throws IOException
conf
- wait
- Sleep between retries
IOException
public static String getVersion(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir) throws IOException
fs
- rootdir
-
IOException
public static void checkVersion(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir, boolean message) throws IOException
fs
- file systemrootdir
- root directory of HBase installationmessage
- if true, issues a message on System.out
IOException
public static void setVersion(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir) throws IOException
fs
- rootdir
-
IOException
public static void setVersion(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir, String version) throws IOException
fs
- rootdir
- version
-
IOException
public static void validateRootPath(org.apache.hadoop.fs.Path root) throws IOException
root
- root directory path
IOException
- if not a valid URI with a schemepublic static String getPath(org.apache.hadoop.fs.Path p)
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.
p
- Filesystem Path whose 'path' component we are to return.
public static org.apache.hadoop.fs.Path getRootDir(HBaseConfiguration c) throws IOException
c
-
hbase.rootdir
as a
Path.
IOException
public static boolean rootRegionExists(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir) throws IOException
fs
- file systemrootdir
- root directory of HBase installation
IOException
public static boolean isMajorCompacted(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path hbaseRootDir) throws IOException
fs
- hbaseRootDir
-
IOException
public static boolean isPre020FileLayout(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path hbaseRootDir) throws IOException
fs
- hbaseRootDir
-
IOException
public static boolean isMajorCompactedPre020(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path hbaseRootDir) throws IOException
isMajorCompacted(FileSystem, Path)
in that it expects a
pre-0.20.0 hbase layout on the filesystem. Used migrating.
fs
- hbaseRootDir
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |