class StandaloneCompletedCheckpointStore implements CompletedCheckpointStore {

	@Override
	public void addCheckpoint(CompletedCheckpoint checkpoint) throws Exception {

		checkpoints.addLast(checkpoint);

		if (checkpoints.size() > maxNumberOfCheckpointsToRetain) {
			try {
				CompletedCheckpoint checkpointToSubsume = checkpoints.removeFirst();
				checkpointToSubsume.discardOnSubsume();
			} catch (Exception e) {
				LOG.warn("Fail to subsume the old checkpoint.", e);
			}
		}
	}

	public  StandaloneCompletedCheckpointStore(int maxNumberOfCheckpointsToRetain);

}