public class IoTask extends Object implements Callable<Result>
filesystem
API. The consequences of using this class directly in
client code is not guaranteed and maybe undesirable.
This class is only used for multi-part upload and download and an instance
of this class is created only by FileUploader
and FileDownloader
classes.
This class models a single background tasks running in a thread.
It implements the Callable
interface and the overridden
call()
method is the one that executes the main logic in this
class. Depending on the value of the instance variable opMode
it
calls either the upload()
or the download()
method.Constructor and Description |
---|
IoTask(GPUdb db,
String fileName,
MultiPartDownloadInfo multiPartDownloadInfo,
DownloadOptions options)
Constructs a task for downloading a part of a multi-part download.
|
IoTask(GPUdb db,
String fileName,
MultiPartUploadInfo multiPartUploadInfo,
UploadOptions options,
long taskNumber,
ByteBuffer dataBytes)
Constructs a task for uploading a part of a multi-part upload.
|
Modifier and Type | Method and Description |
---|---|
Result |
call()
This method is called automatically the thread in which the current
instance of this class runs.
|
MultiPartDownloadInfo |
getMultiPartDownloadInfo() |
MultiPartUploadInfo |
getMultiPartUploadInfo() |
public IoTask(GPUdb db, String fileName, MultiPartUploadInfo multiPartUploadInfo, UploadOptions options, long taskNumber, ByteBuffer dataBytes)
db
- The GPUdb
instance used to access KiFS.fileName
- Name of the file to be uploaded.multiPartUploadInfo
- Configuration information about this part of
the upload as well as the overall upload itself.options
- Options to use during the upload.taskNumber
- Sequence number of this part of the overall upload.dataBytes
- Data to upload for this part, in a binary format.public IoTask(GPUdb db, String fileName, MultiPartDownloadInfo multiPartDownloadInfo, DownloadOptions options)
db
- The GPUdb
instance used to access KiFS.fileName
- Name of the file to be downloaded.multiPartDownloadInfo
- Configuration information about this part
of the download as well as the overall download itself.options
- Options to use during the download (reserved for
future use).public Result call()
public MultiPartUploadInfo getMultiPartUploadInfo()
public MultiPartDownloadInfo getMultiPartDownloadInfo()
Copyright © 2025. All rights reserved.