use of org.apache.ignite.yardstick.cache.model.Person1 in project ignite by apache.
the class IgniteSqlDeleteBenchmark method setUp.
/**
* {@inheritDoc}
*/
@Override
public void setUp(final BenchmarkConfiguration cfg) throws Exception {
super.setUp(cfg);
final AtomicInteger i = new AtomicInteger();
Collection<Thread> setupThreads = new ArrayList<>(cfg.threads());
for (int j = 0; j < cfg.threads(); j++) {
Thread t = new Thread() {
/**
* {@inheritDoc}
*/
@Override
public void run() {
int k;
while ((k = i.getAndIncrement()) < args.range()) {
cache().put(k, new Person1(k));
keys.add(k);
if (k % 100000 == 0)
BenchmarkUtils.println(cfg, "DELETE setUp: have successfully put " + k + " items");
}
}
};
setupThreads.add(t);
t.start();
}
for (Thread t : setupThreads) t.join();
}
use of org.apache.ignite.yardstick.cache.model.Person1 in project ignite by apache.
the class IgniteSqlUpdateBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
ThreadLocalRandom rnd = ThreadLocalRandom.current();
cache().query(new SqlFieldsQuery("update Person1 set _val = ? where _key = ?").setArgs(new Person1(rnd.nextInt(args.range())), rnd.nextInt(args.range())));
return true;
}
use of org.apache.ignite.yardstick.cache.model.Person1 in project ignite by apache.
the class IgnitePutIndexedValue1Benchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
IgniteCache<Integer, Object> cache = cacheForOperation();
int key = nextRandom(args.range());
cache.put(key, new Person1(key));
return true;
}
Aggregations