public class GiraphClassResolver
extends com.esotericsoftware.kryo.util.DefaultClassResolver
Constructor and Description |
---|
GiraphClassResolver() |
Modifier and Type | Method and Description |
---|---|
static void |
createClassName(String className)
Creates a new node for the given class name.
|
static int |
getClassId(String className)
Gets ID for the given class name.
|
static String |
getClassName(int id)
Get class name for given ID.
|
protected Class<?> |
getTypeByName(String className)
Get type by class name.
|
static boolean |
isInitialized()
Return true of the zookeeper is initialized.
|
com.esotericsoftware.kryo.Registration |
readClass(com.esotericsoftware.kryo.io.Input input) |
protected com.esotericsoftware.kryo.Registration |
readName(com.esotericsoftware.kryo.io.Input input)
This method reads the class name for the first encountered
non-explicitly registered class.
|
static void |
refreshCache()
Refreshes class-ID mapping from zookeeper.
|
com.esotericsoftware.kryo.Registration |
register(com.esotericsoftware.kryo.Registration registration) |
com.esotericsoftware.kryo.Registration |
registerImplicit(Class type) |
void |
reset()
Reset the internal state
Reset clears two hash tables:
1 - Class name to ID: Every non-explicitly registered class takes the
ID agreed by all kryo instances, and it doesn't change across
serializations, so this reset is not required.
|
static void |
setZookeeperInfo(ZooKeeperExt zookeeperExt,
String kryoClassPath)
Sets zookeeper informaton.
|
com.esotericsoftware.kryo.Registration |
writeClass(com.esotericsoftware.kryo.io.Output output,
Class type) |
protected void |
writeName(com.esotericsoftware.kryo.io.Output output,
Class type,
com.esotericsoftware.kryo.Registration registration)
This method writes the class name for the first encountered
non-explicitly registered class.
|
public static void setZookeeperInfo(ZooKeeperExt zookeeperExt, String kryoClassPath)
zookeeperExt
- ZookeeperExtkryoClassPath
- Zookeeper directory path where class Name-ID
mapping is stored.public static boolean isInitialized()
public static void createClassName(String className)
className
- Class namepublic static void refreshCache()
public static int getClassId(String className)
className
- Class namepublic static String getClassName(int id)
id
- class IDpublic com.esotericsoftware.kryo.Registration register(com.esotericsoftware.kryo.Registration registration)
register
in interface com.esotericsoftware.kryo.ClassResolver
register
in class com.esotericsoftware.kryo.util.DefaultClassResolver
public com.esotericsoftware.kryo.Registration registerImplicit(Class type)
registerImplicit
in interface com.esotericsoftware.kryo.ClassResolver
registerImplicit
in class com.esotericsoftware.kryo.util.DefaultClassResolver
public com.esotericsoftware.kryo.Registration writeClass(com.esotericsoftware.kryo.io.Output output, Class type)
writeClass
in interface com.esotericsoftware.kryo.ClassResolver
writeClass
in class com.esotericsoftware.kryo.util.DefaultClassResolver
public com.esotericsoftware.kryo.Registration readClass(com.esotericsoftware.kryo.io.Input input)
readClass
in interface com.esotericsoftware.kryo.ClassResolver
readClass
in class com.esotericsoftware.kryo.util.DefaultClassResolver
public void reset()
reset
in interface com.esotericsoftware.kryo.ClassResolver
reset
in class com.esotericsoftware.kryo.util.DefaultClassResolver
protected void writeName(com.esotericsoftware.kryo.io.Output output, Class type, com.esotericsoftware.kryo.Registration registration)
writeName
in class com.esotericsoftware.kryo.util.DefaultClassResolver
output
- Output streamtype
- CLass typeregistration
- Registrationprotected com.esotericsoftware.kryo.Registration readName(com.esotericsoftware.kryo.io.Input input)
readName
in class com.esotericsoftware.kryo.util.DefaultClassResolver
input
- Input streamCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.