@ThreadSafe public final class RetryHandlingFileSystemMasterClient extends AbstractMasterClient implements FileSystemMasterClient
AbstractClient.RpcCallable<V>
FileSystemMasterClient.Factory
mChannel, mClosed, mConnected, mContext, mServerAddress, mServiceVersion, mVersionService
Constructor and Description |
---|
RetryHandlingFileSystemMasterClient(MasterClientContext conf)
Creates a new
RetryHandlingFileSystemMasterClient instance. |
Modifier and Type | Method and Description |
---|---|
protected void |
afterConnect()
This method is called after the connection is made to the remote.
|
void |
checkAccess(AlluxioURI path,
CheckAccessPOptions options)
Check access to a path.
|
List<AlluxioURI> |
checkConsistency(AlluxioURI path,
CheckConsistencyPOptions options)
Checks the consistency of Alluxio metadata against the under storage for all files and
directories in a given subtree.
|
void |
completeFile(AlluxioURI path,
CompleteFilePOptions options)
Marks a file as completed.
|
void |
createDirectory(AlluxioURI path,
CreateDirectoryPOptions options)
Creates a new directory.
|
URIStatus |
createFile(AlluxioURI path,
CreateFilePOptions options)
Creates a new file.
|
void |
delete(AlluxioURI path,
DeletePOptions options)
Deletes a file or a directory.
|
boolean |
exists(AlluxioURI path,
ExistsPOptions options)
Checks whether a file or directory exists.
|
void |
free(AlluxioURI path,
FreePOptions options)
Frees a file.
|
String |
getFilePath(long fileId) |
String |
getLoadProgress(AlluxioURI path,
Optional<LoadProgressReportFormat> format,
boolean verbose)
Get progress of a load job.
|
Map<String,MountPointInfo> |
getMountTable(boolean checkUfs)
Lists all mount points and their corresponding under storage addresses.
|
long |
getNewBlockIdForFile(AlluxioURI path) |
protected ServiceType |
getRemoteServiceType() |
protected String |
getServiceName() |
protected long |
getServiceVersion() |
List<String> |
getStateLockHolders() |
URIStatus |
getStatus(AlluxioURI path,
GetStatusPOptions options) |
List<SyncPointInfo> |
getSyncPathList()
get the list of paths that are currently being actively synced.
|
void |
iterateStatus(AlluxioURI path,
ListStatusPOptions options,
java.util.function.Consumer<? super URIStatus> action)
Performs a specific action on each
URIStatus in the result of FileSystemMasterClient.listStatus(alluxio.AlluxioURI, alluxio.grpc.ListStatusPOptions) . |
List<URIStatus> |
listStatus(AlluxioURI path,
ListStatusPOptions options) |
ListStatusPartialResult |
listStatusPartial(AlluxioURI path,
ListStatusPartialPOptions options) |
void |
mount(AlluxioURI alluxioPath,
AlluxioURI ufsPath,
MountPOptions options)
Mounts the given UFS path under the given Alluxio path.
|
void |
needsSync(AlluxioURI path)
Mark a path as needed synchronization with the UFS, when this path or any
of its children are accessed, a sync with the UFS will be performed.
|
void |
rename(AlluxioURI src,
AlluxioURI dst)
Renames a file or a directory.
|
void |
rename(AlluxioURI src,
AlluxioURI dst,
RenamePOptions options)
Renames a file or a directory.
|
AlluxioURI |
reverseResolve(AlluxioURI ufsUri)
Reverse resolve a ufs uri.
|
void |
scheduleAsyncPersist(AlluxioURI path,
ScheduleAsyncPersistencePOptions options)
Schedules the async persistence of the given file.
|
void |
setAcl(AlluxioURI path,
SetAclAction action,
List<AclEntry> entries,
SetAclPOptions options)
Sets the ACL for a path.
|
void |
setAttribute(AlluxioURI path,
SetAttributePOptions options)
Sets the file or directory attributes.
|
void |
startSync(AlluxioURI path)
Start the active syncing process for a specified path.
|
boolean |
stopLoad(AlluxioURI path)
Stop a directory load.
|
void |
stopSync(AlluxioURI path)
Stop the active syncing process for a specified path.
|
boolean |
submitLoad(AlluxioURI path,
OptionalLong bandwidth,
boolean usePartialListing,
boolean verify)
Submit a directory load job.
|
void |
unmount(AlluxioURI alluxioPath)
Unmounts the given Alluxio path.
|
void |
updateMount(AlluxioURI alluxioPath,
MountPOptions options)
Updates options of a mount point for the given Alluxio path.
|
void |
updateUfsMode(AlluxioURI ufsUri,
UpdateUfsModePOptions options)
Updates the operation mode for the given ufs path.
|
afterDisconnect, beforeConnect, getConfAddress, queryGrpcServerAddress
beforeDisconnect, checkVersion, close, connect, connectWithRuntimeException, disconnect, getRemoteHostName, getRemoteServiceVersion, getRemoteSockAddress, isClosed, isConnected, retryRPC, retryRPC
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMountTable
connect, disconnect, getConfAddress, getRemoteHostName, getRemoteSockAddress, isClosed, isConnected
public RetryHandlingFileSystemMasterClient(MasterClientContext conf)
RetryHandlingFileSystemMasterClient
instance.conf
- master client configurationprotected ServiceType getRemoteServiceType()
getRemoteServiceType
in class AbstractClient
protected String getServiceName()
getServiceName
in class AbstractClient
protected long getServiceVersion()
getServiceVersion
in class AbstractClient
protected void afterConnect()
AbstractClient
afterConnect
in class AbstractClient
public void checkAccess(AlluxioURI path, CheckAccessPOptions options) throws AlluxioStatusException
FileSystemMasterClient
checkAccess
in interface FileSystemMasterClient
path
- the path to checkoptions
- method optionsAlluxioStatusException
public List<AlluxioURI> checkConsistency(AlluxioURI path, CheckConsistencyPOptions options) throws AlluxioStatusException
FileSystemMasterClient
checkConsistency
in interface FileSystemMasterClient
path
- the root of the subtree to checkoptions
- method optionsAlluxioStatusException
public void createDirectory(AlluxioURI path, CreateDirectoryPOptions options) throws AlluxioStatusException
FileSystemMasterClient
createDirectory
in interface FileSystemMasterClient
path
- the directory pathoptions
- method optionsAlreadyExistsException
- if the directory already existsAlluxioStatusException
public URIStatus createFile(AlluxioURI path, CreateFilePOptions options) throws AlluxioStatusException
FileSystemMasterClient
createFile
in interface FileSystemMasterClient
path
- the file pathoptions
- method optionsAlreadyExistsException
- if the file already existsAlluxioStatusException
public void completeFile(AlluxioURI path, CompleteFilePOptions options) throws AlluxioStatusException
FileSystemMasterClient
completeFile
in interface FileSystemMasterClient
path
- the file pathoptions
- the method optionsAlluxioStatusException
public void delete(AlluxioURI path, DeletePOptions options) throws AlluxioStatusException
FileSystemMasterClient
delete
in interface FileSystemMasterClient
path
- the path to deleteoptions
- method optionsAlluxioStatusException
public boolean exists(AlluxioURI path, ExistsPOptions options) throws AlluxioStatusException
FileSystemMasterClient
exists
in interface FileSystemMasterClient
path
- the file path to check existenceoptions
- the method optionsAlluxioStatusException
public void free(AlluxioURI path, FreePOptions options) throws AlluxioStatusException
FileSystemMasterClient
free
in interface FileSystemMasterClient
path
- the path to freeoptions
- method optionsNotFoundException
- if the path does not existAlluxioStatusException
public String getFilePath(long fileId) throws AlluxioStatusException
getFilePath
in interface FileSystemMasterClient
fileId
- a file idAlluxioStatusException
public URIStatus getStatus(AlluxioURI path, GetStatusPOptions options) throws AlluxioStatusException
getStatus
in interface FileSystemMasterClient
path
- the file pathoptions
- the getStatus optionsNotFoundException
- if the path does not existAlluxioStatusException
public List<SyncPointInfo> getSyncPathList() throws AlluxioStatusException
FileSystemMasterClient
getSyncPathList
in interface FileSystemMasterClient
AlluxioStatusException
public long getNewBlockIdForFile(AlluxioURI path) throws AlluxioStatusException
getNewBlockIdForFile
in interface FileSystemMasterClient
path
- the file pathAlluxioStatusException
public Map<String,MountPointInfo> getMountTable(boolean checkUfs) throws AlluxioStatusException
FileSystemMasterClient
getMountTable
in interface FileSystemMasterClient
checkUfs
- whether to get UFS usage infoMountPointInfo
AlluxioStatusException
public void iterateStatus(AlluxioURI path, ListStatusPOptions options, java.util.function.Consumer<? super URIStatus> action) throws AlluxioStatusException
FileSystemMasterClient
URIStatus
in the result of FileSystemMasterClient.listStatus(alluxio.AlluxioURI, alluxio.grpc.ListStatusPOptions)
.
This method is preferred when iterating over directories with a large number of files or
sub-directories inside. The caller can proceed with partial result without waiting for all
result returned.iterateStatus
in interface FileSystemMasterClient
path
- the path to list information aboutoptions
- options to associate with this operationaction
- action to apply on each URIStatus
NotFoundException
- if the path does not existAlluxioStatusException
public List<URIStatus> listStatus(AlluxioURI path, ListStatusPOptions options) throws AlluxioStatusException
listStatus
in interface FileSystemMasterClient
path
- the path to listoptions
- the listStatus optionsNotFoundException
- if the path does not existAlluxioStatusException
public ListStatusPartialResult listStatusPartial(AlluxioURI path, ListStatusPartialPOptions options) throws AlluxioStatusException
listStatusPartial
in interface FileSystemMasterClient
path
- the path to listoptions
- the listStatus partial optionsNotFoundException
- if the path does not existAlluxioStatusException
public void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, MountPOptions options) throws AlluxioStatusException
FileSystemMasterClient
mount
in interface FileSystemMasterClient
alluxioPath
- the Alluxio pathufsPath
- the UFS pathoptions
- mount optionsAlluxioStatusException
public void updateMount(AlluxioURI alluxioPath, MountPOptions options) throws AlluxioStatusException
FileSystemMasterClient
updateMount
in interface FileSystemMasterClient
alluxioPath
- the Alluxio pathoptions
- mount optionsAlluxioStatusException
public void rename(AlluxioURI src, AlluxioURI dst) throws AlluxioStatusException
FileSystemMasterClient
rename
in interface FileSystemMasterClient
src
- the path to renamedst
- new file pathNotFoundException
- if the path does not existAlluxioStatusException
public void rename(AlluxioURI src, AlluxioURI dst, RenamePOptions options) throws AlluxioStatusException
FileSystemMasterClient
rename
in interface FileSystemMasterClient
src
- the path to renamedst
- new file pathoptions
- rename optionsNotFoundException
- if the path does not existAlluxioStatusException
public AlluxioURI reverseResolve(AlluxioURI ufsUri) throws AlluxioStatusException
FileSystemMasterClient
reverseResolve
in interface FileSystemMasterClient
ufsUri
- the ufs uriAlluxioStatusException
public void setAcl(AlluxioURI path, SetAclAction action, List<AclEntry> entries, SetAclPOptions options) throws AlluxioStatusException
FileSystemMasterClient
setAcl
in interface FileSystemMasterClient
path
- the file or directory pathaction
- the set action to performentries
- the ACL entries to useoptions
- the options for setting ACLNotFoundException
- if the path does not existAlluxioStatusException
public void setAttribute(AlluxioURI path, SetAttributePOptions options) throws AlluxioStatusException
FileSystemMasterClient
setAttribute
in interface FileSystemMasterClient
path
- the file or directory pathoptions
- the file or directory attribute options to be setNotFoundException
- if the path does not existAlluxioStatusException
public void scheduleAsyncPersist(AlluxioURI path, ScheduleAsyncPersistencePOptions options) throws AlluxioStatusException
FileSystemMasterClient
scheduleAsyncPersist
in interface FileSystemMasterClient
path
- the file pathoptions
- options to use when scheduling the persistAlluxioStatusException
public void startSync(AlluxioURI path) throws AlluxioStatusException
FileSystemMasterClient
startSync
in interface FileSystemMasterClient
path
- the file or directory to be syncedAlluxioStatusException
public void stopSync(AlluxioURI path) throws AlluxioStatusException
FileSystemMasterClient
stopSync
in interface FileSystemMasterClient
path
- the file or directory to stop syncingAlluxioStatusException
public void unmount(AlluxioURI alluxioPath) throws AlluxioStatusException
FileSystemMasterClient
unmount
in interface FileSystemMasterClient
alluxioPath
- the Alluxio pathAlluxioStatusException
public void updateUfsMode(AlluxioURI ufsUri, UpdateUfsModePOptions options) throws AlluxioStatusException
FileSystemMasterClient
updateUfsMode
in interface FileSystemMasterClient
ufsUri
- the ufs pathoptions
- the options to update ufs operation modeAlluxioStatusException
public List<String> getStateLockHolders() throws AlluxioStatusException
getStateLockHolders
in interface FileSystemMasterClient
AlluxioStatusException
public void needsSync(AlluxioURI path) throws AlluxioStatusException
FileSystemMasterClient
needsSync
in interface FileSystemMasterClient
path
- the path to invalidateAlluxioStatusException
public boolean submitLoad(AlluxioURI path, OptionalLong bandwidth, boolean usePartialListing, boolean verify)
FileSystemMasterClient
submitLoad
in interface FileSystemMasterClient
path
- alluxio path to be loadedbandwidth
- bandwidth allocated to this load, unlimited if emptyusePartialListing
- whether to use partial listingverify
- whether to verify after load finishespublic boolean stopLoad(AlluxioURI path)
FileSystemMasterClient
stopLoad
in interface FileSystemMasterClient
path
- alluxio path to be stoppedpublic String getLoadProgress(AlluxioURI path, Optional<LoadProgressReportFormat> format, boolean verbose)
FileSystemMasterClient
getLoadProgress
in interface FileSystemMasterClient
path
- alluxio path to get progressformat
- progress report formatverbose
- whether to return verbose reportCopyright © 2023. All Rights Reserved.