@ThreadSafe public final class AlluxioFuseUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
AlluxioFuseUtils.FuseCallable
An interface representing a callable for FUSE APIs.
|
Modifier and Type | Method and Description |
---|---|
static int |
call(org.slf4j.Logger logger,
AlluxioFuseUtils.FuseCallable callable,
String methodName,
String description,
Object... args)
Calls the given
AlluxioFuseUtils.FuseCallable and returns its result. |
static int |
getErrorCode(Throwable t)
Gets the corresponding error code of a throwable.
|
static long |
getGid(String userName)
Retrieves the primary gid of the given user.
|
static long |
getGidFromGroupName(String groupName)
Retrieves the gid of the given group.
|
static String |
getGroupName(long gid)
Gets the group name from the group id.
|
static String |
getGroupName(String userName)
Gets the primary group name from the user name.
|
static long |
getUid(String userName)
Retrieves the uid of the given user.
|
static String |
getUserName(long uid)
Gets the user name from the user id.
|
static boolean |
isFuseInstalled()
Checks whether fuse is installed in local file system.
|
static boolean |
waitForFileCompleted(FileSystem fileSystem,
AlluxioURI uri)
Waits for the file to complete.
|
public static long getUid(String userName)
userName
- the user namepublic static long getGid(String userName)
userName
- the user namepublic static long getGidFromGroupName(String groupName)
groupName
- the group namepublic static String getUserName(long uid) throws IOException
uid
- user idIOException
public static String getGroupName(String userName) throws IOException
userName
- the user nameIOException
public static String getGroupName(long gid) throws IOException
gid
- the group idIOException
public static boolean isFuseInstalled()
public static int getErrorCode(Throwable t)
t
- throwablepublic static boolean waitForFileCompleted(FileSystem fileSystem, AlluxioURI uri)
fileSystem
- the file system to get file statusuri
- the file path to checkpublic static int call(org.slf4j.Logger logger, AlluxioFuseUtils.FuseCallable callable, String methodName, String description, Object... args)
AlluxioFuseUtils.FuseCallable
and returns its result.logger
- the logger to use for this callcallable
- the callable to callmethodName
- the name of the method, used for metricsdescription
- the format string of the description, used for loggingargs
- the arguments for the descriptionCopyright © 2023. All Rights Reserved.