public interface ISerializer
Modifier and Type | Field and Description |
---|---|
static Map<Class<?>,Function<?,byte[]>> |
customHashingMap |
static Map<Class<?>,Function<?,byte[]>> |
hashConversionMap
This map provides some methods for performing hashing on
known types.
|
static ThreadLocal<com.esotericsoftware.kryo.Kryo> |
kryos |
Modifier and Type | Method and Description |
---|---|
default Object |
clone(Object o,
CorfuRuntime rt)
Clone an object through serialization.
|
Object |
deserialize(io.netty.buffer.ByteBuf b,
CorfuRuntime rt)
Deserialize an object from a given byte buffer.
|
default <T> Function<T,byte[]> |
getCustomHasher(Class<T> cls)
Get a custom hasher from the serializer.
|
byte |
getType() |
default byte[] |
hash(Object o)
Given an object, generate a hash for it.
|
default <T> void |
registerCustomHasher(Class<T> cls,
Function<T,byte[]> hashFunction)
Register a new custom hasher with the serializer.
|
void |
serialize(Object o,
io.netty.buffer.ByteBuf b)
Serialize an object into a given byte buffer.
|
static final ThreadLocal<com.esotericsoftware.kryo.Kryo> kryos
byte getType()
Object deserialize(io.netty.buffer.ByteBuf b, CorfuRuntime rt)
b
- The bytebuf to deserialize.void serialize(Object o, io.netty.buffer.ByteBuf b)
o
- The object to serialize.b
- The bytebuf to serialize it into.default <T> void registerCustomHasher(Class<T> cls, Function<T,byte[]> hashFunction)
cls
- The class this hasher will handle.hashFunction
- The function to execute to generate the hash.default <T> Function<T,byte[]> getCustomHasher(Class<T> cls)
cls
- The class to obtain a hasher for.default byte[] hash(Object o)
o
- The object to hash.default Object clone(Object o, CorfuRuntime rt)
o
- The object to clone.Copyright © 2019 CorfuDB. All rights reserved.