Increments the value mapped to the key if the key is present in the map. Otherwise,
the key is inserted with the putAmount.

@param key the key of the value to increment
@param adjustAmount the amount by which to increment the value
348743
void adjustOrPutValue(final T key, final long adjustAmount) {
    final int arrayMask = keys.length - 1;
    int probe = (int) hash(key.hashCode()) & arrayMask;
    int drift = 1;
    while (states[probe] != 0 && !keys[probe].equals(key)) {
      probe = (probe + 1) & arrayMask;
      drift++;
      //only used for theoretical analysis
      assert (drift < DRIFT_LIMIT) : "drift: " + drift + " >= DRIFT_LIMIT";
    }

    if (states[probe] == 0) {
      // adding the key to the table the value
      assert (numActive <= loadThreshold)
        : "numActive: " + numActive + " > loadThreshold: " + loadThreshold;
      keys[probe] = key;
      values[probe] = adjustAmount;
      states[probe] = (short) drift;
      numActive++;
    } else {
      // adjusting the value of an existing key
      assert (keys[probe].equals(key));
      values[probe] += adjustAmount;
    }
  }
1141958
public void incrementCounter(BugChecker bugChecker, String key, int count) {
    statisticsCollector.incrementCounter(statsKey(bugChecker.canonicalName() + "-" + key), count);
  }
356736
public MapUpdate removeCounter(String key)
    {
        BinaryValue k = BinaryValue.create(key);
        removes.add(new MapOp.MapField(MapOp.FieldType.COUNTER, k));
        return this;
    }
59249
public final void put(long key, long value) {
		if (!isLeaf) {
			throw DBLogger.newFatalInternal("Tree inconsistency.");
		}

		//in any case, check whether the key(+value) already exists
        int pos = binarySearch(0, nEntries, key, value);
        //key found? -> pos >=0
        if (pos >= 0) {
        	//check if values changes
            if (value != values[pos]) {
                markPageDirtyAndClone();
                values[pos] = value;
            }
            return;
        } 

        if (nEntries < ind.maxLeafN) {
            //okay so we add it locally
            pos = -(pos+1);
            markPageDirtyAndClone();
            if (pos < nEntries) {
                System.arraycopy(keys, pos, keys, pos+1, nEntries-pos);
                System.arraycopy(values, pos, values, pos+1, nEntries-pos);
            }
            keys[pos] = key;
            values[pos] = value;
            nEntries++;
            return;
		} else {
			//treat page overflow
			LLIndexPage newP;
			boolean isNew = false;
			boolean isPrev = false;
			//use ind.maxLeafN -1 to avoid pretty much pointless copying (and possible endless 
			//loops, see iterator tests)
			LLIndexPage next = (LLIndexPage) parent.getNextLeafPage(this);
			if (next != null && next.nEntries < ind.maxLeafN-1) {
				//merge
				newP = next;
				newP.markPageDirtyAndClone();
				isPrev = false;
			} else {
				//Merging with prev is not make a big difference, maybe we should remove it...
				LLIndexPage prev = (LLIndexPage) parent.getPrevLeafPage(this);
				if (prev != null && prev.nEntries < ind.maxLeafN-1) {
					//merge
					newP = prev;
					newP.markPageDirtyAndClone();
					isPrev = true;
				} else {
					newP = new LLIndexPage(ind, parent, true);
					isNew = true;
				}
			}
			
			markPageDirtyAndClone();
			int nEntriesToKeep = (nEntries + newP.nEntries) >> 1;
			if (isNew) {
				if (ind.isUnique()) {
					//This is an optimization for indices that add increasing unique numbers 
					//such as OIDs. For these, it increases the average fill-size.
					//find split point such that pages can be completely full
					int pos2 = binarySearch(0, nEntries, keys[0] + ind.maxLeafN, value);
					if (pos2 < 0) {
						pos2 = -(pos2+1);
					}
					if (pos2 > nEntriesToKeep) {
						nEntriesToKeep = pos2;
					}
				} else {
					//non-unique: we assume ascending keys.
					//If they are not ascending, merging with subsequent page sorts it out.
					nEntriesToKeep = (int) (ind.maxLeafN * 0.9);
				}
			}
			int nEntriesToCopy = nEntries - nEntriesToKeep;
			if (isNew) {
				//works only if new page follows current page
				System.arraycopy(keys, nEntriesToKeep, newP.keys, 0, nEntriesToCopy);
				System.arraycopy(values, nEntriesToKeep, newP.values, 0, nEntriesToCopy);
			} else if (isPrev) {
				//copy element to previous page
				System.arraycopy(keys, 0, newP.keys, newP.nEntries, nEntriesToCopy);
				System.arraycopy(values, 0, newP.values, newP.nEntries, nEntriesToCopy);
				//move element forward to beginning of page
				System.arraycopy(keys, nEntriesToCopy, keys, 0, nEntries-nEntriesToCopy);
				System.arraycopy(values, nEntriesToCopy, values, 0, nEntries-nEntriesToCopy);
			} else {
				//make space on next page
				System.arraycopy(newP.keys, 0, newP.keys, nEntriesToCopy, newP.nEntries);
				System.arraycopy(newP.values, 0, newP.values, nEntriesToCopy, newP.nEntries);
				//insert element in next page
				System.arraycopy(keys, nEntriesToKeep, newP.keys, 0, nEntriesToCopy);
				System.arraycopy(values, nEntriesToKeep, newP.values, 0, nEntriesToCopy);
			}
			nEntries = (short) nEntriesToKeep;
			newP.nEntries = (short) (nEntriesToCopy + newP.nEntries);
			//New page and min key
			if (isNew || !isPrev) {
				if (ind.isUnique()) {
					if (newP.keys[0] > key) {
						put(key, value);
					} else {
						newP.put(key, value);
					}
				} else {
					//why doesn't this work??? Because addSubPage needs the new keys already in the 
					//page
	//				parent.addSubPage(newP, newP.keys[0], newP.values[0]);
	//				locatePageForKey(key, value, false).put(key, value);
					if (newP.keys[0] > key || (newP.keys[0]==key && newP.values[0] > value)) {
						put(key, value);
					} else {
						newP.put(key, value);
					}
				}
			} else {
				if (ind.isUnique()) {
					if (keys[0] > key) {
						newP.put(key, value);
					} else {
						put(key, value);
					}
				} else {
					if (keys[0] > key || (keys[0]==key && values[0] > value)) {
						newP.put(key, value);
					} else {
						put(key, value);
					}
				}
			}
			if (isNew) {
				parent.addSubPage(newP, newP.keys[0], newP.values[0]);
			} else {
				//TODO probably not necessary
				newP.parent.updateKey(newP, newP.keys[0], newP.values[0]);
			}
			parent.updateKey(this, keys[0], values[0]);
		}
	}
