private String isZooKeeperMutable(Property prop) { if (!Property.isValidZooPropertyKey(prop.getKey())) return "no"; if (Property.isFixedZooPropertyKey(prop)) return "yes but requires restart of the " + prop.getKey().split("[.]")[0]; return "yes"; }
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); }
private String _get(Property property) { String key = property.getKey(); String value = null; if (Property.isValidZooPropertyKey(key)) { value = getRaw(key); } if (value == null || !property.getType().isValidFormat(value)) { if (value != null) log.error("Using parent value for {} due to improperly formatted {}: {}", key, property.getType(), value); value = parent.get(property); } return value; }
String key = entry.getKey(); String value = entry.getValue(); if (Property.isValidZooPropertyKey(key)) { SystemPropUtil.setSystemProperty(context, key, value); log.info("Uploaded - {} = {}", key, Property.isSensitive(key) ? "<hidden>" : value);
Shell.log.debug("Successfully deleted namespace configuration option."); } else { if (!Property.isValidZooPropertyKey(property)) { Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there."); Shell.log.debug("Successfully set table configuration option."); } else { if (!Property.isValidZooPropertyKey(property)) { throw new BadArgumentException("Property cannot be modified in zookeeper", fullCommand, fullCommand.indexOf(property));
private String isZooKeeperMutable(Property prop) { if (!Property.isValidZooPropertyKey(prop.getKey())) return "no"; if (Property.isFixedZooPropertyKey(prop)) return "yes but requires restart of the " + prop.getKey().split("[.]")[0]; return "yes"; }
private String _get(Property property) { String key = property.getKey(); String value = null; if (Property.isValidZooPropertyKey(key)) { value = getRaw(key); } if (value == null || !property.getType().isValidFormat(value)) { if (value != null) log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value); value = parent.get(property); } return value; }
private String _get(Property property) { String key = property.getKey(); String value = null; if (Property.isValidZooPropertyKey(key)) { value = get(key); } if (value == null || !property.getType().isValidFormat(value)) { if (value != null) log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value); value = parent.get(property); } return value; }
public static boolean setSystemProperty(String property, String value) throws KeeperException, InterruptedException { Property p = Property.getPropertyByKey(property); if ((p != null && !p.getType().isValidFormat(value)) || !Property.isValidZooPropertyKey(property)) return false; // create the zk node for this property and set it's data to the specified value String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZCONFIG + "/" + property; ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); return true; }
public static boolean setSystemProperty(String property, String value) throws KeeperException, InterruptedException { if (!Property.isValidZooPropertyKey(property)) { IllegalArgumentException iae = new IllegalArgumentException( "Zookeeper property is not mutable: " + property);
Shell.log.debug("Successfully deleted namespace configuration option."); } else { if (!Property.isValidZooPropertyKey(property)) { Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there."); Shell.log.debug("Successfully set table configuration option."); } else { if (!Property.isValidZooPropertyKey(property)) { throw new BadArgumentException("Property cannot be modified in zookeeper", fullCommand, fullCommand.indexOf(property));