void checkLocalityGroups(String propChanged) throws AccumuloSecurityException, AccumuloException { if (LocalityGroupUtil.isLocalityGroupProperty(propChanged)) { try { LocalityGroupUtil.checkLocalityGroups(getSystemConfiguration().entrySet()); } catch (LocalityGroupConfigurationError | RuntimeException e) { LoggerFactory.getLogger(this.getClass()).warn("Changing '" + propChanged + "' resulted in bad locality group config. This may be a transient situation since " + "the config spreads over multiple properties. Setting properties in a different " + "order may help. Even though this warning was displayed, the property was updated. " + "Please check your config to ensure consistency.", e); } } }
private void checkLocalityGroups(String namespace, String propChanged) throws AccumuloException, NamespaceNotFoundException { if (LocalityGroupUtil.isLocalityGroupProperty(propChanged)) { Iterable<Entry<String,String>> allProps = getProperties(namespace); try { LocalityGroupUtil.checkLocalityGroups(allProps); } catch (LocalityGroupConfigurationError | RuntimeException e) { LoggerFactory.getLogger(this.getClass()).warn("Changing '" + propChanged + "' for namespace '" + namespace + "'resulted in bad locality group config. This may be a transient situation since the" + " config spreads over multiple properties. Setting properties in a different order " + "may help. Even though this warning was displayed, the property was updated. Please " + "check your config to ensure consistency.", e); } } } }
void checkLocalityGroups(String tableName, String propChanged) throws AccumuloException, TableNotFoundException { if (LocalityGroupUtil.isLocalityGroupProperty(propChanged)) { Iterable<Entry<String,String>> allProps = getProperties(tableName); try { LocalityGroupUtil.checkLocalityGroups(allProps); } catch (LocalityGroupConfigurationError | RuntimeException e) { LoggerFactory.getLogger(this.getClass()).warn("Changing '" + propChanged + "' for table '" + tableName + "' resulted in bad locality group config. This may be a transient situation since " + "the config spreads over multiple properties. Setting properties in a different " + "order may help. Even though this warning was displayed, the property was updated. " + "Please check your config to ensure consistency.", e); } } }
/** * Sets additional properties to be applied to tables created with this configuration. Additional * calls to this method replace properties set by previous calls. * * @param props * additional properties to add to the table when it is created * @return this */ public NewTableConfiguration setProperties(Map<String,String> props) { checkArgument(props != null, "properties is null"); checkDisjoint(props, samplerProps, "sampler"); checkDisjoint(props, summarizerProps, "summarizer"); checkDisjoint(props, localityProps, "locality group"); checkDisjoint(props, iteratorProps, "iterator"); checkTableProperties(props); try { LocalityGroupUtil.checkLocalityGroups(props.entrySet()); } catch (LocalityGroupConfigurationError e) { throw new IllegalArgumentException(e); } this.properties = new HashMap<>(props); return this; }