Search in sources :

Example 36 with DataInputDeserializer

use of org.apache.flink.core.memory.DataInputDeserializer in project flink by apache.

the class TestManagedFileSourceSplitSerializer method deserialize.

@Override
public TestManagedIterableSourceSplit deserialize(int version, byte[] serialized) throws IOException {
    if (version == VERSION) {
        final DataInputDeserializer in = new DataInputDeserializer(serialized);
        final String id = in.readUTF();
        final Path path = new Path();
        path.read(in);
        return new TestManagedIterableSourceSplit(id, path);
    }
    throw new IOException(String.format("Unknown version %d", version));
}
Also used : Path(org.apache.flink.core.fs.Path) IOException(java.io.IOException) DataInputDeserializer(org.apache.flink.core.memory.DataInputDeserializer)

Aggregations

DataInputDeserializer (org.apache.flink.core.memory.DataInputDeserializer)36 DataOutputSerializer (org.apache.flink.core.memory.DataOutputSerializer)15 IOException (java.io.IOException)9 Test (org.junit.Test)9 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)3 Path (org.apache.flink.core.fs.Path)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Set (java.util.Set)2 MapSerializer (org.apache.flink.api.common.typeutils.base.MapSerializer)2 DataInputView (org.apache.flink.core.memory.DataInputView)2 GenericRowData (org.apache.flink.table.data.GenericRowData)2 RowData (org.apache.flink.table.data.RowData)2 ByteOrder (java.nio.ByteOrder)1 ArrayDeque (java.util.ArrayDeque)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1