public static boolean isPropertyValid(String property, String value) { Property p = Property.getPropertyByKey(property); return (p == null || p.getType().isValidFormat(value)) && Property.isValidTablePropertyKey(property); }
public static boolean isPropertyValid(String property, String value) { Property p = Property.getPropertyByKey(property); return (p == null || p.getType().isValidFormat(value)) && Property.isValidTablePropertyKey(property); }
/** * This helper method provides an AccumuloConfiguration object constructed from the Accumulo * defaults, and overridden with Accumulo properties that have been stored in the Job's * configuration. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @since 1.6.0 */ public static AccumuloConfiguration getAccumuloConfiguration(Class<?> implementingClass, Configuration conf) { String prefix = enumToConfKey(implementingClass, Opts.ACCUMULO_PROPERTIES) + "."; ConfigurationCopy acuConf = new ConfigurationCopy(DefaultConfiguration.getInstance()); for (Entry<String,String> entry : conf) if (entry.getKey().startsWith(prefix)) { String propString = entry.getKey().substring(prefix.length()); Property prop = Property.getPropertyByKey(propString); if (prop != null) { acuConf.set(prop, entry.getValue()); } else if (Property.isValidTablePropertyKey(propString)) { acuConf.set(propString, entry.getValue()); } else { throw new IllegalArgumentException("Unknown accumulo file property " + propString); } } return acuConf; }
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, IOException, ClassNotFoundException, NamespaceExistsException, NamespaceNotFoundException { if (createNamespaceOptCopyConfig == null) { getOptions(); } String namespace = cl.getArgs()[0]; shellState.getAccumuloClient().namespaceOperations().create(namespace); // Copy options if flag was set Iterable<Entry<String,String>> configuration = null; if (cl.hasOption(createNamespaceOptCopyConfig.getOpt())) { String copy = cl.getOptionValue(createNamespaceOptCopyConfig.getOpt()); if (shellState.getAccumuloClient().namespaceOperations().exists(namespace)) { configuration = shellState.getAccumuloClient().namespaceOperations().getProperties(copy); } } if (configuration != null) { for (Entry<String,String> entry : configuration) { if (Property.isValidTablePropertyKey(entry.getKey())) { shellState.getAccumuloClient().namespaceOperations().setProperty(namespace, entry.getKey(), entry.getValue()); } } } return 0; }
if (!Property.isValidTablePropertyKey(property)) { Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there."); Shell.log.debug("Successfully deleted table configuration option."); } else if (namespace != null) { if (!Property.isValidTablePropertyKey(property)) { Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there."); if (!Property.isValidTablePropertyKey(property)) { throw new BadArgumentException("Invalid per-table property.", fullCommand, fullCommand.indexOf(property)); Shell.log.debug("Successfully set table configuration option."); } else if (namespace != null) { if (!Property.isValidTablePropertyKey(property)) { throw new BadArgumentException("Invalid per-table property.", fullCommand, fullCommand.indexOf(property)); continue; if ((tableName != null || namespace != null) && !Property.isValidTablePropertyKey(key)) { continue; if ((tableName != null || namespace != null) && !Property.isValidTablePropertyKey(key)) { continue;
.tableOperations().getProperties(cl.getOptionValue(createTableOptCopyConfig.getOpt())); for (Entry<String,String> entry : configuration) { if (Property.isValidTablePropertyKey(entry.getKey())) { shellState.getAccumuloClient().tableOperations().setProperty(tableName, entry.getKey(), entry.getValue());
public static boolean isPropertyValid(String property, String value) { Property p = Property.getPropertyByKey(property); if ((p != null && !p.getType().isValidFormat(value)) || !Property.isValidTablePropertyKey(property)) return false; return true; }
public static boolean isPropertyValid(String property, String value) { Property p = Property.getPropertyByKey(property); if ((p != null && !p.getType().isValidFormat(value)) || !Property.isValidTablePropertyKey(property)) return false; return true; }
public static boolean isPropertyValid(String property, String value) { Property p = Property.getPropertyByKey(property); if ((p != null && !p.getType().isValidFormat(value)) || !Property.isValidTablePropertyKey(property)) return false; return true; }
/** * This helper method provides an AccumuloConfiguration object constructed from the Accumulo * defaults, and overridden with Accumulo properties that have been stored in the Job's * configuration. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @since 1.6.0 */ public static AccumuloConfiguration getAccumuloConfiguration(Class<?> implementingClass, Configuration conf) { String prefix = enumToConfKey(implementingClass, Opts.ACCUMULO_PROPERTIES) + "."; ConfigurationCopy acuConf = new ConfigurationCopy( AccumuloConfiguration.getDefaultConfiguration()); for (Entry<String,String> entry : conf) if (entry.getKey().startsWith(prefix)) { String propString = entry.getKey().substring(prefix.length()); Property prop = Property.getPropertyByKey(propString); if (prop != null) { acuConf.set(prop, entry.getValue()); } else if (Property.isValidTablePropertyKey(propString)) { acuConf.set(propString, entry.getValue()); } else { throw new IllegalArgumentException("Unknown accumulo file property " + propString); } } return acuConf; }
/** * This helper method provides an AccumuloConfiguration object constructed from the Accumulo * defaults, and overridden with Accumulo properties that have been stored in the Job's * configuration. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @since 1.6.0 */ public static AccumuloConfiguration getAccumuloConfiguration(Class<?> implementingClass, Configuration conf) { String prefix = enumToConfKey(implementingClass, Opts.ACCUMULO_PROPERTIES) + "."; ConfigurationCopy acuConf = new ConfigurationCopy(DefaultConfiguration.getInstance()); for (Entry<String,String> entry : conf) if (entry.getKey().startsWith(prefix)) { String propString = entry.getKey().substring(prefix.length()); Property prop = Property.getPropertyByKey(propString); if (prop != null) { acuConf.set(prop, entry.getValue()); } else if (Property.isValidTablePropertyKey(propString)) { acuConf.set(propString, entry.getValue()); } else { throw new IllegalArgumentException("Unknown accumulo file property " + propString); } } return acuConf; }
/** * This helper method provides an AccumuloConfiguration object constructed from the Accumulo * defaults, and overridden with Accumulo properties that have been stored in the Job's * configuration. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @since 1.6.0 */ public static AccumuloConfiguration getAccumuloConfiguration(Class<?> implementingClass, Configuration conf) { String prefix = enumToConfKey(implementingClass, Opts.ACCUMULO_PROPERTIES) + "."; ConfigurationCopy acuConf = new ConfigurationCopy(DefaultConfiguration.getInstance()); for (Entry<String,String> entry : conf) if (entry.getKey().startsWith(prefix)) { String propString = entry.getKey().substring(prefix.length()); Property prop = Property.getPropertyByKey(propString); if (prop != null) { acuConf.set(prop, entry.getValue()); } else if (Property.isValidTablePropertyKey(propString)) { acuConf.set(propString, entry.getValue()); } else { throw new IllegalArgumentException("Unknown accumulo file property " + propString); } } return acuConf; }
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, IOException, ClassNotFoundException, NamespaceExistsException, NamespaceNotFoundException { if (createNamespaceOptCopyConfig == null) { getOptions(); } String namespace = cl.getArgs()[0]; shellState.getConnector().namespaceOperations().create(namespace); // Copy options if flag was set Iterable<Entry<String,String>> configuration = null; if (cl.hasOption(createNamespaceOptCopyConfig.getOpt())) { String copy = cl.getOptionValue(createNamespaceOptCopyConfig.getOpt()); if (shellState.getConnector().namespaceOperations().exists(namespace)) { configuration = shellState.getConnector().namespaceOperations().getProperties(copy); } } if (configuration != null) { for (Entry<String,String> entry : configuration) { if (Property.isValidTablePropertyKey(entry.getKey())) { shellState.getConnector().namespaceOperations().setProperty(namespace, entry.getKey(), entry.getValue()); } } } return 0; }
if (!Property.isValidTablePropertyKey(property)) { Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there."); Shell.log.debug("Successfully deleted table configuration option."); } else if (namespace != null) { if (!Property.isValidTablePropertyKey(property)) { Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there."); if (!Property.isValidTablePropertyKey(property)) { throw new BadArgumentException("Invalid per-table property.", fullCommand, fullCommand.indexOf(property)); Shell.log.debug("Successfully set table configuration option."); } else if (namespace != null) { if (!Property.isValidTablePropertyKey(property)) { throw new BadArgumentException("Invalid per-table property.", fullCommand, fullCommand.indexOf(property)); continue; if ((tableName != null || namespace != null) && !Property.isValidTablePropertyKey(key)) { continue; if ((tableName != null || namespace != null) && !Property.isValidTablePropertyKey(key)) { continue;
.tableOperations().getProperties(cl.getOptionValue(createTableOptCopyConfig.getOpt())); for (Entry<String,String> entry : configuration) { if (Property.isValidTablePropertyKey(entry.getKey())) { shellState.getConnector().tableOperations().setProperty(tableName, entry.getKey(), entry.getValue());