use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgnitePutTxImplicitBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
IgniteCache<Integer, Object> cache = cacheForOperation();
int key = nextRandom(args.range());
// 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 IgnitePutTxPrimaryOnlyBenchmark 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());
// Exit only if primary.
if (aff.isPrimary(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 IgnitePutGetBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
int key = nextRandom(args.range());
IgniteCache<Integer, Object> cache = cacheForOperation();
Object val = cache.get(key);
if (val != null)
key = nextRandom(args.range());
cache.put(key, new SampleValue(key));
return true;
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgnitePutGetEntryBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
IgniteCache<Integer, Object> cache = cacheForOperation();
int key = nextRandom(args.range());
CacheEntry<Integer, Object> val = cache.getEntry(key);
if (val != null)
key = nextRandom(args.range());
cache.put(key, new SampleValue(key));
return true;
}
use of org.apache.ignite.yardstick.cache.model.SampleValue in project ignite by apache.
the class IgniteBinaryIdentityPutBenchmark method test.
/**
* {@inheritDoc}
*/
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
int key = nextRandom(args.range());
cache.put(createKey(key), new SampleValue(key));
return true;
}
Aggregations