Implementation of :meth:`~simplekv.KeyValueStore.put`.

        Will store the value in the backing store. After a successful or
        unsuccessful store, the cache will be invalidated by deleting the key
        from it.
174164
def put(self, key, data):
        
        try:
            return self._dstore.put(key, data)
        finally:
            self.cache.delete(key)
264765
public Object put(Object key, Object value) {
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[PUT], "key = " + key);
        }
        String id = (String) key;
        BackedSession backedSess = (BackedSession) value;
        // in the unlikely case the session is created and invalidated on the same http request
        if (!backedSess.isValid()) {
            if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[PUT], "Session is not valid.  Returning null");
            }
            return null;
        }

        // needToInsert is set to false when successfully persisted.  Will stay true if insertSession fails because db is down.
        if (backedSess.needToInsert) {
            insertSession(backedSess);
            if (backedSess.isNew()) {
                if (!backedSess.removingSessionFromCache) {
                    //                if ((!backedSess.removingSessionFromCache) && (!backedSess.duplicateIdDetected)) { // since duplicate keys can't be detected in lWAS, backedSess.duplicateIdDetected is always true
                    BackedSession thrownOutSess = (BackedSession) superPut(id, backedSess);
                    if (thrownOutSess != null)
                        this.passivateSession(thrownOutSess);
                }
            } else {
                updateSession(backedSess);
            }
        } else {
            updateSession(backedSess);
        }
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[PUT]);
        }
        return null;
    }
727627
static public Value put( Key key, Value val, Futures fs, boolean dontCache ) {
    assert key != null;
    assert val==null || val._key == key:"non-matching keys " + key + " != " + val._key;
    while( true ) {
      Value old = Value.STORE_get(key); // Raw-get: do not lazy-manifest if overwriting
      Value res = DputIfMatch(key,val,old,fs,dontCache);
      if( res == old ) return old; // PUT is globally visible now?
      if( val != null && val._key != key ) key = val._key;
    }
  }
1182745
public void put(@NotNull final PersistentStoreTransaction txn,
                    final long localId,
                    @NotNull final ByteIterable value,
                    @Nullable final ByteIterable oldValue,
                    final int propertyId,
                    @NotNull final ComparableValueType type) {
        final Store valueIdx = getOrCreateValueIndex(txn, propertyId);
        final ByteIterable key = PropertyKey.propertyKeyToEntry(new PropertyKey(localId, propertyId));
        final Transaction envTxn = txn.getEnvironmentTransaction();
        primaryStore.put(envTxn, key, value);
        final ByteIterable secondaryValue = LongBinding.longToCompressedEntry(localId);
        boolean success;
        if (oldValue == null) {
            success = allPropsIndex.put(envTxn, IntegerBinding.intToCompressedEntry(propertyId), secondaryValue);
        } else {
            success = deleteFromStore(envTxn, valueIdx, secondaryValue, createSecondaryKeys(store.getPropertyTypes(), oldValue, type));
        }
        if (success) {
            for (final ByteIterable secondaryKey : createSecondaryKeys(store.getPropertyTypes(), value, type)) {
                valueIdx.put(envTxn, secondaryKey, secondaryValue);
            }
        }
        checkStatus(success, "Failed to put");
    }
1043127
def put(self, key, value):
    '''
    '''
    if value is None:
      self.delete(key)
    else:
      self._collection(key)[key] = value
134697
def put(self, key, value):
    '''
    '''
    key = self._service_key(key)
    self._service_ops['put'](key, value)
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;
    }
1089579
def put(self, key, value):
    ''''''
    return self.child_datastore.put(self._transform(key), value)
1363263
def remove_key(self, store_key):
        
        if store_key in self._undefined_keys:
            del self._undefined_keys[store_key]
        if store_key in self._reverse_index:
            for value in self._reverse_index[store_key]:
                self._index[value].remove(store_key)
            del self._reverse_index[store_key]
365975
public synchronized final V put(K key, V value) {
        if (key == null) {
            throw new NullPointerException("key == null");
        } else if (value == null) {
            throw new NullPointerException("value == null");
        }

        V previous = map.put(key, value);
        trimToSize(maxSize);
        return previous;
    }
