/** * Internal function to notify listeners for meta config change events */ private void notifyMetaListeners(String key, String oldValue, String newValue) throws MetaException { for (MetaStoreEventListener listener : listeners) { listener.onConfigChange(new ConfigChangeEvent(this, key, oldValue, newValue)); } if (transactionalListeners.size() > 0) { // All the fields of this event are final, so no reason to create a new one for each // listener ConfigChangeEvent cce = new ConfigChangeEvent(this, key, oldValue, newValue); for (MetaStoreEventListener transactionalListener : transactionalListeners) { transactionalListener.onConfigChange(cce); } } }
/** * Internal function to notify listeners for meta config change events */ private void notifyMetaListeners(String key, String oldValue, String newValue) throws MetaException { for (MetaStoreEventListener listener : listeners) { listener.onConfigChange(new ConfigChangeEvent(this, key, oldValue, newValue)); } if (transactionalListeners.size() > 0) { // All the fields of this event are final, so no reason to create a new one for each // listener ConfigChangeEvent cce = new ConfigChangeEvent(this, key, oldValue, newValue); for (MetaStoreEventListener transactionalListener : transactionalListeners) { transactionalListener.onConfigChange(cce); } } }
@Override public void setMetaConf(String key, String value) throws MetaException { ConfVars confVar = HiveConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } String validate = confVar.validate(value); if (validate != null) { throw new MetaException("Invalid configuration value " + value + " for key " + key + " by " + validate); } Configuration configuration = getConf(); String oldValue = configuration.get(key); configuration.set(key, value); for (MetaStoreEventListener listener : listeners) { listener.onConfigChange(new ConfigChangeEvent(this, key, oldValue, value)); } }
@Override public void setMetaConf(String key, String value) throws MetaException { ConfVars confVar = HiveConf.getMetaConf(key); if (confVar == null) { throw new MetaException("Invalid configuration key " + key); } String validate = confVar.validate(value); if (validate != null) { throw new MetaException("Invalid configuration value " + value + " for key " + key + " by " + validate); } Configuration configuration = getConf(); String oldValue = configuration.get(key); configuration.set(key, value); for (MetaStoreEventListener listener : listeners) { listener.onConfigChange(new ConfigChangeEvent(this, key, oldValue, value)); } }