822425
def increment(self, key, amount=1):
        
        payload = {
            key: {
                '__op': 'Increment',
                'amount': amount
                }
            }
        self.__class__.PUT(self._absolute_url, **payload)
        self.__dict__[key] += amount
863536
public void setKey(String key) {
        if (!isValidParamKey(key)) {
            throw ExceptionUtils.buildRuntime("param.key", key, "key can not start with "
                + RpcConstants.HIDE_KEY_PREFIX + " and " + RpcConstants.INTERNAL_KEY_PREFIX);
        }
        this.key = key;
    }
507678
private void addPendingChange(String key, JsonValue value) {
        if (this.pendingChanges == null) {
            this.pendingChanges = new JsonObject();
        }

        this.pendingChanges.set(key, value);
    }
911138
public final void set(String key, Object value) {
		try {
			this.mutex.acquire();
			if (value == null) {
				this.valueMap.remove(key);
			} else {
				this.valueMap.put(key, value);
			}
		} finally {
			try {
				this.mutex.release();
			} catch (Exception ignore) {
			}
		}
	}
1059741
public void put(Object key, Object value) {
    int weight = getWeight(key) + getWeight(value) + OVERHEAD;
    currentWeight += weight;
    if (cache.put(key, value == null ? NULL_VALUE : value) != null) {
      currentWeight -= weight;
    }
  }
1369060
static public void put(String key, Object o) {
        if (setContext()) {
            m_context.put(key, o);
        } else {
            m_defaultContext.put(key, o);
        }
    }
667104
public void addMeasure(Key key, int value) {

        if (key != null) {
            measures.put(key, value);
        } else {
            // TODO for now, we just ignore the value
        }
    }
1040641
public void increment(String name, int value) {
		Counter counter = get(name, CounterType.Increment);
		counter.setCount(counter.getCount() != null ? counter.getCount() + value : value);
		update();
	}
875961
public V put (K key, V value)
    {
        V result = _delegate.put(key, value);

        if (_tracking) {
            _seenKeys.add(key);
        }

        // avoid fruitless NOOPs
        if (result != value) {
            // updated our computed "size"
            _size += _sizer.computeSize(value);
            entryRemoved(result);
//         System.out.println("Added " + value + ": " + _size);
        }

        // flush if needed
        flush();

        return result;
    }
89329
public boolean updateOrigKey(Map<String,Object> propOrig, String strKey, String strOrigValue, String strNewValue, boolean bOrigChange)
    {
            if (((strNewValue != null) && (!strNewValue.equals(strOrigValue)))
                || ((strNewValue == null) && (strOrigValue != null)))
        {   // If I am using the read value now (and it has changed from the orig value) change the orig value to the read value.
            bOrigChange = true;
            if (strNewValue != null)    
                propOrig.put(strKey, strNewValue);  // Original must reflect the read value in case it changes again.
            else
                propOrig.remove(strKey);  // Original must reflect the read value in case it changes again.
        }
        return bOrigChange;
    }
1045588
public void add(Param key, Object value) {
        // check to see if we have a default value and skip it
        if (defaults.containsKey(key) && defaults.get(key).equals(value)) {
            // We already have this value, so skip it
            return;
        }
        parameters.put(key, value);
    }
457727
public void put(Object key, Object value)
    {
        keyTable.put(key, value);
        valueTable.put(value, key);
    }
1285827
public int addKey(String key) {
        JdkUtils.requireNonNull(key);
        int nextIndex = keys.size();
        final Integer mapIndex = JdkUtils.putIfAbsent(keys, key, nextIndex);
        return mapIndex == null ? nextIndex : mapIndex;
    }