int scanned = 0, zipf = 0;
long base = 0L;
long mills1 = System.currentTimeMillis();
long ops = 0L;
final MutableLong miss = new MutableLong(0L);
int iocontention = 0;
final int start = thrdnum * round;
final int limit = start + round - 1;
for(int nth = start, i = 0; !_stop; nth = (nth < limit) ? nth + 1 : start, i++) {
final long key;
if(scanning || scanLength != 0 && (i == scanLength && rand.nextDouble() < percent)) {
if(++scanCount <= scanLength) {
if(!scanning) {
base = dist[nth];
}
key = base + scanCount;
scanning = true;
scanned++;
} else {
key = dist[nth];
scanCount = 0;
scanning = false;
i = 0;
zipf++;
}
} else {
key = dist[nth];
zipf++;
}
ICacheEntry<Long, byte[]> entry = cache.fixEntryLazySync2(pager, key, key, miss);
// application logic here.
entry.unpin();
ops++;
}
long mills2 = System.currentTimeMillis();
stat.mills = mills2 - mills1;
stat.ops = ops;
stat.miss = miss.getValue();
stat.iocontention = iocontention;
if(showstdout) {
System.out.println("[" + Thread.currentThread().getName() + "] scanned: " + scanned
+ ", zipf: " + zipf);