Package org.apache.flink.core.io
Class PostVersionedIOReadableWritable
- java.lang.Object
-
- org.apache.flink.core.io.VersionedIOReadableWritable
-
- org.apache.flink.core.io.PostVersionedIOReadableWritable
-
- All Implemented Interfaces:
IOReadableWritable,Versioned
@Internal public abstract class PostVersionedIOReadableWritable extends VersionedIOReadableWritable
AVersionedIOReadableWritablewhich allows to differentiate whether the previous data was versioned with aVersionedIOReadableWritable. This can be used if previously written data was not versioned, and is to be migrated to a versioned format.
-
-
Constructor Summary
Constructors Constructor Description PostVersionedIOReadableWritable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidread(InputStream inputStream)This read attempts to first identify if the input view contains the specialVERSIONED_IDENTIFIERby reading and buffering the first few bytes.voidread(DataInputView in)We do not support reading from aDataInputView, because it does not support pushing back already read bytes.protected abstract voidread(DataInputView in, boolean wasVersioned)Read from the providedin.voidwrite(DataOutputView out)Writes the object's internal data to the given data output view.-
Methods inherited from class org.apache.flink.core.io.VersionedIOReadableWritable
getAdditionalDetailsForIncompatibleVersion, getCompatibleVersions, getReadVersion
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.core.io.Versioned
getVersion
-
-
-
-
Method Detail
-
read
protected abstract void read(DataInputView in, boolean wasVersioned) throws IOException
Read from the providedin. A flagwasVersionedcan be used to determine whether or not the data to read was previously written by aVersionedIOReadableWritable.- Throws:
IOException
-
write
public void write(DataOutputView out) throws IOException
Description copied from interface:IOReadableWritableWrites the object's internal data to the given data output view.- Specified by:
writein interfaceIOReadableWritable- Overrides:
writein classVersionedIOReadableWritable- Parameters:
out- the output view to receive the data.- Throws:
IOException- thrown if any error occurs while writing to the output stream
-
read
public final void read(InputStream inputStream) throws IOException
This read attempts to first identify if the input view contains the specialVERSIONED_IDENTIFIERby reading and buffering the first few bytes. If identified to be versioned, the usual version resolution read path inVersionedIOReadableWritable.read(DataInputView)is invoked. Otherwise, we "reset" the input stream by pushing back the read buffered bytes into the stream.- Throws:
IOException
-
read
public final void read(DataInputView in) throws IOException
We do not support reading from aDataInputView, because it does not support pushing back already read bytes.- Specified by:
readin interfaceIOReadableWritable- Overrides:
readin classVersionedIOReadableWritable- Parameters:
in- the input view to read the data from- Throws:
IOException- thrown if any error occurs while reading from the input stream
-
-