Writable@Public @Stable public abstract class VersionedWritable extends java.lang.Object implements Writable
This is useful when a class may evolve, so that instances written by the
old version of the class may still be processed by the new version. To
handle this situation, readFields(DataInput)
implementations should catch VersionMismatchException.
| Constructor | Description |
|---|---|
VersionedWritable() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract byte |
getVersion() |
|
void |
readFields(java.io.DataInput in) |
Deserialize the fields of this object from
in. |
void |
write(java.io.DataOutput out) |
Serialize the fields of this object to
out. |
public abstract byte getVersion()
public void write(java.io.DataOutput out)
throws java.io.IOException
Writableout.public 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.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.