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
/**
	 * Maps the specified key/namespace composite key to the specified value. Returns the previous state that was
	 * registered under the composite key.
	 *
	 * @param key       the key. Not null.
	 * @param namespace the namespace. Not null.
	 * @param value     the value. Can be null.
	 * @return the value of any previous mapping with the specified key or
	 * {@code null} if there was no such mapping.
	 */
Maps the specified key/namespace composite key to the specified value. Returns the previous state that was
registered under the composite key.

@param key       the key. Not null.
@param namespace the namespace. Not null.
@param value     the value. Can be null.
@return the value of any previous mapping with the specified key or
null if there was no such mapping.
Maps the specified key / namespace composite key to the specified value . Returns the previous state that was registered under the composite key . @param key the key . Not null . @param namespace the namespace . Not null . @param value the value . Can be null . @return the value of any previous mapping with the specified key or null if there was no such mapping .
S putAndGetOld(K key, N namespace, S value) {
		final StateTableEntry<K, N, S> e = putEntry(key, namespace);
		S oldState = (e.stateVersion < highestRequiredSnapshotVersion) ?
				getStateSerializer().copy(e.state) :
				e.state;
		e.state = value;
		e.stateVersion = stateTableVersion;
		return oldState;
	}
S putAndGetOld ( K key , N namespace , S value ) { final StateTableEntry < K , N , S > e = putEntry ( key , namespace ) ; S oldState = ( e . stateVersion < highestRequiredSnapshotVersion ) ? getStateSerializer ( ) . copy ( e . state ) : e . state ; e . state = value ; e . stateVersion = stateTableVersion ; return oldState ; }
Maps the specified key/namespace composite key to the specified value.
Maps the specified key / namespace composite key to the specified value .
// copy-on-write check for state