Class IoTask

  • All Implemented Interfaces:
    Callable<Result>

    public class IoTask
    extends Object
    implements Callable<Result>
    This is an internal class and not meant to be used by the end users of the 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 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 - 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.
      • 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 - 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).