flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CompletedCheckpointTest.java
/**
	 * Tests that the garbage collection properties are respected when subsuming checkpoints.
	 */
Tests that the garbage collection properties are respected when subsuming checkpoints.
Tests that the garbage collection properties are respected when subsuming checkpoints .
@Test
	public void testCleanUpOnSubsume() throws Exception {
		OperatorState state = mock(OperatorState.class);
		Map<OperatorID, OperatorState> operatorStates = new HashMap<>();
		operatorStates.put(new OperatorID(), state);
		boolean discardSubsumed = true;
		CheckpointProperties props = new CheckpointProperties(false, false, false, discardSubsumed, true, true, true, true);
		CompletedCheckpoint checkpoint = new CompletedCheckpoint(
				new JobID(), 0, 0, 1,
				operatorStates,
				Collections.<MasterState>emptyList(),
				props,
				null,
				null);
		SharedStateRegistry sharedStateRegistry = new SharedStateRegistry();
		checkpoint.registerSharedStatesAfterRestored(sharedStateRegistry);
		verify(state, times(1)).registerSharedStates(sharedStateRegistry);
		checkpoint.discardOnSubsume();
		verify(state, times(1)).discardState();
	}
@ Test public void testCleanUpOnSubsume ( ) throws Exception { OperatorState state = mock ( OperatorState . class ) ; Map < OperatorID , OperatorState > operatorStates = new HashMap < > ( ) ; operatorStates . put ( new OperatorID ( ) , state ) ; boolean discardSubsumed = true ; CheckpointProperties props = new CheckpointProperties ( false , false , false , discardSubsumed , true , true , true , true ) ; CompletedCheckpoint checkpoint = new CompletedCheckpoint ( new JobID ( ) , 0 , 0 , 1 , operatorStates , Collections . < MasterState > emptyList ( ) , props , null , null ) ; SharedStateRegistry sharedStateRegistry = new SharedStateRegistry ( ) ; checkpoint . registerSharedStatesAfterRestored ( sharedStateRegistry ) ; verify ( state , times ( 1 ) ) . registerSharedStates ( sharedStateRegistry ) ; checkpoint . discardOnSubsume ( ) ; verify ( state , times ( 1 ) ) . discardState ( ) ; }
Tests that the garbage collection properties are respected when subsuming checkpoints.
Tests that the garbage collection properties are respected when subsuming checkpoints .
// Subsume