use of org.janusgraph.graphdb.serializer.attributes.TEnumSerializer in project janusgraph by JanusGraph.
the class SerializerTest method objectWriteReadTest.
@Test
public void objectWriteReadTest() {
serialize.registerClass(2, TClass1.class, new TClass1Serializer());
serialize.registerClass(80342, TClass2.class, new TClass2Serializer());
serialize.registerClass(999, TEnum.class, new TEnumSerializer());
objectWriteRead();
}
use of org.janusgraph.graphdb.serializer.attributes.TEnumSerializer in project janusgraph by JanusGraph.
the class SerializerTest method enumSerializeTest.
@Test
public void enumSerializeTest() {
serialize.registerClass(1, TEnum.class, new TEnumSerializer());
DataOutput out = serialize.getDataOutput(128);
out.writeObjectNotNull(TEnum.TWO);
out.writeObjectNotNull(TEnum.THREE);
ReadBuffer b = out.getStaticBuffer().asReadBuffer();
if (printStats)
log.debug(bufferStats(b));
assertEquals(TEnum.TWO, serialize.readObjectNotNull(b, TEnum.class));
assertEquals(TEnum.THREE, serialize.readObjectNotNull(b, TEnum.class));
assertFalse(b.hasRemaining());
}
use of org.janusgraph.graphdb.serializer.attributes.TEnumSerializer in project janusgraph by JanusGraph.
the class SerializerSpeedTest method performanceTestObjectSerialization.
@RepeatedTest(10)
public void performanceTestObjectSerialization() {
serialize.registerClass(2, TClass1.class, new TClass1Serializer());
serialize.registerClass(80342, TClass2.class, new TClass2Serializer());
serialize.registerClass(999, TEnum.class, new TEnumSerializer());
int runs = 1000000;
for (int i = 0; i < runs; i++) {
objectWriteRead();
}
}
Aggregations