public class UploadIoJob extends Object
OpMode
i.e., UPLOAD . 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 threadpool 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.Modifier and Type | Method and Description |
---|---|
static org.apache.commons.lang3.tuple.Pair<String,UploadIoJob> |
createNewJob(GPUdb db,
GPUdbFileHandler.Options fileHandlerOptions,
OpMode opMode,
String dirName,
String fileName,
String remoteFileName,
UploadOptions uploadOptions,
FileUploadListener callback)
Factory method for creating a new IoJob instance.
|
String |
getJobId() |
ExecutorService |
getThreadPool() |
void |
start()
This method starts the job to upload the multipart file by submitting
different stages
MultiPartUploadInfo.MultiPartOperation
to indicate which stage is being executed. |
List<Result> |
stop()
This method is used to stop all the running threadpool and return the
result list.
|
public static org.apache.commons.lang3.tuple.Pair<String,UploadIoJob> createNewJob(GPUdb db, GPUdbFileHandler.Options fileHandlerOptions, OpMode opMode, String dirName, String fileName, String remoteFileName, UploadOptions uploadOptions, FileUploadListener callback) throws GPUdbException
db
- - the GPUdb
instancefileHandlerOptions
- - options to configure GPUdbFileHandler
opMode
- - OpMode
- Whether upload or downloaddirName
- - String - The KIFS directory namefileName
- - String - The fully qualified local file nameremoteFileName
- - Name of the KIFS fileuploadOptions
- - the UploadOptions
objectcallback
- - the FileUploadListener
objectPair
of String (Job id) and IoJob instancesGPUdbException
public String getJobId()
public ExecutorService getThreadPool()
public void start() throws GPUdbException
MultiPartUploadInfo.MultiPartOperation
to indicate which stage is being executed. Each stage is modeled as an
IoTask
which is an instance of Callable
and the
task instance is submitted to the handleUploadResult(IoTask)
member of the classGPUdbException
public List<Result> stop()
Result
,
CompletionService
,
- method terminateJobs().
Copyright © 2024. All rights reserved.