docs: @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();
          }
      }