flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/CopyOnWriteStateTable.java
/**
	 * Perform copy-on-write for entry chains. We iterate the (hopefully and probably) still cached chain, replace
	 * all links up to the 'untilEntry', which we actually wanted to modify.
	 */
Perform copy-on-write for entry chains. We iterate the (hopefully and probably) still cached chain, replace
all links up to the 'untilEntry', which we actually wanted to modify.
Perform copy - on - write for entry chains . We iterate the ( hopefully and probably ) still cached chain replace all links up to the ' untilEntry ' which we actually wanted to modify .
private StateTableEntry<K, N, S> handleChainedEntryCopyOnWrite(
			StateTableEntry<K, N, S>[] tab,
			int tableIdx,
			StateTableEntry<K, N, S> untilEntry) {
		final int required = highestRequiredSnapshotVersion;
		StateTableEntry<K, N, S> current = tab[tableIdx];
		StateTableEntry<K, N, S> copy;
		if (current.entryVersion < required) {
			copy = new StateTableEntry<>(current, stateTableVersion);
			tab[tableIdx] = copy;
		} else {
			copy = current;
		}
		while (current != untilEntry) {
			current = current.next;
			if (current.entryVersion < required) {
				copy.next = new StateTableEntry<>(current, stateTableVersion);
				copy = copy.next;
			} else {
				copy = current;
			}
		}
		return copy;
	}
private StateTableEntry < K , N , S > handleChainedEntryCopyOnWrite ( StateTableEntry < K , N , S > [ ] tab , int tableIdx , StateTableEntry < K , N , S > untilEntry ) { final int required = highestRequiredSnapshotVersion ; StateTableEntry < K , N , S > current = tab [ tableIdx ] ; StateTableEntry < K , N , S > copy ; if ( current . entryVersion < required ) { copy = new StateTableEntry < > ( current , stateTableVersion ) ; tab [ tableIdx ] = copy ; } else { copy = current ; } while ( current != untilEntry ) { current = current . next ; if ( current . entryVersion < required ) { copy . next = new StateTableEntry < > ( current , stateTableVersion ) ; copy = copy . next ; } else { copy = current ; } } return copy ; }
Perform copy-on-write for entry chains.
Perform copy - on - write for entry chains .
// nothing to do, just advance copy to current // we iterate the chain up to 'until entry' //advance current // copy and advance the current's copy // nothing to do, just advance copy to current