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
/**
	 * Helper method that is the basis for operations that remove mappings.
	 */
Helper method that is the basis for operations that remove mappings.
Helper method that is the basis for operations that remove mappings .
private StateTableEntry<K, N, S> removeEntry(K key, N namespace) {
		final int hash = computeHashForOperationAndDoIncrementalRehash(key, namespace);
		final StateTableEntry<K, N, S>[] tab = selectActiveTable(hash);
		int index = hash & (tab.length - 1);
		for (StateTableEntry<K, N, S> e = tab[index], prev = null; e != null; prev = e, e = e.next) {
			if (e.hash == hash && key.equals(e.key) && namespace.equals(e.namespace)) {
				if (prev == null) {
					tab[index] = e.next;
				} else {
					if (prev.entryVersion < highestRequiredSnapshotVersion) {
						prev = handleChainedEntryCopyOnWrite(tab, index, prev);
					}
					prev.next = e.next;
				}
				++modCount;
				if (tab == primaryTable) {
					--primaryTableSize;
				} else {
					--incrementalRehashTableSize;
				}
				return e;
			}
		}
		return null;
	}
private StateTableEntry < K , N , S > removeEntry ( K key , N namespace ) { final int hash = computeHashForOperationAndDoIncrementalRehash ( key , namespace ) ; final StateTableEntry < K , N , S > [ ] tab = selectActiveTable ( hash ) ; int index = hash & ( tab . length - 1 ) ; for ( StateTableEntry < K , N , S > e = tab [ index ] , prev = null ; e != null ; prev = e , e = e . next ) { if ( e . hash == hash && key . equals ( e . key ) && namespace . equals ( e . namespace ) ) { if ( prev == null ) { tab [ index ] = e . next ; } else { if ( prev . entryVersion < highestRequiredSnapshotVersion ) { prev = handleChainedEntryCopyOnWrite ( tab , index , prev ) ; } prev . next = e . next ; } ++ modCount ; if ( tab == primaryTable ) { -- primaryTableSize ; } else { -- incrementalRehashTableSize ; } return e ; } } return null ; }
Helper method that is the basis for operations that remove mappings.
Helper method that is the basis for operations that remove mappings .
// copy-on-write check for entry