public static < T > ArrayDeque < Tuple2 < Long , Set < T > > > toDeque ( SerializedCheckpointData [ ] data , TypeSerializer < T > serializer ) throws IOException { ArrayDeque < Tuple2 < Long , Set < T > > > deque = new ArrayDeque <> ( data . length ) ; DataInputDeserializer deser = null ; for ( SerializedCheckpointData checkpoint : data ) { byte [ ] serializedData = checkpoint . getSerializedData ( ) ; if ( deser == null ) { deser = new DataInputDeserializer ( serializedData , 0 , serializedData . length ) ; } else { deser . setBuffer ( serializedData ) ; } final Set < T > ids = new HashSet <> ( checkpoint . getNumIds ( ) ) ; final int numIds = checkpoint . getNumIds ( ) ; for ( int i = 0 ; i < numIds ; i ++ ) { ids . add ( serializer . deserialize ( deser ) ) ; } deque . addLast ( new Tuple2 < Long , Set < T > > ( checkpoint . checkpointId , ids ) ) ; } return deque ; }
De - serializes an array of SerializedCheckpointData back into an ArrayDeque of element checkpoints .