T
- Object typepublic class KryoWritableWrapper<T> extends Object implements org.apache.hadoop.io.Writable
Constructor and Description |
---|
KryoWritableWrapper()
Creates wrapper initialized with null.
|
KryoWritableWrapper(T object)
Create wrapper given an object.
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
convertFromByteArray(byte[] arr)
Converting from byte array
|
static <T> byte[] |
convertToByteArray(T object)
Converting the object to byte array.
|
T |
get()
Unwrap the object value
|
void |
readFields(DataInput in) |
void |
set(T object)
Set wrapped object value
|
static <T> T |
unwrapIfNeeded(org.apache.hadoop.io.Writable value)
Unwrap Writable object if it was wrapped initially,
inverse of wrapIfNeeded function.
|
static <T> T |
wrapAndCopy(T object)
Wrap object with KryoWritableWrapper, create a writable copy of it,
and then unwrap it, allowing any object to be copied.
|
static org.apache.hadoop.io.Writable |
wrapIfNeeded(Object object)
Returns Writable instance, wrapping given object only
if it is not already writable.
|
void |
write(DataOutput out) |
public KryoWritableWrapper(T object)
object
- Object instancepublic KryoWritableWrapper()
public T get()
public void set(T object)
object
- New object valuepublic void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public static org.apache.hadoop.io.Writable wrapIfNeeded(Object object)
object
- Object to potentially wrappublic static <T> T unwrapIfNeeded(org.apache.hadoop.io.Writable value)
T
- Type of returned object.value
- Potentially wrapped valuepublic static <T> T wrapAndCopy(T object)
T
- Type of the objectobject
- Object to copypublic static <T> byte[] convertToByteArray(T object)
T
- Typeobject
- Objectpublic static <T> T convertFromByteArray(byte[] arr)
T
- typearr
- byte arrayCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.