long targetSize = (long) (totalSize * nameToSamples.get(entry.getKey()).getPercent() / 100D);
int startIndex = nameToSamples.get(entry.getKey()).getSeedNum() % splitList.size();
long size = 0;
for (int i = 0; i < splitList.size(); i++) {
InputSplitShim split = splitList.get((startIndex + i) % splitList.size());
retLists.add(split);
long splitgLength = split.getLength();
if (size + splitgLength >= targetSize) {
LOG.info("Sample alias " + entry.getValue() + " using " + (i + 1) + "splits");
if (size + splitgLength > targetSize) {
split.shrinkSplit(targetSize - size);
}
break;
}
size += splitgLength;
}