1018029
public Phrase put(String key, CharSequence value) {
    if (!keys.contains(key)) {
      throw new IllegalArgumentException("Invalid key: " + key);
    }
    if (value == null) {
      throw new IllegalArgumentException("Null value for '" + key + "'");
    }
    keysToValues.put(key, value);

    // Invalidate the cached formatted text.
    formatted = null;
    return this;
  }
735120
@SuppressWarnings("unchecked")
    public void put(String key, Versioned<Object> value) {
        // acquire write lock
        writeLock.lock();

        try {
            if(this.storeNames.contains(key) || key.equals(STORES_KEY)) {

                // Check for backwards compatibility
                List<StoreDefinition> storeDefinitions = (List<StoreDefinition>) value.getValue();
                StoreDefinitionUtils.validateSchemasAsNeeded(storeDefinitions);

                // If the put is on the entire stores.xml key, delete the
                // additional stores which do not exist in the specified
                // stores.xml
                Set<String> storeNamesToDelete = new HashSet<String>();
                for(String storeName: this.storeNames) {
                    storeNamesToDelete.add(storeName);
                }

                // Add / update the list of store definitions specified in the
                // value
                StoreDefinitionsMapper mapper = new StoreDefinitionsMapper();

                // Update the STORES directory and the corresponding entry in
                // metadata cache
                Set<String> specifiedStoreNames = new HashSet<String>();
                for(StoreDefinition storeDef: storeDefinitions) {
                    specifiedStoreNames.add(storeDef.getName());
                    String storeDefStr = mapper.writeStore(storeDef);
                    Versioned<String> versionedValueStr = new Versioned<String>(storeDefStr,
                                                                                value.getVersion());
                    this.storeDefinitionsStorageEngine.put(storeDef.getName(),
                                                           versionedValueStr,
                                                           "");

                    // Update the metadata cache
                    this.metadataCache.put(storeDef.getName(),
                                           new Versioned<Object>(storeDefStr, value.getVersion()));
                }

                if(key.equals(STORES_KEY)) {
                    storeNamesToDelete.removeAll(specifiedStoreNames);
                    resetStoreDefinitions(storeNamesToDelete);
                }

                // Re-initialize the store definitions
                initStoreDefinitions(value.getVersion());

                // Update routing strategies
                updateRoutingStrategies(getCluster(), getStoreDefList());

            } else if(METADATA_KEYS.contains(key)) {
                // try inserting into inner store first
                putInner(key, convertObjectToString(key, value));

                // cache all keys if innerStore put succeeded
                metadataCache.put(key, value);

                // do special stuff if needed
                if(CLUSTER_KEY.equals(key)) {
                    updateRoutingStrategies((Cluster) value.getValue(), getStoreDefList());
                } else if(NODE_ID_KEY.equals(key)) {
                    initNodeId(getNodeIdNoLock());
                } else if(SYSTEM_STORES_KEY.equals(key))
                    throw new VoldemortException("Cannot overwrite system store definitions");

            } else {
                throw new VoldemortException("Unhandled Key:" + key + " for MetadataStore put()");
            }
        } finally {
            writeLock.unlock();
        }
    }
45218
public T putCache(String key, T value) {
		return cache.put(key, value);
	}
1158839
public void put(String key, ArrayList<String> value) {
    Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
    while (it.hasNext()) {
      Pair<String, ArrayList<String>> pair = it.next();
      if (key.equals(pair.first)) {
        pair.second = value;
        return;
      }
    }
    store.add(new Pair<>(key, value));
  }
83213
def put(self, key, val, minutes):
        
        minutes = self._get_minutes(minutes)

        if minutes is not None:
            self._store.put(key, val, minutes)
710158
static public Value put( Key key, Iced v, Futures fs,boolean dontCache ) {
    return put(key,new Value(key,v),fs,dontCache);
  }
667782
public int put(final K key, final int value)
    {
        if (value == missingValue)
        {
            throw new IllegalArgumentException("cannot accept missingValue");
        }

        int oldValue = missingValue;
        @DoNotSub final int mask = values.length - 1;
        @DoNotSub int index = Hashing.hash(key, mask);

        while (missingValue != values[index])
        {
            if (key.equals(keys[index]))
            {
                oldValue = values[index];
                break;
            }

            index = ++index & mask;
        }

        if (missingValue == oldValue)
        {
            ++size;
            keys[index] = key;
        }

        values[index] = value;

        if (size > resizeThreshold)
        {
            increaseCapacity();
        }

        return oldValue;
    }