Package com.gpudb.filesystem.upload
Class FullFileDispatcher
- java.lang.Object
-
- com.gpudb.filesystem.upload.FullFileDispatcher
-
public class FullFileDispatcher 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 is used to handle batches of full file uploads using a thread pool of a certain configurable size. The default size for the thread pool is configured in the class GPUdbFileHandler.Options
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFullFileDispatcher.FullFileDownloadTaskThis class represents a task handling the download of a bunch of full file downloads.static classFullFileDispatcher.FullFileUploadTaskThis class represents a task handling the upload of a bunch of full file uploads.
-
Constructor Summary
Constructors Constructor Description FullFileDispatcher(GPUdbFileHandler.Options fileHandlerOptions, FileUploadListener callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollect()Wait for the tasks submitted to the thread pool and collect the resultsResultusing the futures accessed using thejobExecutorobject.voidsubmit(FullFileDispatcher.FullFileUploadTask task)Submit an instance ofFullFileDispatcher.FullFileUploadTaskto the internal thread pool.voidterminate()This method is called to terminate the thread pool once an instance of the classFullFileDispatcherhas done its job.
-
-
-
Constructor Detail
-
FullFileDispatcher
public FullFileDispatcher(GPUdbFileHandler.Options fileHandlerOptions, FileUploadListener callback)
-
-
Method Detail
-
submit
public void submit(FullFileDispatcher.FullFileUploadTask task)
Submit an instance ofFullFileDispatcher.FullFileUploadTaskto the internal thread pool.- Parameters:
task- aFullFileDispatcher.FullFileUploadTaskobject
-
collect
public void collect() throws GPUdbExceptionWait for the tasks submitted to the thread pool and collect the resultsResultusing the futures accessed using thejobExecutorobject.- Throws:
GPUdbException
-
terminate
public void terminate()
This method is called to terminate the thread pool once an instance of the classFullFileDispatcherhas done its job.
-
-