newIndexOffset = pair.right;
}
int blkIndex = getBlockIndex(blkLocations, splitStart + (splitSize / 2));
LOG.debug("split path: {}:{}:{}", path.getName(), splitStart, splitSize);
splits.add(new AegSplit(path, splitStart, splitSize, blkLocations[blkIndex].getHosts()));
indexOffset = newIndexOffset;
bytesRemaining -= splitSize;
splitStart += splitSize;
}
if (scanner != null) {
scanner.close();
}
}
if (bytesRemaining != 0) {
LOG.debug("end path: {}:{}:{}", path.getName(), length - bytesRemaining, bytesRemaining);
if (fs.exists(compressionPath)) {
splits.add(new AegCompressedSplit(path, length - bytesRemaining, bytesRemaining,
blkLocations[blkLocations.length - 1].getHosts(), compressionPath));
} else {
splits.add(new AegSplit(path, length - bytesRemaining, bytesRemaining,
blkLocations[blkLocations.length - 1].getHosts()));
}
}
} else {
LOG.info("skipping zero length file: {}", path.toString());