Package org.archive.bdb
Class KryoBinding<K>
java.lang.Object
org.archive.bdb.KryoBinding<K>
- All Implemented Interfaces:
com.sleepycat.bind.EntryBinding<K>
public class KryoBinding<K> extends Object implements com.sleepycat.bind.EntryBinding<K>
Binding for use with BerkeleyDB-JE that uses Kryo serialization rather
than BDB's (custom version of) Java serialization.
- Author:
- gojomo
-
Field Summary
Fields Modifier and Type Field Description protected Class<K>
baseClass
protected AutoKryo
kryo
protected ThreadLocal<WeakReference<com.esotericsoftware.kryo.ObjectBuffer>>
threadBuffer
-
Constructor Summary
Constructors Constructor Description KryoBinding(Class<K> baseClass)
Constructor. -
Method Summary
Modifier and Type Method Description K
entryToObject(com.sleepycat.je.DatabaseEntry entry)
com.esotericsoftware.kryo.Kryo
getKryo()
void
objectToEntry(K object, com.sleepycat.je.DatabaseEntry entry)
Copies superclass simply to allow different source for FastOoutputStream.
-
Field Details
-
baseClass
-
kryo
-
threadBuffer
-
-
Constructor Details
-
KryoBinding
Constructor. Save parameters locally, as superclass fields are private.- Parameters:
baseClass
- is the base class for serialized objects stored using this binding
-
-
Method Details
-
getKryo
public com.esotericsoftware.kryo.Kryo getKryo() -
objectToEntry
Copies superclass simply to allow different source for FastOoutputStream.- Specified by:
objectToEntry
in interfacecom.sleepycat.bind.EntryBinding<K>
- See Also:
SerialBinding.entryToObject(com.sleepycat.je.DatabaseEntry)
-
entryToObject
- Specified by:
entryToObject
in interfacecom.sleepycat.bind.EntryBinding<K>
-