Package com.gpudb.filesystem.download
Class DownloadIoJob
- java.lang.Object
-
- com.gpudb.filesystem.download.DownloadIoJob
-
public class DownloadIoJob extends Object
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 models a downloadOpMode. Different instances of this class will be created for different operations and no instance of this class will be shared.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.commons.lang3.tuple.Pair<String,DownloadIoJob>createNewJob(GPUdb db, GPUdbFileHandler.Options fileHandlerOptions, String remoteFileName, String localFileName, KifsFileInfo kifsFileInfo, DownloadOptions downloadOptions, FileDownloadListener callback)Creates a new job for downloading a file.StringgetDownloadFileName()StringgetDownloadLocalFileName()StringgetJobId()ExecutorServicegetThreadPool()voidstart()Starts the job to download the multipart file by submitting different segments of the file for download in an independent thread.List<Result>stop()This method is used to stop all the runningIoTaskinstances.
-
-
-
Method Detail
-
getDownloadFileName
public String getDownloadFileName()
-
getDownloadLocalFileName
public String getDownloadLocalFileName()
-
createNewJob
public static org.apache.commons.lang3.tuple.Pair<String,DownloadIoJob> createNewJob(GPUdb db, GPUdbFileHandler.Options fileHandlerOptions, String remoteFileName, String localFileName, KifsFileInfo kifsFileInfo, DownloadOptions downloadOptions, FileDownloadListener callback) throws GPUdbException
Creates a new job for downloading a file.- Parameters:
db- TheGPUdbinstance used to access KiFS.fileHandlerOptions- Options for setting up the files for download.remoteFileName- Name of the KIFS file to be downloadedlocalFileName- Fully-qualified name of the downloaded local file.kifsFileInfo- aKifsFileInfoobjectdownloadOptions- options to use during the download.callback- aFileDownloadListenerthat can trigger events at various stages of the download process.- Throws:
GPUdbException
-
getJobId
public String getJobId()
-
getThreadPool
public ExecutorService getThreadPool()
-
start
public void start() throws GPUdbExceptionStarts the job to download the multipart file by submitting different segments of the file for download in an independent thread.- Throws:
GPUdbException
-
-