scray.common.serialization.pool.ScrayJavaKryoInstantiator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scray-client-jdbc Show documentation
Show all versions of scray-client-jdbc Show documentation
scray java code, which can be used from java and scala
The newest version!
package scray.common.serialization.pool;
import scray.common.serialization.JavaKryoRowSerialization;
import scray.common.serialization.pool.KryoJavaPoolSerialization.SerializerEntry;
import com.esotericsoftware.kryo.Kryo;
import com.twitter.chill.KryoInstantiator;
public class ScrayJavaKryoInstantiator extends KryoInstantiator {
private static final long serialVersionUID = 1L;
@Override
public Kryo newKryo() {
Kryo k = super.newKryo();
k.setRegistrationRequired(false);
JavaKryoRowSerialization.registerSerializers(k);
for (SerializerEntry> ser : KryoJavaPoolSerialization.getInstance()
.getSerializers()) {
k.register(ser.cls, ser.ser, ser.num);
}
return k;
}
}