Search in sources :

Example 1 with PendingSplitsCheckpoint

use of org.apache.flink.connector.file.src.PendingSplitsCheckpoint in project flink by apache.

the class ContinuousHivePendingSplitsCheckpointSerializer method deserializeV1.

private PendingSplitsCheckpoint<HiveSourceSplit> deserializeV1(DataInputViewStreamWrapper inputWrapper) throws IOException {
    byte[] superBytes = new byte[inputWrapper.readInt()];
    inputWrapper.readFully(superBytes);
    PendingSplitsCheckpoint<HiveSourceSplit> superCP = superSerDe.deserialize(superSerDe.getVersion(), superBytes);
    try {
        Comparable<?> currentReadOffset = readOffsetSerDe.deserialize(inputWrapper);
        int numParts = inputWrapper.readInt();
        List<List<String>> parts = new ArrayList<>(numParts);
        for (int i = 0; i < numParts; i++) {
            parts.add(partitionSerDe.deserialize(inputWrapper));
        }
        return new ContinuousHivePendingSplitsCheckpoint(superCP.getSplits(), currentReadOffset, parts);
    } catch (ClassNotFoundException e) {
        throw new IOException("Failed to deserialize " + getClass().getName(), e);
    }
}
Also used : HiveSourceSplit(org.apache.flink.connectors.hive.read.HiveSourceSplit) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) IOException(java.io.IOException) PendingSplitsCheckpoint(org.apache.flink.connector.file.src.PendingSplitsCheckpoint)

Aggregations

IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 PendingSplitsCheckpoint (org.apache.flink.connector.file.src.PendingSplitsCheckpoint)1 HiveSourceSplit (org.apache.flink.connectors.hive.read.HiveSourceSplit)1