@ThreadSafe public final class FileSystemShellUtils extends Object
FileSystemShell
.Modifier and Type | Method and Description |
---|---|
static List<AlluxioURI> |
getAlluxioURIs(FileSystem alluxioClient,
AlluxioURI inputURI)
Gets all the
AlluxioURI s that match inputURI. |
static String |
getFilePath(String path)
Removes
Constants.HEADER / Constants.HEADER_FT and hostname:port information
from a path, leaving only the local file path. |
static List<File> |
getFiles(String inputPath)
Gets the files (on the local filesystem) that match the given input path.
|
static long |
getMs(String time)
Converts the input time into millisecond unit.
|
static Map<String,Command> |
loadCommands(FileSystem fileSystem)
Gets all
Command instances in the same package as FileSystemShell and load them
into a map. |
static boolean |
match(String filePath,
String patternPath)
Returns whether or not filePath matches patternPath.
|
static String |
validatePath(String path)
Validates the path, verifying that it contains the
Constants.HEADER or
Constants.HEADER_FT and a hostname:port specified. |
public static String getFilePath(String path) throws IOException
Constants.HEADER
/ Constants.HEADER_FT
and hostname:port information
from a path, leaving only the local file path.path
- the path to obtain the local path fromIOException
public static String validatePath(String path) throws IOException
Constants.HEADER
or
Constants.HEADER_FT
and a hostname:port specified.path
- the path to be verifiedIOException
public static List<AlluxioURI> getAlluxioURIs(FileSystem alluxioClient, AlluxioURI inputURI) throws IOException
AlluxioURI
s that match inputURI. If the path is a regular path, the
returned list only contains the corresponding URI; Else if the path contains wildcards, the
returned list contains all the matched URIs It supports any number of wildcards in inputURIalluxioClient
- the client used to fetch information of Alluxio filesinputURI
- the input URI (could contain wildcards)AlluxioURI
s that matches the inputURIIOException
public static List<File> getFiles(String inputPath)
inputPath
- The input file path (could contain wildcards)public static Map<String,Command> loadCommands(FileSystem fileSystem)
Command
instances in the same package as FileSystemShell
and load them
into a map. Provides a way to gain these commands information by their CommandName.fileSystem
- the FileSystem
instance to construct the commandpublic static long getMs(String time)
time
- the time to be converted into millisecondsCopyright © 2023. All Rights Reserved.