/** * Returns configuration with all Fluo properties set to their default. NOTE - some properties do * not have defaults and will not be set. */ public static SimpleConfiguration getDefaultConfiguration() { SimpleConfiguration config = new SimpleConfiguration(); setDefaultConfiguration(config); return config; }
/** * Call this to configure a KryoFactory type before initializing Fluo. */ public static void setKryoFactory(FluoConfiguration config, String factoryType) { config.getAppConfiguration().setProperty(KRYO_FACTORY_PROP, factoryType); }
/** * Sets URL to directory where observer jars can be found * <p> * Sets the value of the property {@value #OBSERVER_JARS_URL_PROP} * * @param observerJarsUrl URL to observer jars directory, must not be null * @since 1.2.0 */ public FluoConfiguration setObserverJarsUrl(String observerJarsUrl) { setProperty(OBSERVER_JARS_URL_PROP, verifyNotNull(OBSERVER_JARS_URL_PROP, observerJarsUrl)); return this; }
Options(String mapId, SimpleConfiguration appConfig) { this.mapId = mapId; this.numBuckets = appConfig.getInt(PREFIX + mapId + ".buckets"); this.combinerType = appConfig.getString(PREFIX + mapId + ".combiner"); this.keyType = appConfig.getString(PREFIX + mapId + ".key"); this.valueType = appConfig.getString(PREFIX + mapId + ".val"); this.updateObserverType = appConfig.getString(PREFIX + mapId + ".updateObserver", null); this.bufferSize = appConfig.getLong(PREFIX + mapId + ".bufferSize", DEFAULT_BUFFER_SIZE); this.bucketsPerTablet = appConfig.getInt(PREFIX + mapId + ".bucketsPerTablet", DEFAULT_BUCKETS_PER_TABLET); }
/** * Sets the {@value #CONNECTION_APPLICATION_NAME_PROP} * * @param applicationName Must not be null */ public FluoConfiguration setApplicationName(String applicationName) { verifyApplicationName(applicationName); setProperty(CONNECTION_APPLICATION_NAME_PROP, applicationName); return this; }
/** * Set the value of the property {@value #MINI_START_ACCUMULO_PROP} * * @param startAccumulo Flag to mini start Accumulo or not */ public FluoConfiguration setMiniStartAccumulo(boolean startAccumulo) { setProperty(MINI_START_ACCUMULO_PROP, startAccumulo); return this; }
/** * 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, ""); }
public SimpleConfiguration getConfiguration() { if (config == null) { config = new SimpleConfiguration(configMap); } return config; }
/** * Sets Accumulo table. This property only needs to be set for FluoAdmin as it will be stored and * retrieved from Zookeeper for clients. * <p> * Sets the value of the property {@value #ACCUMULO_TABLE_PROP} */ public FluoConfiguration setAccumuloTable(String table) { return setNonEmptyString(ACCUMULO_TABLE_PROP, table); }
/** * Sets the number of worker threads, must be positive. The default is * {@value #WORKER_NUM_THREADS_DEFAULT} threads. Sets this value in the property * {@value #WORKER_NUM_THREADS_PROP} * * @param numThreads The number of threads to use, must be positive */ public FluoConfiguration setWorkerThreads(int numThreads) { return setPositiveInt(WORKER_NUM_THREADS_PROP, numThreads); }
/** * Gets the value of the property {@value #CONNECTION_ZOOKEEPER_TIMEOUT_PROP} and if not set * returns the default {@value #CONNECTION_ZOOKEEPER_TIMEOUT_DEFAULT} */ public int getZookeeperTimeout() { return getDepPositiveInt(CONNECTION_ZOOKEEPER_TIMEOUT_PROP, CLIENT_ZOOKEEPER_TIMEOUT_PROP, CONNECTION_ZOOKEEPER_TIMEOUT_DEFAULT); }
/** * Gets the transaction rollback time, in milliseconds. * <p> * Gets the value of the property {@value #TRANSACTION_ROLLBACK_TIME_PROP} if set, * {@value #TRANSACTION_ROLLBACK_TIME_DEFAULT} otherwise * * @return A positive long representation of the rollback time. */ public long getTransactionRollbackTime() { return getPositiveLong(TRANSACTION_ROLLBACK_TIME_PROP, TRANSACTION_ROLLBACK_TIME_DEFAULT); }
/** * @param reporter The name of the reporter to get configuration for, i.e. console, jmx, graphite. * @return A subset of this configuration using the prefix {@value #REPORTER_PREFIX} with the * reporter parameter appended. Any change made to subset will be reflected in this * configuration, but with the prefix added. */ public SimpleConfiguration getReporterConfiguration(String reporter) { return subset(REPORTER_PREFIX + "." + reporter); }
/** * Gets the value of the property {@value #ACCUMULO_ZOOKEEPERS_PROP} if it is set, else returns * the value of the property {@value #ACCUMULO_ZOOKEEPERS_DEFAULT} */ public String getAccumuloZookeepers() { return getDepNonEmptyString(ACCUMULO_ZOOKEEPERS_PROP, CLIENT_ACCUMULO_ZOOKEEPERS_PROP, ACCUMULO_ZOOKEEPERS_DEFAULT); }
@Override public void save(FluoConfiguration fluoConf) { SimpleConfiguration appConfig = fluoConf.getAppConfiguration(); // TODO Auto-generated method stub appConfig.setProperty(PREFIX + id + ".instance", instance); appConfig.setProperty(PREFIX + id + ".zookeepers", zookeepers); appConfig.setProperty(PREFIX + id + ".user", user); appConfig.setProperty(PREFIX + id + ".password", password); appConfig.setProperty(PREFIX + id + ".table", table); }
/** * Sets paths to jars to provide to Accumulo. If not set, Fluo will find jars on classpath * <p> * Sets the value of the property {@value #ACCUMULO_JARS_PROP} * * @param path CSV list of paths, must not be null * @since 1.2.0 */ public FluoConfiguration setAccumuloJars(String path) { setProperty(ACCUMULO_JARS_PROP, verifyNotNull(ACCUMULO_JARS_PROP, path)); return this; }
/** * Returns configuration with all Fluo properties set to their default. NOTE - some properties do * not have defaults and will not be set. */ public static SimpleConfiguration getDefaultConfiguration() { SimpleConfiguration config = new SimpleConfiguration(); setDefaultConfiguration(config); return config; }
/** * 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); }
/** * Sets the root for the Hadoop DFS value in property {@value #DFS_ROOT_PROP} * * @param dfsRoot The path for the dfs root eg: hdfs://host:port/path note: may not be empty. * @since 1.2.0 */ public FluoConfiguration setDfsRoot(String dfsRoot) { return setNonEmptyString(DFS_ROOT_PROP, dfsRoot); }
/** * Sets the value of the property {@value #CONNECTION_ZOOKEEPER_TIMEOUT_PROP} * * @param timeout This must be a positive integer */ public FluoConfiguration setZookeeperTimeout(int timeout) { return setPositiveInt(CONNECTION_ZOOKEEPER_TIMEOUT_PROP, timeout); }