Stores given key-value mapping if no restrictions are violated by them.
@param key mapping key.
@param value mapping value.
@throws IllegalArgumentException if the given key is {@code null} or if value is neither of correct type nor of String type.
482798
public void put(T key, Object value) {
        data.put(key, ensureValueCorrectness(key, value));
    }
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();
        }
    }
559879
private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value) {
        processKeyValue(properties, stringKey, value, false);
    }
981989
@Override
    public void put(String key, String value) throws Exception{
        try {
            Object valueObj = datatypeMap.get(key).parse(value);
            generator.writeObjectField(key, valueObj);
        } catch (ParseException e) {
            throw new ParseException("Value " + value + " is not type "
                    + datatypeMap.get(key).name(), 0);
        } catch (Exception e) {
            String msg = e.getMessage();
            if (!msg.contains("missing value")) {
                throw new Exception(msg);
            }
        }       
        
    }
196626
public void pushUlterior(String key, Object value) {
        assertArgumentNotNull("key", key);
        assertArgumentNotNull("value", value);
        if (pushedUlteriorMap == null) {
            pushedUlteriorMap = new LinkedHashMap<String, Object>(4);
        }
        pushedUlteriorMap.put(key, value);
    }
907832
public void set(PropertyKey key, String value) {
    put(key, value, Source.RUNTIME);
  }
1338876
private void set(String key, String... values) {
            String value = get(values);
            
            if (value != null) {
                put(getLabel(key), value);
            }
        }
225373
public <T> void put(@NonNull String key, @NonNull T value) {
    Preconditions.checkNotNull(value, VALUE_IS_NULL);
    put(key, value, TypeToken.fromValue(value));
  }
292289
public void put(String key, Character value) {
		if (this.compiledStatement != null) {
			if (value == null) {
				this.compiledStatement.bindNull(compiledStatementBindIndex++);
			} else {
				compiledStatement.bindLong(compiledStatementBindIndex++, Character.getNumericValue(value));
			}
		} else if (values != null) {
			values.put(key, Character.getNumericValue(value));
			return;
		}

		names.add(key);
		// values.put(key, value);
		args.add(value);
		valueType.add(ParamType.CHARACTER);
	}
1329188
public void put(K key, V value)
    {
        this.lock.writeLock().lock();

        try {
            this.map.put(key, new SoftReference<>(value));
        } finally {
            this.lock.writeLock().unlock();
        }
    }
632834
public synchronized void setValue(String name, String value) {
        if (map == null) {
            map = new HashMap<String,String>();
        }
        map.put(name, value);
    }
1174545
public <T> void set(String key, T value) {
        data.put(key, value);
    }
433485
@Override
    public boolean containsKey(Object key) {
        if (key == null) {
            throw new NullPointerException();
        }
        
        CachedValue<K, V> entry = map.get(key);
        if (entry == null) {
            return false;
        }
        if (isValueExpired(entry)) {
            if (map.remove(key, entry)) {
                onValueRemove(entry);
                return false;
            }
            return containsKey(key);
        }
        return true;
    }
1305846
public void setString(@NotNull final String key, @NotNull final String value) {
        props.setProperty(key, value);
        LOGGER.debug("Setting: {}='{}'", key, value);
    }
633168
public void addProperty(String key, String value) {
        if (null == properties) {
            properties = new HashMap<>();
        }
        properties.put(key, value);
    }
241727
public void store(Object key, Object value) {
        getJdbcTemplate().update(getMergeSql(),
                                 new BeanPropertySqlParameterSource(value));
    }
104
public void setData(String key, String value) {
        QName qn = new QName("data-" + key);
        this.getOtherAttributes().put(qn, value);
    }