Class UploadIoJob


  • public class UploadIoJob
    extends Object
    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 models an upload OpMode. Different instances of this class will be created for different operations and no instance of this class will be shared. This class handles only multi part upload. It uses a single threaded thread pool internally with an unbounded queue which is used to submit the background tasks modeled by an IoTask instance, since multi part upload has to be handled sequentially. An instance of this class is used to handle the upload of a single large file. If there are multiple large files to be uploaded each such file will be handled by a new instance of this class.
    • Method Detail

      • createNewJob

        public static org.apache.commons.lang3.tuple.Pair<String,​UploadIoJob> createNewJob​(GPUdb db,
                                                                                                 GPUdbFileHandler.Options fileHandlerOptions,
                                                                                                 String localFileName,
                                                                                                 String remoteFileName,
                                                                                                 UploadOptions uploadOptions,
                                                                                                 FileUploadListener callback)
                                                                                          throws GPUdbException
        Creates a new job for uploading a file.
        Parameters:
        db - The GPUdb instance used to access KiFS.
        fileHandlerOptions - Options for setting up the files for upload.
        localFileName - Fully-qualified name of the local file to upload.
        remoteFileName - Fully-qualified name of the uploaded KiFS file.
        uploadOptions - Options to use during the upload.
        callback - FileUploadListener that can trigger events at various stages of the upload process.
        Returns:
        Pair of upload job ID and management object
        Throws:
        GPUdbException
      • getJobId

        public String getJobId()
      • stop

        public List<Result> stop()
        This method is used to stop all the running IoTask instances.