public class FullFileBatchManager extends Object
filesystem
API. The consequences of using this class directly in
client code is not guaranteed and maybe undesirable.
This class manages the task of creating batches of files where the files
are candidates for one-shot uploads.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
file system to the pair of values of target file name on the KIFS and
the file size on the local file system.
|
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
|
void |
createBatches()
Creates batches of files which could be uploaded one shot.
|
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 createBatches()
.
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 void createBatches()
public void addFile(String localFileName, String remoteFileName, Long size)
localFileName
- Name of the file on the local file system.remoteFileName
- Name of the file on KIFS.size
- The size of the file, needed to partition the batches on.public int getNumberOfBatches()
public Map<String,String> getNthBatch(int n)
n
- The index of the batch to retrieve.Copyright © 2025. All rights reserved.