Package org.apache.hadoop.util
Class DiskChecker
java.lang.Object
org.apache.hadoop.util.DiskChecker
Class that provides utility functions for checking disk problem
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCreate the directory if it doesn't exist and check that dir is readable, writable and executablestatic voidcheckDir(LocalFileSystem localFS, Path dir, FsPermission expected) Create the local directory if necessary, check permissions and also ensure it can be read from and written into.static voidcheckDirWithDiskIo(File dir) Create the directory if it doesn't exist and check that dir is readable, writable and executable.static voidcheckDirWithDiskIo(LocalFileSystem localFS, Path dir, FsPermission expected) Create the local directory if necessary, also ensure permissions allow it to be read from and written into.
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
DiskChecker
public DiskChecker()
-
-
Method Details
-
checkDir
Create the directory if it doesn't exist and check that dir is readable, writable and executable- Parameters:
dir- dir.- Throws:
DiskChecker.DiskErrorException- disk problem.
-
checkDirWithDiskIo
Create the directory if it doesn't exist and check that dir is readable, writable and executable. Perform some disk IO to ensure that the disk is usable for writes.- Parameters:
dir- dir.- Throws:
DiskChecker.DiskErrorException- disk problem.
-
checkDir
public static void checkDir(LocalFileSystem localFS, Path dir, FsPermission expected) throws DiskChecker.DiskErrorException, IOException Create the local directory if necessary, check permissions and also ensure it can be read from and written into.- Parameters:
localFS- local filesystemdir- directoryexpected- permission- Throws:
DiskChecker.DiskErrorException- disk problem.IOException- raised on errors performing I/O.
-
checkDirWithDiskIo
public static void checkDirWithDiskIo(LocalFileSystem localFS, Path dir, FsPermission expected) throws DiskChecker.DiskErrorException, IOException Create the local directory if necessary, also ensure permissions allow it to be read from and written into. Perform some diskIO to ensure that the disk is usable for writes.- Parameters:
localFS- local filesystemdir- directoryexpected- permission- Throws:
DiskChecker.DiskErrorException- disk problem.IOException- raised on errors performing I/O.
-