public class FullFileBatchManager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,org.apache.commons.lang3.tuple.Pair<String,Long>> |
fullFileNameToSizeMap
This variable is used to maintain a map of file names in the local
filesystem to the pair of values of target file name on the KIFS and
the file size on the local filesystem.
|
protected List<Map<String,String>> |
listOfFullFileNameToRemoteFileNameMap
This variable is used to store the maps in a list so that each map has
files whose sizes add up to a maximum of the value returned by the method
getFileSizeToSplit() of the class GPUdbFileHandler.Options.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(String localFileName,
String remoteFileName,
Long size)
Add the details for a file to be uploaded one shot
|
void |
clearBatches()
Resets the internal data structures maintained for the batches
|
List<String> |
getFullFileList()
Gets the entire list of local file names across all batches
|
Map<String,String> |
getNthBatch(int n)
Gets a particular batch of files which could be uploaded one shot using
a single call to the endpoint 'upload/files'.
|
int |
getNumberOfBatches()
Gets the number of batches of files which could be uploaded one shot
|
protected Map<String,org.apache.commons.lang3.tuple.Pair<String,Long>> fullFileNameToSizeMap
FileOperation.sortFilesIntoFullAndMultipartLists(List, List). This method,
after detecting a file to be a candidate for one shot upload will
insert an entry into this map. This map is further split up into a
list of maps and stored in the variable listOfFullFileNameToRemoteFileNameMap
by the method createBatchesByMaxSum().
The purpose of splitting the map into the list of maps is to arrive at
batches of full file uploads so that each batch has a cumulative
size whose limit is given by the method getFileSizeToSplit() of the class
GPUdbFileHandler.Options.protected List<Map<String,String>> listOfFullFileNameToRemoteFileNameMap
public void clearBatches()
public List<String> getFullFileList()
public void addFile(String localFileName, String remoteFileName, Long size)
localFileName - - Name of the file on the local filesystemremoteFileName - - Name of the file on KIFSsize - - The size of the file, needed to partition the batches onpublic int getNumberOfBatches()
public Map<String,String> getNthBatch(int n)
n - - the number of the batch to retrieveCopyright © 2024. All rights reserved.