Blocking call

@param key
with which to store data
@param value
Data value
@return Try with completed result of operation
188587
public Try<UploadResult, Throwable> putSync(String key, Object value) {
        return put(key, value).map(FluentFunctions.ofChecked(i -> i.waitForUploadResult()));
    }
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;
    }
1245306
private void blockIfNecessary() {
        if (diskPermits == null || diskLimit == Long.MAX_VALUE)
            return;
        try {
            diskPermits.acquire();
        } catch (InterruptedException e) {
            // don't want to re-interrupt so it won't cause SDK stream to be
            // closed in case the thread is reused for a different request
            throw new AbortedException(e);
        }
    }
689596
@SuppressWarnings("unchecked")
	public <T> T getSet(Object key, Object value) {
		Jedis jedis = getJedis();
		try {
			return (T)valueFromBytes(jedis.getSet(keyToBytes(key), valueToBytes(value)));
		}
		finally {close(jedis);}
	}
1004388
public <T> Future<Boolean> push(String k, T value) {
    Future<Boolean> rv = null;
    while (rv == null) {
      try {
        rv = client.set(k, expiration, value);
      } catch (IllegalStateException ex) {
        // Need to slow down a bit when we start getting rejections.
        try {
          if (rv != null) {
            rv.get(250, TimeUnit.MILLISECONDS);
          } else {
            Thread.sleep(250);
          }
        } catch (InterruptedException ie) {
          Thread.currentThread().interrupt();
        } catch (Exception e2) {
          // Ignore exceptions here. We're just trying to slow
          // down input.
        }
      }

    }
    return rv;
  }
48072
public static Object putIfAbsent(String key, Object value) {
        return value == null ? CONTEXT.remove(key) : CONTEXT.putIfAbsent(key, value);
    }
14115
public synchronized void touch(final Object key, final Object value) {
        remove(key);
        put(key, value);
    }
173019
@SuppressWarnings("unchecked")
    public M with(final String key, final String value) {
        put(key, value);
        return (M) this;
    }
645865
public void put(String key, Object value) {
        PER_THREAD_CONTEXTS.getUnchecked(Thread.currentThread()).put(key, value);
        mdcBridge.put(key, value);
    }
1182773
@Override
  public V putIfAbsent(K key, final V value) {
    return cache.invoke(key, new EntryProcessor<K, V, V>() {
      @Override
      public V process(MutableCacheEntry<K, V> e) {
        if (!e.exists()) {
          e.setValue(value);
          return null;
        }
        return e.getValue();
      }
    });
  }
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) {
			}
		}
	}
1099146
public final V get(K key) {
        if (key == null) {
            throw new NullPointerException("key == null");
        }

        V mapValue;
        synchronized (this) {
            mapValue = map.get(key);
            if (mapValue != null) {
                hitCount++;
                return mapValue;
            }
            missCount++;
        }

        /*
         * Attempt to create a value. This may take a long time, and the map
         * may be different when create() returns. If a conflicting value was
         * added to the map while create() was working, we leave that value in
         * the map and release the created value.
         */

        V createdValue = create(key);
        if (createdValue == null) {
            return null;
        }

        synchronized (this) {
            createCount++;
            mapValue = map.put(key, createdValue);

            if (mapValue != null) {
                // There was a conflict so undo that last put
                map.put(key, mapValue);
            } else {
                size += safeSizeOf(key, createdValue);
            }
        }

        if (mapValue != null) {
            entryRemoved(false, key, createdValue, mapValue);
            return mapValue;
        } else {
            trimToSize(maxSize);
            return createdValue;
        }
    }
487433
public void put(final String key, final Object value) {
        if (TASK_DIRECTORY_KEY.equals(key) && this.values.keySet().contains(TASK_DIRECTORY_KEY)) {
            // ensure that no one overwrites the task directory
            throw new IllegalArgumentException("Invalid key: " + key);
        }

        if (value == null) {
            throw new IllegalArgumentException(
                    "A null value was attempted to be put into the values object under key: " + key);
        }
        this.values.put(key, value);
    }
144217
private Object retrieveLock(String key)
   {
      Object lock = this.lockMap.get(key);
      if(lock == null)
      {
         lock = key;
         this.lockMap.put(key, lock);
      }
      return lock;
   }
13818
private void fail(final K key) {
        final String methodName = "fail(): ";
        stateLock.writeLock().lock();
        try {
            Integer index = actualIndices.remove(key);
            if (index == null)
                throw new IllegalArgumentException("unknown key: " + key);
            elements[index] = FAILED;
            // register that this key failed
            (failedKeys == null ? failedKeys = new ArrayList<K>(actualIndices.size() + 1) : failedKeys).add(key);
            checkForCompletion();
            if (tc.isDebugEnabled())
                Tr.debug(tc, methodName, "permanent fail for key " + key);
            stateLock.postEvent();
        } finally {
            stateLock.writeLock().unlock();
        }
    }
1084628
public void releasePutFromLoadLock(Object key, Lock lock) {
		if (trace) {
			log.tracef("releasePutFromLoadLock(%s#%s, %s)", cache.getName(), key, lock);
		}
		final PendingPutMap pending = (PendingPutMap) lock;
		if ( pending != null ) {
			if ( pending.canRemove() ) {
				pending.setRemoved();
				pendingPuts.remove( key, pending );
			}
			pending.releaseLock();
		}
	}
1231343
public B set(String key, int value) {
        this.data.put(key, value);
        return (B) this;
    }