/** * Verifies a configured option is a legal class and has a required base class. * * @param confOption * The Property key name * @param className * The Property value, the string representation of a class to be loaded * @param requiredBaseClass * The base class required for the className */ private static void verifyValidClassName(String confOption, String className, Class<?> requiredBaseClass) { try { ConfigurationTypeHelper.getClassInstance(null, className, requiredBaseClass); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IOException e) { fatal(confOption + " has an invalid class name: " + className); } catch (ClassCastException e) { fatal(confOption + " must implement " + requiredBaseClass + ", but the configured class does not: " + className); } } }
private static void verifyPropertyTypes(PropertyType type, Property... properties) { for (Property prop : properties) if (prop.getType() != type) fatal("Unexpected property type (" + prop.getType() + " != " + type + ")"); }
private static void checkTimeDuration(Property prop, String value, CheckTimeDuration chk) { verifyPropertyTypes(PropertyType.TIMEDURATION, prop); if (!chk.check(ConfigurationTypeHelper.getTimeInMillis(value))) fatal(PREFIX + chk.getDescription(prop)); }
log.warn(PREFIX + "unrecognized property key (" + key + ")"); else if (prop.getType() == PropertyType.PREFIX) fatal(PREFIX + "incomplete property key (" + key + ")"); else if (!prop.getType().isValidFormat(value)) fatal(PREFIX + "improperly formatted value for key (" + key + ", type=" + prop.getType() + ") : " + value);
private static void verifyPropertyTypes(PropertyType type, Property... properties) { for (Property prop : properties) if (prop.getType() != type) fatal("Unexpected property type (" + prop.getType() + " != " + type + ")"); }
private static void checkTimeDuration(Property prop, String value, CheckTimeDuration chk) { verifyPropertyTypes(PropertyType.TIMEDURATION, prop); if (!chk.check(AccumuloConfiguration.getTimeInMillis(value))) fatal(PREFIX + chk.getDescription(prop)); }
log.warn(PREFIX + "unrecognized property key (" + key + ")"); else if (prop.getType() == PropertyType.PREFIX) fatal(PREFIX + "incomplete property key (" + key + ")"); else if (!prop.getType().isValidFormat(value)) fatal(PREFIX + "improperly formatted value for key (" + key + ", type=" + prop.getType() + ") : " + value);