code: private void updateRoutingStrategies(Cluster cluster, List<StoreDefinition> storeDefs) {
          // acquire write lock
          writeLock.lock();
          try {
              VectorClock clock = new VectorClock();
              if(metadataCache.containsKey(ROUTING_STRATEGY_KEY))
                  clock = (VectorClock) metadataCache.get(ROUTING_STRATEGY_KEY).getVersion();
  
              logger.info("Updating routing strategy for all stores");
              HashMap<String, StoreDefinition> storeDefMap = makeStoreDefinitionMap(storeDefs);
              HashMap<String, RoutingStrategy> routingStrategyMap = createRoutingStrategyMap(cluster,
                                                                                             storeDefMap);
              this.metadataCache.put(ROUTING_STRATEGY_KEY,
                                     new Versioned<Object>(routingStrategyMap,
                                                           clock.incremented(getNodeId(),
                                                                             System.currentTimeMillis())));
  
              for(String storeName: storeNameTolisteners.keySet()) {
                  RoutingStrategy updatedRoutingStrategy = routingStrategyMap.get(storeName);
                  if(updatedRoutingStrategy != null) {
                      try {
                          for(MetadataStoreListener listener: storeNameTolisteners.get(storeName)) {
                              listener.updateRoutingStrategy(updatedRoutingStrategy);
                              listener.updateStoreDefinition(storeDefMap.get(storeName));
                          }
                      } catch(Exception e) {
                          if(logger.isEnabledFor(Level.WARN))
                              logger.warn(e, e);
                      }
                  }
  
              }
          } finally {
              writeLock.unlock();
          }
      }
docs: Changes to cluster OR store definition metadata results in routing
  strategies changing. These changes need to be propagated to all the
  listeners.
  
  @param cluster The updated cluster metadata
  @param storeDefs The updated list of store definition