use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgniteJdbcStorePutTxBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
int id = nextRandom(args.range());
cache.put(new SampleKey(id), new SampleValue(id));
return true;
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgniteBinaryIdentityBenchmark method setUp.
/**
* {@inheritDoc}
*/
@Override
public void setUp(BenchmarkConfiguration cfg) throws Exception {
super.setUp(cfg);
println(cfg, "Populating data...");
long start = System.nanoTime();
try (IgniteDataStreamer<BinaryObject, Object> dataLdr = ignite().dataStreamer(cache.getName())) {
for (int i = 0; i < args.range() && !Thread.currentThread().isInterrupted(); ) {
dataLdr.addData(createKey(i), new SampleValue(i));
if (++i % 100000 == 0)
println(cfg, "Items populated: " + i);
}
}
println(cfg, "Finished populating data in " + ((System.nanoTime() - start) / 1_000_000) + " ms.");
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgniteGetAndPutBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
int key = nextRandom(args.range());
IgniteCache<Integer, Object> cache = cacheForOperation();
cache.getAndPut(key, new SampleValue(key));
return true;
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgniteGetFromComputeBenchmark method setUp.
/**
* {@inheritDoc}
*/
@Override
public void setUp(BenchmarkConfiguration cfg) throws Exception {
super.setUp(cfg);
if (args.preloadAmount() > args.range())
throw new IllegalArgumentException("Preloading amount (\"-pa\", \"--preloadAmount\") " + "must by less then the range (\"-r\", \"--range\").");
String cacheName = cache().getName();
println(cfg, "Loading data for cache: " + cacheName);
long start = System.nanoTime();
try (IgniteDataStreamer<Object, Object> dataLdr = ignite().dataStreamer(cacheName)) {
for (int i = 0; i < args.preloadAmount(); i++) {
dataLdr.addData(i, new SampleValue(i));
if (i % 100000 == 0) {
if (Thread.currentThread().isInterrupted())
break;
println("Loaded entries: " + i);
}
}
}
println(cfg, "Finished populating data [time=" + ((System.nanoTime() - start) / 1_000_000) + "ms, " + "amount=" + args.preloadAmount() + ']');
compute = ignite().compute();
asyncCache = cache().withAsync();
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgnitePutBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
int key = nextRandom(args.range());
IgniteCache<Integer, Object> cache = cacheForOperation();
cache.put(key, new SampleValue(key));
return true;
}
Aggregations