use of org.directmemory.memory.Pointer in project DirectMemory by raffaeleguidi.
the class ConcurrentTests2 method retrieveCatchThemAll.
@BenchmarkOptions(benchmarkRounds = 1000000, warmupRounds = 0, concurrency = 100)
@Test
public void retrieveCatchThemAll() {
String key = "test-" + (rndGen.nextInt(entries) + 1);
Pointer p = map.get(key);
read.incrementAndGet();
if (p != null) {
got.incrementAndGet();
byte[] payload = MemoryManager.retrieve(p);
if (key.equals(new String(payload)))
good.incrementAndGet();
else
bad.incrementAndGet();
} else {
logger.info("did not find key " + key);
missed.incrementAndGet();
}
}
Aggregations