/** * Gets directory where observer jars can be found for initialization * <p> * Gets the value of the property {@value #OBSERVER_INIT_DIR_PROP} if set, * {@value #OBSERVER_INIT_DIR_DEFAULT} otherwise * * @return Path to directory * @since 1.2.0 */ public String getObserverInitDir() { return getString(OBSERVER_INIT_DIR_PROP, OBSERVER_INIT_DIR_DEFAULT); }
/** * @return The configured {@link ObserverProvider} class name. If one was not configured, returns * {@value #OBSERVER_PROVIDER_DEFAULT} * @since 1.1.0 */ public String getObserverProvider() { return getString(OBSERVER_PROVIDER, OBSERVER_PROVIDER_DEFAULT); }
/** * Gets the value of property {@value #DFS_ROOT_PROP} if set, otherwise gets the default * {@value #DFS_ROOT_DEFAULT} * * @since 1.2.0 */ public String getDfsRoot() { return getString(DFS_ROOT_PROP, DFS_ROOT_DEFAULT); }
/** * Get the secret configured to access data in zookeeper. If the secret is an empty string, then * nothing in zookeeper is locked down. * * <p> * Gets the value of the property {@value #CONNECTION_ZOOKEEPER_SECRET} * * @since 1.2.0 */ public String getZookeeperSecret() { return getString(CONNECTION_ZOOKEEPER_SECRET, ""); }
/** * Gets the directory where observer jars can be found * <p> * Gets the value of the property {@value #OBSERVER_JARS_URL_PROP} if set, * {@value #OBSERVER_JARS_URL_DEFAULT} otherwise * * @since 1.2.0 */ public String getObserverJarsUrl() { return getString(OBSERVER_JARS_URL_PROP, OBSERVER_JARS_URL_DEFAULT); }
/** * Gets CSV list of jar paths to provide to Accumulo * <p> * Gets the value of the property {@value #ACCUMULO_JARS_PROP} if set, * {@value #ACCUMULO_JARS_DEFAULT} else * * @since 1.2.0 */ public String getAccumuloJars() { return getString(ACCUMULO_JARS_PROP, ACCUMULO_JARS_DEFAULT); }
/** * Gets CSV list of jar paths to provide to Accumulo * <p> * Gets the value of the property {@value #ACCUMULO_JARS_PROP} if set, * {@value #ACCUMULO_JARS_DEFAULT} else * * @since 1.2.0 */ public String getAccumuloJars() { return getString(ACCUMULO_JARS_PROP, ACCUMULO_JARS_DEFAULT); }
/** * Gets directory where observer jars can be found for initialization * <p> * Gets the value of the property {@value #OBSERVER_INIT_DIR_PROP} if set, * {@value #OBSERVER_INIT_DIR_DEFAULT} otherwise * * @return Path to directory * @since 1.2.0 */ public String getObserverInitDir() { return getString(OBSERVER_INIT_DIR_PROP, OBSERVER_INIT_DIR_DEFAULT); }
/** * Gets the directory where observer jars can be found * <p> * Gets the value of the property {@value #OBSERVER_JARS_URL_PROP} if set, * {@value #OBSERVER_JARS_URL_DEFAULT} otherwise * * @since 1.2.0 */ public String getObserverJarsUrl() { return getString(OBSERVER_JARS_URL_PROP, OBSERVER_JARS_URL_DEFAULT); }
/** * Get the secret configured to access data in zookeeper. If the secret is an empty string, then * nothing in zookeeper is locked down. * * <p> * Gets the value of the property {@value #CONNECTION_ZOOKEEPER_SECRET} * * @since 1.2.0 */ public String getZookeeperSecret() { return getString(CONNECTION_ZOOKEEPER_SECRET, ""); }
private String getNonEmptyString(String property, String defaultValue) { String value = getString(property, defaultValue); Objects.requireNonNull(value, property + " cannot be null"); Preconditions.checkArgument(!value.isEmpty(), property + " cannot be empty"); return value; }
private String getNonEmptyString(String property) { String value = getString(property); Objects.requireNonNull(value, property + " cannot be null"); Preconditions.checkArgument(!value.isEmpty(), property + " cannot be empty"); return value; }
public static Reservoir getConfiguredReservoir(FluoConfiguration config) { String clazz = config.getString(FluoConfigurationImpl.METRICS_RESERVOIR_PROP, HdrHistogramResetOnSnapshotReservoir.class.getName()); try { return Class.forName(clazz).asSubclass(Reservoir.class).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new IllegalStateException(e); } }
public static NotificationFinder newNotificationFinder(FluoConfiguration conf) { String clazz = conf.getString(FluoConfigurationImpl.WORKER_FINDER_PROP, PartitionNotificationFinder.class.getName()); try { return Class.forName(clazz).asSubclass(NotificationFinder.class).newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException(e); } } }
private boolean verifyStringPropNotSet(String... keys) { for (String key : keys) { if (containsKey(key) && !getString(key).isEmpty()) { log.info(key + " should not be set"); return false; } } return true; }
private boolean verifyStringPropSet(String... keys) { for (String key : keys) { if (containsKey(key) && !getString(key).isEmpty()) { return true; } } log.info(keys[0] + " is not set"); return false; }
private boolean verifyStringPropNotSet(String... keys) { for (String key : keys) { if (containsKey(key) && !getString(key).isEmpty()) { log.info(key + " should not be set"); return false; } } return true; }
private boolean verifyStringPropSet(String... keys) { for (String key : keys) { if (containsKey(key) && !getString(key).isEmpty()) { return true; } } log.info(keys[0] + " is not set"); return false; }
private static <T> T getAndBuildClassWithConfig(SimpleConfiguration configuration, String classProp, String classDefault) { FluoConfiguration config = new FluoConfiguration(configuration); String clazz = config.getString(classProp, classDefault); Objects.requireNonNull(clazz, classProp + " cannot be null"); Preconditions.checkArgument(!clazz.isEmpty(), classProp + " cannot be empty"); return buildClassWithConfig(clazz, config); }
/** * Gets the Apache Accumulo password property value {@value #ACCUMULO_PASSWORD_PROP} * * @throws NoSuchElementException if {@value #ACCUMULO_PASSWORD_PROP} is not set */ public String getAccumuloPassword() { if (containsKey(ACCUMULO_PASSWORD_PROP)) { return verifyNotNull(ACCUMULO_PASSWORD_PROP, getString(ACCUMULO_PASSWORD_PROP)); } else if (containsKey(CLIENT_ACCUMULO_PASSWORD_PROP)) { return verifyNotNull(CLIENT_ACCUMULO_PASSWORD_PROP, getString(CLIENT_ACCUMULO_PASSWORD_PROP)); } throw new NoSuchElementException(ACCUMULO_PASSWORD_PROP + " is not set!"); }