Avoid a very rare case, where we might get an "IllegalArgumentException" from "Lists.partition()", in case the "sizeOfUrlReports" is <= 3.
This commit is contained in:
parent
08de530f03
commit
bd323ad69a
|
@ -192,6 +192,8 @@ public class ParquetFileUtils {
|
|||
// In case the above method returns an error, nothing happens. We just have only the initial payloads to insert to the DB.
|
||||
|
||||
int sizeOfEachSubList = (int)(sizeOfUrlReports * 0.33); // We want 3 sub-lists for the payloads.
|
||||
if ( sizeOfEachSubList == 0 ) // If the "sizeOfUrlReports" is <= 3.
|
||||
sizeOfEachSubList = 1;
|
||||
// There may be 1 more with very few elements, due to non-persisted splitting. Unfortunately, we cannot st the number of splits, only the size of most splits.
|
||||
if ( sizeOfEachSubList > 10 ) {
|
||||
List<List<UrlReport>> finalSubLists = Lists.partition(urlReports, sizeOfEachSubList); // This needs the "sizeOfEachSubList" to be above < 0 >.
|
||||
|
|
Loading…
Reference in New Issue