public class SerializationUtilities extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SerializationUtilities.Hook |
Constructor and Description |
---|
SerializationUtilities() |
Modifier and Type | Method and Description |
---|---|
static void |
addKryoTypeHook(Class<?> clazz,
SerializationUtilities.Hook hook)
Must be called before any serialization takes place (e.g.
|
static com.esotericsoftware.kryo.Kryo |
borrowKryo()
By default, kryo pool uses ConcurrentLinkedQueue which is unbounded.
|
static BaseWork |
cloneBaseWork(BaseWork plan)
Clones using the powers of XML.
|
static List<Operator<?>> |
cloneOperatorTree(List<Operator<?>> roots)
Clones using the powers of XML.
|
static MapredWork |
clonePlan(MapredWork plan)
Clones using the powers of XML.
|
static ExprNodeGenericFuncDesc |
deserializeExpression(String s) |
static ExprNodeGenericFuncDesc |
deserializeExpressionFromKryo(byte[] bytes)
Deserializes expression from Kryo.
|
static <T extends Serializable> |
deserializeObject(String s,
Class<T> clazz) |
static <T> T |
deserializePlan(InputStream in,
Class<T> planClass)
Deserializes the plan.
|
static <T> T |
deserializePlan(com.esotericsoftware.kryo.Kryo kryo,
InputStream in,
Class<T> planClass) |
static void |
releaseKryo(com.esotericsoftware.kryo.Kryo kryo)
Release kryo instance back to the pool.
|
static String |
serializeExpression(ExprNodeGenericFuncDesc expr) |
static byte[] |
serializeExpressionToKryo(ExprNodeGenericFuncDesc expr)
Serializes expression via Kryo.
|
static String |
serializeObject(Serializable expr) |
static void |
serializePlan(com.esotericsoftware.kryo.Kryo kryo,
Object plan,
OutputStream out) |
static void |
serializePlan(Object plan,
OutputStream out)
Serializes the plan.
|
static void |
setGlobalHook(SerializationUtilities.Hook hook)
Must be called before any serialization takes place (e.g.
|
public static void addKryoTypeHook(Class<?> clazz, SerializationUtilities.Hook hook)
public static void setGlobalHook(SerializationUtilities.Hook hook)
public static com.esotericsoftware.kryo.Kryo borrowKryo()
public static void releaseKryo(com.esotericsoftware.kryo.Kryo kryo)
kryo
- - kryo instance to be releasedpublic static void serializePlan(Object plan, OutputStream out)
plan
- The plan, such as QueryPlan, MapredWork, etc.out
- The stream to write to.public static void serializePlan(com.esotericsoftware.kryo.Kryo kryo, Object plan, OutputStream out)
public static <T> T deserializePlan(InputStream in, Class<T> planClass)
in
- The stream to read from.planClass
- class of planpublic static <T> T deserializePlan(com.esotericsoftware.kryo.Kryo kryo, InputStream in, Class<T> planClass)
public static MapredWork clonePlan(MapredWork plan)
plan
- The plan.public static List<Operator<?>> cloneOperatorTree(List<Operator<?>> roots)
roots
- The roots.public static BaseWork cloneBaseWork(BaseWork plan)
plan
- The plan.public static byte[] serializeExpressionToKryo(ExprNodeGenericFuncDesc expr)
expr
- Expression.public static ExprNodeGenericFuncDesc deserializeExpressionFromKryo(byte[] bytes)
bytes
- Bytes containing the expression.public static String serializeExpression(ExprNodeGenericFuncDesc expr)
public static ExprNodeGenericFuncDesc deserializeExpression(String s)
public static String serializeObject(Serializable expr)
public static <T extends Serializable> T deserializeObject(String s, Class<T> clazz)
Copyright © 2016 The Apache Software Foundation. All rights reserved.