add clear function for StreamRecord, add framework of checkpointer.