}
int maxSampleSize = 1000;
synchronized (_stops) {
_stops.add(stop);
}
IndexWarmup indexWarmup = new IndexWarmup(isClosed, stop, maxSampleSize, _warmupBandwidthThrottleBytesPerSec);
String context = table.getName() + "/" + shard;
Map<String, List<IndexTracerResult>> sampleIndex = indexWarmup.sampleIndex(reader, context);
Iterable<String> preCacheCols = table.getPreCacheCols();
if (preCacheCols == null) {
// All fields.
preCacheCols = getFields(reader);
}
boolean _oldWay = false;
if (_oldWay) {
warm(reader, preCacheCols, indexWarmup, sampleIndex, context, isClosed, pauseWarmup);
} else {
int blockSize = 8192;// @TODO
int bufferSize = 1024 * 1024;// @TODO
Map<String, OpenBitSet> filePartsToWarm = new HashMap<String, OpenBitSet>();
for (String fieldName : preCacheCols) {
indexWarmup.getFilePositionsToWarm(reader, sampleIndex, fieldName, context, filePartsToWarm, blockSize);
}
indexWarmup.warmFile(reader, filePartsToWarm, context, blockSize, bufferSize);
}
} finally {
synchronized (_stops) {
_stops.remove(stop);