Configurable, Writable@Public @Stable public class ObjectWritable extends java.lang.Object implements Writable, Configurable
| Constructor | Description |
|---|---|
ObjectWritable() |
|
ObjectWritable(java.lang.Class declaredClass,
java.lang.Object instance) |
|
ObjectWritable(java.lang.Object instance) |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.Object |
get() |
Return the instance, or null if none.
|
Configuration |
getConf() |
Return the configuration used by this object.
|
java.lang.Class |
getDeclaredClass() |
Return the class this is meant to be.
|
static java.lang.Class<?> |
loadClass(Configuration conf,
java.lang.String className) |
Find and load the class with given name className by first finding
it in the specified conf.
|
void |
readFields(java.io.DataInput in) |
Deserialize the fields of this object from
in. |
static java.lang.Object |
readObject(java.io.DataInput in,
Configuration conf) |
Read a
Writable, String, primitive type, or an array of
the preceding. |
static java.lang.Object |
readObject(java.io.DataInput in,
ObjectWritable objectWritable,
Configuration conf) |
Read a
Writable, String, primitive type, or an array of
the preceding. |
void |
set(java.lang.Object instance) |
Reset the instance.
|
void |
setConf(Configuration conf) |
Set the configuration to be used by this object.
|
java.lang.String |
toString() |
|
void |
write(java.io.DataOutput out) |
Serialize the fields of this object to
out. |
static void |
writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
Configuration conf) |
Write a
Writable, String, primitive type, or an array of
the preceding. |
static void |
writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
Configuration conf,
boolean allowCompactArrays) |
Write a
Writable, String, primitive type, or an array of
the preceding. |
public ObjectWritable()
public ObjectWritable(java.lang.Object instance)
public ObjectWritable(java.lang.Class declaredClass,
java.lang.Object instance)
public java.lang.Object get()
public java.lang.Class getDeclaredClass()
public void set(java.lang.Object instance)
instance - instance.public java.lang.String toString()
toString in class java.lang.Objectpublic void readFields(java.io.DataInput in)
throws java.io.IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.java.io.IOException - any other problem for readFields.public void write(java.io.DataOutput out)
throws java.io.IOException
Writableout.public static void writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
Configuration conf)
throws java.io.IOException
Writable, String, primitive type, or an array of
the preceding.out - DataOutput.instance - instance.conf - Configuration.declaredClass - declaredClass.java.io.IOException - raised on errors performing I/O.public static void writeObject(java.io.DataOutput out,
java.lang.Object instance,
java.lang.Class declaredClass,
Configuration conf,
boolean allowCompactArrays)
throws java.io.IOException
Writable, String, primitive type, or an array of
the preceding.allowCompactArrays - - set true for RPC and internal or intra-cluster
usages. Set false for inter-cluster, File, and other persisted output
usages, to preserve the ability to interchange files with other clusters
that may not be running the same version of software. Sometime in ~2013
we can consider removing this parameter and always using the compact format.conf - configuration.out - dataoutput.declaredClass - declaredClass.instance - instance.java.io.IOException - raised on errors performing I/O.public static java.lang.Object readObject(java.io.DataInput in,
Configuration conf)
throws java.io.IOException
Writable, String, primitive type, or an array of
the preceding.conf - configuration.in - DataInput.java.io.IOException - raised on errors performing I/O.public static java.lang.Object readObject(java.io.DataInput in,
ObjectWritable objectWritable,
Configuration conf)
throws java.io.IOException
Writable, String, primitive type, or an array of
the preceding.in - DataInput.objectWritable - objectWritable.conf - configuration.java.io.IOException - raised on errors performing I/O.public static java.lang.Class<?> loadClass(Configuration conf, java.lang.String className)
conf - configuration.className - classname.public void setConf(Configuration conf)
ConfigurablesetConf in interface Configurableconf - configuration to be usedpublic Configuration getConf()
ConfigurablegetConf in interface ConfigurableCopyright © 2008–2025 Apache Software Foundation. All rights reserved.