use of org.apache.ignite.yardstick.cache.model.Person2 in project ignite by apache.
the class IgnitePutIndexedValue2Benchmark method test.
/** {@inheritDoc} */
@Override
public boolean test(Map<Object, Object> ctx) throws Exception {
int key = nextRandom(args.range());
cache.put(key, new Person2(key));
return true;
}
use of org.apache.ignite.yardstick.cache.model.Person2 in project ignite by apache.
the class ModelUtil method create.
/**
* @param c model class
* @param id object id
* @return object from model
*/
public static Object create(Class c, int id) {
Object res = null;
switch(c.getSimpleName()) {
case "Double":
res = id;
break;
case "Identifier":
res = new Identifier(id, "id " + id);
break;
case "Mark":
res = new Mark(id, UUID.nameUUIDFromBytes(Integer.toString(id).getBytes()));
break;
case "Integer":
res = id;
break;
case "UUID":
res = UUID.nameUUIDFromBytes(Integer.toString(id).getBytes());
break;
case "Car":
int colorCnt = Color.values().length;
res = new Car(id, "Mark " + id, id / 2.123 * 100, Color.values()[id % colorCnt]);
break;
case "Truck":
int colors = Color.values().length;
res = new Truck(id, "Mark " + id, id / 2.123 * 100, Color.values()[id % colors], id / 4.123 * 100);
break;
case "Person":
res = new Person(id, id + 1, "First Name " + id, "Last Name " + id, id / 2.123 * 100);
break;
case "Organization":
res = new Organization(id, "Organization " + id);
break;
case "Account":
res = new Account(id);
break;
case "Person1":
res = new Person1(id);
break;
case "Person2":
res = new Person2(id);
break;
case "Person8":
res = new Person8(id);
break;
case "String":
res = String.valueOf(id);
}
return res;
}
Aggregations