Package com.gpudb.filesystem.common
Class IoTask
- java.lang.Object
-
- com.gpudb.filesystem.common.IoTask
-
public class IoTask extends Object implements Callable<Result>
This is an internal class and not meant to be used by the end users of thefilesystemAPI. 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 byFileUploaderandFileDownloaderclasses. This class models a single background tasks running in a thread. It implements theCallableinterface and the overriddencall()method is the one that executes the main logic in this class. Depending on the value of the instance variableopModeit calls either theupload()or thedownload()method.
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resultcall()Executes this upload/download task by a threaded service.MultiPartDownloadInfogetMultiPartDownloadInfo()MultiPartUploadInfogetMultiPartUploadInfo()
-
-
-
Constructor Detail
-
IoTask
public 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.- Parameters:
db- TheGPUdbinstance 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.
-
IoTask
public IoTask(GPUdb db, String fileName, MultiPartDownloadInfo multiPartDownloadInfo, DownloadOptions options)
Constructs a task for downloading a part of a multi-part download.- Parameters:
db- TheGPUdbinstance 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).
-
-
Method Detail
-
call
public Result call()
Executes this upload/download task by a threaded service.
-
getMultiPartUploadInfo
public MultiPartUploadInfo getMultiPartUploadInfo()
-
getMultiPartDownloadInfo
public MultiPartDownloadInfo getMultiPartDownloadInfo()
-
-