use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgniteInvokeTxBenchmark method setUp.
/**
* {@inheritDoc}
*/
@Override
public void setUp(BenchmarkConfiguration cfg) throws Exception {
super.setUp(cfg);
if (!IgniteSystemProperties.getBoolean("SKIP_MAP_CHECK"))
ignite().compute().broadcast(new WaitMapExchangeFinishCallable());
txs = ignite().transactions();
clo = new Callable<Void>() {
@Override
public Void call() throws Exception {
int key = nextRandom(args.range());
IgniteCache<Integer, Object> cache = cacheForOperation();
cache.invoke(key, new SetValueEntryProcessor(new SampleValue(key)));
return null;
}
};
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgnitePutGetBatchBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
IgniteCache<Integer, Object> cache = cacheForOperation();
Set<Integer> keys = new TreeSet<>();
while (keys.size() < args.batch()) keys.add(nextRandom(args.range()));
Map<Integer, Object> vals = cache.getAll(keys);
Map<Integer, SampleValue> updates = new TreeMap<>();
for (Integer key : keys) {
Object val = vals.get(key);
if (val != null)
key = nextRandom(args.range());
updates.put(key, new SampleValue(key));
}
cache.putAll(updates);
return true;
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgnitePutRemoveBenchmark 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 SampleValue(key));
cache.remove(key);
return true;
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgnitePutTxSkipLocalBackupBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
IgniteCache<Integer, Object> cache = cacheForOperation();
int key;
Affinity<Object> aff = ignite().affinity("tx");
ClusterNode locNode = ignite().cluster().localNode();
for (; ; ) {
key = nextRandom(args.range());
// Skip key if local node is backup.
if (!aff.isBackup(locNode, key))
break;
}
// Implicit transaction is used.
cache.put(key, new SampleValue(key));
return true;
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgniteJdbcStorePutGetBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
int id = nextRandom(args.range());
Object val = cache.get(new SampleKey(id));
if (val != null)
id = nextRandom(args.range());
cache.put(new SampleKey(id), new SampleValue(id));
return true;
}
Aggregations