public static < T > SerializedCheckpointData [ ] fromDeque ( ArrayDeque < Tuple2 < Long , Set < T > > > checkpoints , TypeSerializer < T > serializer , DataOutputSerializer outputBuffer ) throws IOException { SerializedCheckpointData [ ] serializedCheckpoints = new SerializedCheckpointData [ checkpoints . size ( ) ] ; int pos = 0 ; for ( Tuple2 < Long , Set < T > > checkpoint : checkpoints ) { outputBuffer . clear ( ) ; Set < T > checkpointIds = checkpoint . f1 ; for ( T id : checkpointIds ) { serializer . serialize ( id , outputBuffer ) ; } serializedCheckpoints [ pos ++ ] = new SerializedCheckpointData ( checkpoint . f0 , outputBuffer . getCopyOfBuffer ( ) , checkpointIds . size ( ) ) ; } return serializedCheckpoints ; }
Converts a list of checkpoints into an array of SerializedCheckpointData .