private ConfigurationDocGen(PrintStream doc) { this.doc = doc; for (Property prop : Property.values()) { this.sortedProps.put(prop.getKey(), prop); } }
org.apache.hadoop.conf.Configuration hadoopConf = new org.apache.hadoop.conf.Configuration(); hadoopConf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credProvider); for (Property property : Property.values()) { if (property.isSensitive()) { char[] value = CredentialProviderFactoryShim.getValueFromCredentialProvider(hadoopConf,
public static boolean setSystemProperty(ServerContext context, String property, String value) throws KeeperException, InterruptedException { if (!Property.isValidZooPropertyKey(property)) { IllegalArgumentException iae = new IllegalArgumentException( "Zookeeper property is not mutable: " + property); log.debug("Attempted to set zookeeper property. It is not mutable", iae); throw iae; } // Find the property taking prefix into account Property foundProp = null; for (Property prop : Property.values()) { if (prop.getType() == PropertyType.PREFIX && property.startsWith(prop.getKey()) || prop.getKey().equals(property)) { foundProp = prop; break; } } if ((foundProp == null || (foundProp.getType() != PropertyType.PREFIX && !foundProp.getType().isValidFormat(value)))) { IllegalArgumentException iae = new IllegalArgumentException( "Ignoring property " + property + " it is either null or in an invalid format"); log.debug("Attempted to set zookeeper property. Value is either null or invalid", iae); throw iae; } // create the zk node for this property and set it's data to the specified value String zPath = context.getZooKeeperRoot() + Constants.ZCONFIG + "/" + property; return context.getZooReaderWriter().putPersistentData(zPath, value.getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); }
@Override public void registerCompletion(final Token root, final Map<Command.CompletionSet,Set<String>> completionSet) { final Token cmd = new Token(getName()); final Token sub = new Token("-" + setOpt.getOpt()); for (Property p : Property.values()) { if (!(p.getKey().endsWith(".")) && !p.isExperimental()) { sub.addSubcommand(new Token(p.toString())); } } cmd.addSubcommand(sub); root.addSubcommand(cmd); }
ConfigurationDocGen(PrintStream doc) { this.doc = doc; this.prefixes = new ArrayList<>(); this.sortedProps = new TreeMap<>(); for (Property prop : Property.values()) { if (prop.isExperimental()) continue; if (prop.getType() == PropertyType.PREFIX) this.prefixes.add(prop); else this.sortedProps.put(prop.getKey(), prop); } }
for (Property prop : Property.values()) { if (PropertyType.PREFIX == prop.getType() && property.startsWith(prop.getKey()) || prop.getKey().equals(property)) {
@Override public void registerCompletion(final Token root, final Map<Command.CompletionSet,Set<String>> completionSet) { final Token cmd = new Token(getName()); final Token sub = new Token("-" + setOpt.getOpt()); for (Property p : Property.values()) { if (!(p.getKey().endsWith(".")) && !p.isExperimental()) { sub.addSubcommand(new Token(p.toString())); } } cmd.addSubcommand(sub); root.addSubcommand(cmd); }