use of org.apache.ignite.internal.schema.marshaller.reflection.ReflectionMarshallerFactory in project ignite-3 by apache.
the class SerializerBenchmarkTest method init.
/**
* Initialize.
*/
@Setup
public void init() {
long seed = System.currentTimeMillis();
rnd = new Random(seed);
final Class<?> valClass;
Thread.currentThread().setContextClassLoader(new DynamicClassLoader(AsmMarshallerGenerator.getClassLoader()));
if (fieldsCount == 0) {
valClass = Long.class;
objectFactory = (Factory<Object>) rnd::nextLong;
} else {
valClass = createGeneratedObjectClass(fieldsCount, long.class);
objectFactory = new ObjectFactory<>(valClass);
}
schema = new SchemaDescriptor(1, new Column[] { new Column("key", INT64, true) }, mapFieldsToColumns(valClass));
KvMarshaller<?, ?> marshaller = ("Java".equals(serializerName)) ? new ReflectionMarshallerFactory().create(schema, Long.class, valClass) : new AsmMarshallerGenerator().create(schema, Long.class, valClass);
this.marshaller = (KvMarshaller<Object, Object>) marshaller;
}
Aggregations