Package alluxio.worker.dora
Interface DoraWorker
-
- All Superinterfaces:
DataWorker
,Server<WorkerNetAddress>
,SessionCleanable
,Worker
public interface DoraWorker extends DataWorker, SessionCleanable
A block worker in the Alluxio system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.google.common.util.concurrent.ListenableFuture<java.util.List<alluxio.grpc.RouteFailure>>
copy(java.util.List<alluxio.grpc.Route> routes, alluxio.grpc.UfsReadOptions readOptions, alluxio.grpc.WriteOptions writeOptions)
Copies files from src to dst.BlockReader
createFileReader(java.lang.String fileId, long offset, boolean positionShort, alluxio.proto.dataserver.Protocol.OpenUfsBlockOptions options)
Creates the file reader to read from Alluxio dora.FileInfo
getFileInfo(java.lang.String fileId, alluxio.grpc.GetStatusPOptions options)
Gets the file information.boolean
invalidateCachedFile(FileInfo fileInfo)
Invalidate all cached pages of this file.UfsStatus[]
listStatus(java.lang.String path, alluxio.grpc.ListStatusPOptions options)
List status from Under File System.com.google.common.util.concurrent.ListenableFuture<java.util.List<alluxio.grpc.FileFailure>>
load(java.util.List<alluxio.grpc.File> files, alluxio.grpc.UfsReadOptions options)
Loads files from UFS to Alluxio.-
Methods inherited from interface alluxio.worker.DataWorker
getWorkerId
-
Methods inherited from interface alluxio.Server
close, getDependencies, getName, getServices, start, stop
-
Methods inherited from interface alluxio.worker.SessionCleanable
cleanupSession
-
-
-
-
Method Detail
-
getFileInfo
FileInfo getFileInfo(java.lang.String fileId, alluxio.grpc.GetStatusPOptions options) throws java.io.IOException, AccessControlException
Gets the file information.- Parameters:
fileId
- the file idoptions
- the options for the GetStatusPRequest- Returns:
- the file info
- Throws:
java.io.IOException
AccessControlException
-
listStatus
@Nullable UfsStatus[] listStatus(java.lang.String path, alluxio.grpc.ListStatusPOptions options) throws java.io.IOException, AccessControlException
List status from Under File System. Please refer to UnderFileSystem.listStatus().- Parameters:
path
- the path of a dir or fileoptions
- the option for listStatus()- Returns:
- An array with the statuses of the files and directories in the directory denoted by
this abstract pathname. The array will be empty if the directory is empty. Returns
null
if this abstract pathname does not denote a directory. - Throws:
java.io.IOException
AccessControlException
-
invalidateCachedFile
boolean invalidateCachedFile(FileInfo fileInfo)
Invalidate all cached pages of this file.- Parameters:
fileInfo
- the FileInfo of this file. Cached pages are identified by PageId and PageId is generated from fileInfo.fullUfsPath.- Returns:
- successful or not
-
createFileReader
BlockReader createFileReader(java.lang.String fileId, long offset, boolean positionShort, alluxio.proto.dataserver.Protocol.OpenUfsBlockOptions options) throws java.io.IOException, AccessControlException
Creates the file reader to read from Alluxio dora. Owner of this block reader must close it or lock will leak.- Parameters:
fileId
- the ID of the UFS fileoffset
- the offset within the blockpositionShort
- whether the operation is using positioned read to a small buffer sizeoptions
- the options- Returns:
- a block reader to read data from
- Throws:
java.io.IOException
- if it fails to get block readerAccessControlException
-
load
com.google.common.util.concurrent.ListenableFuture<java.util.List<alluxio.grpc.FileFailure>> load(java.util.List<alluxio.grpc.File> files, alluxio.grpc.UfsReadOptions options)
Loads files from UFS to Alluxio.- Parameters:
files
- the files to loadoptions
-- Returns:
- a list of failed files
-
copy
com.google.common.util.concurrent.ListenableFuture<java.util.List<alluxio.grpc.RouteFailure>> copy(java.util.List<alluxio.grpc.Route> routes, alluxio.grpc.UfsReadOptions readOptions, alluxio.grpc.WriteOptions writeOptions)
Copies files from src to dst.- Parameters:
routes
- the files to copyreadOptions
- the options for readingwriteOptions
- the options for writing- Returns:
- a list of failed files
-
-