public class FluoConfiguration extends SimpleConfiguration
Constructor and Description |
---|
FluoConfiguration() |
FluoConfiguration(File propertiesFile) |
FluoConfiguration(InputStream in) |
FluoConfiguration(Map<String,String> map) |
FluoConfiguration(SimpleConfiguration other) |
Modifier and Type | Method and Description |
---|---|
FluoConfiguration |
addObserver(ObserverSpecification oconf)
Deprecated.
since 1.1.0. Replaced by
setObserverProvider(String) and
getObserverProvider() |
FluoConfiguration |
addObservers(Iterable<ObserverSpecification> observers)
Deprecated.
since 1.1.0. Replaced by
setObserverProvider(String) and
getObserverProvider() |
FluoConfiguration |
clearObservers()
Deprecated.
since 1.1.0. Replaced by
setObserverProvider(String) and
getObserverProvider() |
String |
getAccumuloClasspath()
Deprecated.
|
String |
getAccumuloInstance()
Gets the Apache Accumulo instance property value "fluo.accumulo.instance"
|
String |
getAccumuloJars()
Gets CSV list of jar paths to provide to Accumulo
|
String |
getAccumuloPassword()
Gets the Apache Accumulo password property value "fluo.accumulo.password"
|
String |
getAccumuloTable()
Gets the value of the property "fluo.accumulo.table"
|
String |
getAccumuloUser()
Gets the value of the property "fluo.accumulo.user"
|
String |
getAccumuloZookeepers()
Gets the value of the property "fluo.accumulo.zookeepers" if it is set, else returns
the value of the property "localhost"
|
SimpleConfiguration |
getAppConfiguration() |
String |
getApplicationName()
Returns the application name after verification to avoid characters Zookeeper does not like in
nodes and Hadoop does not like in HDFS paths.
|
String |
getAppZookeepers()
Returns the zookeeper application name string.
|
SimpleConfiguration |
getClientConfiguration()
Returns a SimpleConfiguration clientConfig with properties set from this configuration
|
int |
getClientRetryTimeout()
Deprecated.
|
int |
getConnectionRetryTimeout()
Returns the value of the property "fluo.connection.retry.timeout.ms" if it is set, else
the default value of -1.
|
static SimpleConfiguration |
getDefaultConfiguration()
Returns configuration with all Fluo properties set to their default.
|
String |
getDfsRoot()
Gets the value of property "fluo.dfs.root" if set, otherwise gets the default
""
|
String |
getInstanceZookeepers()
Gets the value of the property "fluo.connection.zookeepers" and if not set returns the
default "localhost/fluo"
|
int |
getLoaderQueueSize()
Gets the loader queue size.
|
int |
getLoaderThreads()
Returns the number of threads each loader runs.
|
String |
getMiniDataDir()
Gets the value of the property "fluo.mini.data.dir" if set, otherwise gets the value of
the property "${env:FLUO_HOME}/mini"
|
boolean |
getMiniStartAccumulo()
Gets the value of the property "fluo.mini.start.accumulo" if set, else gets the value
of true
|
String |
getObserverInitDir()
Gets directory where observer jars can be found for initialization
|
String |
getObserverJarsUrl()
Gets the directory where observer jars can be found
|
String |
getObserverProvider() |
List<ObserverSpecification> |
getObserverSpecifications()
Deprecated.
since 1.1.0. Replaced by
setObserverProvider(String) and
getObserverProvider() |
SimpleConfiguration |
getReporterConfiguration(String reporter) |
long |
getTransactionRollbackTime()
Gets the transaction rollback time, in milliseconds.
|
int |
getWorkerThreads()
Gets the value of the property "fluo.worker.num.threads" if set otherwise returns
10
|
String |
getZookeeperSecret()
Get the secret configured to access data in zookeeper.
|
int |
getZookeeperTimeout()
Gets the value of the property "fluo.connection.zookeeper.timeout" and if not set
returns the default 30000
|
boolean |
hasRequiredAdminProps()
Returns true if required properties for FluoAdmin are set
|
boolean |
hasRequiredClientProps()
Returns true if required properties for FluoClient are set
|
boolean |
hasRequiredConnectionProps()
Verifies that the connection properties are set and and valid.
|
boolean |
hasRequiredMiniFluoProps()
Returns true if required properties for MiniFluo are set
|
boolean |
hasRequiredOracleProps()
Returns true if required properties for Oracle are set
|
boolean |
hasRequiredWorkerProps()
Returns true if required properties for Worker are set
|
void |
print()
Logs all properties
|
FluoConfiguration |
setAccumuloClasspath(String path)
Deprecated.
|
FluoConfiguration |
setAccumuloInstance(String accumuloInstance)
Sets the Apache Accumulo instance property "fluo.accumulo.instance"
|
FluoConfiguration |
setAccumuloJars(String path)
Sets paths to jars to provide to Accumulo.
|
FluoConfiguration |
setAccumuloPassword(String accumuloPassword)
Sets the Apache Accumulo password property "fluo.accumulo.password"
|
FluoConfiguration |
setAccumuloTable(String table)
Sets Accumulo table.
|
FluoConfiguration |
setAccumuloUser(String accumuloUser)
Sets the value of the property "fluo.accumulo.user"
|
FluoConfiguration |
setAccumuloZookeepers(String zookeepers)
Sets the value of the property "fluo.accumulo.zookeepers"
|
FluoConfiguration |
setApplicationName(String applicationName)
Sets the "fluo.connection.application.name"
|
FluoConfiguration |
setClientRetryTimeout(int timeoutMs)
Deprecated.
|
FluoConfiguration |
setConnectionRetryTimeout(int timeoutMS)
Sets the connection retry timeout property "fluo.connection.retry.timeout.ms" in
milliseconds.
|
static void |
setDefaultConfiguration(SimpleConfiguration config)
Sets all Fluo properties to their default in the given configuration.
|
FluoConfiguration |
setDfsRoot(String dfsRoot)
Sets the root for the Hadoop DFS value in property "fluo.dfs.root"
|
FluoConfiguration |
setInstanceZookeepers(String zookeepers)
Sets the value of the property "fluo.connection.zookeepers"
|
FluoConfiguration |
setLoaderQueueSize(int queueSize)
Sets the queue size for the loader.
|
FluoConfiguration |
setLoaderThreads(int numThreads)
Sets the non negative number of threads each loader runs.
|
FluoConfiguration |
setMiniDataDir(String dataDir)
Sets the value of the property "fluo.mini.data.dir"
|
FluoConfiguration |
setMiniStartAccumulo(boolean startAccumulo)
Set the value of the property "fluo.mini.start.accumulo"
|
FluoConfiguration |
setObserverInitDir(String observerDir)
Sets directory where observers jars can found for initialization
|
FluoConfiguration |
setObserverJarsUrl(String observerJarsUrl)
Sets URL to directory where observer jars can be found
|
void |
setObserverProvider(Class<? extends ObserverProvider> clazz)
Calls
setObserverProvider(String) with the class name. |
void |
setObserverProvider(String className)
Configure the observer provider that Fluo workers will use.
|
FluoConfiguration |
setTransactionRollbackTime(long time,
TimeUnit tu)
Sets the transaction rollback time, in milliseconds.
|
FluoConfiguration |
setWorkerThreads(int numThreads)
Sets the number of worker threads, must be positive.
|
void |
setZookeeperSecret(String secret)
Setting this before initializing an application will cause Fluo to lock down Zookeeper such
that this secret is required to read data from zookeeper.
|
FluoConfiguration |
setZookeeperTimeout(int timeout)
Sets the value of the property "fluo.connection.zookeeper.timeout"
|
void |
validate() |
clear, clearProperty, containsKey, equals, getBoolean, getBoolean, getInt, getInt, getKeys, getKeys, getLong, getLong, getRawString, getString, getString, hashCode, load, load, orElse, save, save, setProperty, setProperty, setProperty, setProperty, subset, toMap, toString
public static final String FLUO_PREFIX
@Deprecated public static final String CLIENT_APPLICATION_NAME_PROP
@Deprecated public static final String CLIENT_ACCUMULO_PASSWORD_PROP
@Deprecated public static final String CLIENT_ACCUMULO_USER_PROP
@Deprecated public static final String CLIENT_ACCUMULO_INSTANCE_PROP
@Deprecated public static final String CLIENT_ACCUMULO_ZOOKEEPERS_PROP
@Deprecated public static final String CLIENT_ZOOKEEPER_TIMEOUT_PROP
@Deprecated public static final String CLIENT_ZOOKEEPER_CONNECT_PROP
@Deprecated public static final String CLIENT_RETRY_TIMEOUT_MS_PROP
@Deprecated public static final int CLIENT_ZOOKEEPER_TIMEOUT_DEFAULT
@Deprecated public static final String CLIENT_ACCUMULO_ZOOKEEPERS_DEFAULT
@Deprecated public static final String CLIENT_ZOOKEEPER_CONNECT_DEFAULT
@Deprecated public static final int CLIENT_RETRY_TIMEOUT_MS_DEFAULT
public static final String CONNECTION_PREFIX
public static final String CONNECTION_APPLICATION_NAME_PROP
public static final String CONNECTION_ZOOKEEPER_TIMEOUT_PROP
public static final String CONNECTION_ZOOKEEPER_SECRET
public static final String CONNECTION_ZOOKEEPERS_PROP
public static final String CONNECTION_RETRY_TIMEOUT_MS_PROP
public static final int CONNECTION_ZOOKEEPER_TIMEOUT_DEFAULT
public static final String CONNECTION_ZOOKEEPERS_DEFAULT
public static final int CONNECTION_RETRY_TIMEOUT_MS_DEFAULT
public static final String ACCUMULO_INSTANCE_PROP
public static final String ACCUMULO_TABLE_PROP
public static final String ACCUMULO_PASSWORD_PROP
public static final String ACCUMULO_USER_PROP
public static final String ACCUMULO_ZOOKEEPERS_PROP
public static final String ACCUMULO_JARS_PROP
public static final String ACCUMULO_ZOOKEEPERS_DEFAULT
public static final String ACCUMULO_JARS_DEFAULT
public static final String DFS_ROOT_PROP
public static final String DFS_ROOT_DEFAULT
@Deprecated public static final String ADMIN_ACCUMULO_TABLE_PROP
@Deprecated public static final String ADMIN_ACCUMULO_CLASSPATH_PROP
@Deprecated public static final String ADMIN_ACCUMULO_CLASSPATH_DEFAULT
public static final String WORKER_NUM_THREADS_PROP
public static final int WORKER_NUM_THREADS_DEFAULT
public static final String LOADER_NUM_THREADS_PROP
public static final String LOADER_QUEUE_SIZE_PROP
public static final int LOADER_NUM_THREADS_DEFAULT
public static final int LOADER_QUEUE_SIZE_DEFAULT
public static final String MINI_START_ACCUMULO_PROP
public static final String MINI_DATA_DIR_PROP
public static final boolean MINI_START_ACCUMULO_DEFAULT
public static final String MINI_DATA_DIR_DEFAULT
public static final String OBSERVER_PREFIX
public static final String OBSERVER_PROVIDER
public static final String OBSERVER_INIT_DIR_PROP
public static final String OBSERVER_JARS_URL_PROP
public static final String OBSERVER_PROVIDER_DEFAULT
public static final String OBSERVER_INIT_DIR_DEFAULT
public static final String OBSERVER_JARS_URL_DEFAULT
public static final String TRANSACTION_PREFIX
public static final String TRANSACTION_ROLLBACK_TIME_PROP
public static final long TRANSACTION_ROLLBACK_TIME_DEFAULT
public static final String REPORTER_PREFIX
public static final String APP_PREFIX
public FluoConfiguration()
public FluoConfiguration(SimpleConfiguration other)
public FluoConfiguration(InputStream in)
public FluoConfiguration(File propertiesFile)
public void validate()
public FluoConfiguration setApplicationName(String applicationName)
applicationName
- Must not be nullpublic String getApplicationName()
Gets the value of the property "fluo.connection.application.name" if set
NoSuchElementException
- if the property has not been setpublic FluoConfiguration setInstanceZookeepers(String zookeepers)
zookeepers
- The instance to use, must not be null.public String getInstanceZookeepers()
public String getAppZookeepers()
public FluoConfiguration setZookeeperTimeout(int timeout)
timeout
- This must be a positive integerpublic int getZookeeperTimeout()
public String getZookeeperSecret()
Gets the value of the property "fluo.connection.zookeeper.secret"
public void setZookeeperSecret(String secret)
Sets the value of the property "fluo.connection.zookeeper.secret"
@Deprecated public FluoConfiguration setClientRetryTimeout(int timeoutMs)
@Deprecated public int getClientRetryTimeout()
public FluoConfiguration setConnectionRetryTimeout(int timeoutMS)
public int getConnectionRetryTimeout()
public FluoConfiguration setAccumuloInstance(String accumuloInstance)
accumuloInstance
- The instance to connect to, must not be emptypublic String getAccumuloInstance()
public FluoConfiguration setAccumuloUser(String accumuloUser)
accumuloUser
- The user name to use, must not be null.public String getAccumuloUser()
public FluoConfiguration setAccumuloPassword(String accumuloPassword)
accumuloPassword
- The password to use, must not be null.public String getAccumuloPassword()
NoSuchElementException
- if "fluo.accumulo.password" is not setpublic FluoConfiguration setAccumuloZookeepers(String zookeepers)
zookeepers
- Must not be nullpublic String getAccumuloZookeepers()
public FluoConfiguration setAccumuloTable(String table)
Sets the value of the property "fluo.accumulo.table"
public String getAccumuloTable()
@Deprecated public FluoConfiguration setAccumuloClasspath(String path)
@Deprecated public String getAccumuloClasspath()
public FluoConfiguration setAccumuloJars(String path)
Sets the value of the property "fluo.accumulo.jars"
path
- CSV list of paths, must not be nullpublic String getAccumuloJars()
Gets the value of the property "fluo.accumulo.jars" if set, "" else
public FluoConfiguration setDfsRoot(String dfsRoot)
dfsRoot
- The path for the dfs root eg: hdfs://host:port/path note: may not be empty.public String getDfsRoot()
public FluoConfiguration setWorkerThreads(int numThreads)
numThreads
- The number of threads to use, must be positivepublic int getWorkerThreads()
@Deprecated public List<ObserverSpecification> getObserverSpecifications()
setObserverProvider(String)
and
getObserverProvider()
public void setObserverProvider(String className)
Sets the property of "fluo.observer.provider"
className
- Name of a class that implements ObserverProvider
. Must be non-null and
non-empty.public void setObserverProvider(Class<? extends ObserverProvider> clazz)
setObserverProvider(String)
with the class name.public FluoConfiguration setObserverInitDir(String observerDir)
Sets the value of the property "fluo.observer.init.dir"
observerDir
- Path to directory, must not be nullpublic String getObserverInitDir()
Gets the value of the property "fluo.observer.init.dir" if set, "" otherwise
public FluoConfiguration setObserverJarsUrl(String observerJarsUrl)
Sets the value of the property "fluo.observer.jars.url"
observerJarsUrl
- URL to observer jars directory, must not be nullpublic String getObserverJarsUrl()
Gets the value of the property "fluo.observer.jars.url" if set, "" otherwise
public String getObserverProvider()
ObserverProvider
class name. If one was not configured, returns
""@Deprecated public FluoConfiguration addObserver(ObserverSpecification oconf)
setObserverProvider(String)
and
getObserverProvider()
ObserverSpecification
to the configuration using a unique integer prefix thats
not currently in use.@Deprecated public FluoConfiguration addObservers(Iterable<ObserverSpecification> observers)
setObserverProvider(String)
and
getObserverProvider()
@Deprecated public FluoConfiguration clearObservers()
setObserverProvider(String)
and
getObserverProvider()
public FluoConfiguration setTransactionRollbackTime(long time, TimeUnit tu)
Sets the value of the property "fluo.tx.rollback.time"
time
- A long representation of the duration, must be positivetu
- The TimeUnit to usepublic long getTransactionRollbackTime()
Gets the value of the property "fluo.tx.rollback.time" if set, 300000L otherwise
public FluoConfiguration setLoaderThreads(int numThreads)
Sets the value of the property "fluo.loader.num.threads"
numThreads
- Must be positivepublic int getLoaderThreads()
Gets the value of the property "fluo.loader.num.threads" if set, 10 otherwise
public FluoConfiguration setLoaderQueueSize(int queueSize)
Sets the value of the property "fluo.loader.queue.size"
queueSize
- The non negative size of the queue.public int getLoaderQueueSize()
Gets the value of the property "fluo.loader.queue.size" if set, 10 otherwise
public SimpleConfiguration getReporterConfiguration(String reporter)
reporter
- The name of the reporter to get configuration for, i.e. console, jmx, graphite.public SimpleConfiguration getAppConfiguration()
FluoClient.getAppConfiguration()
and ObserverProvider.Context.getAppConfiguration()
public FluoConfiguration setMiniStartAccumulo(boolean startAccumulo)
startAccumulo
- Flag to mini start Accumulo or notpublic boolean getMiniStartAccumulo()
public FluoConfiguration setMiniDataDir(String dataDir)
dataDir
- The path to the directory, must not be nullpublic String getMiniDataDir()
public void print()
public boolean hasRequiredConnectionProps()
public boolean hasRequiredClientProps()
public boolean hasRequiredAdminProps()
public boolean hasRequiredOracleProps()
public boolean hasRequiredWorkerProps()
public boolean hasRequiredMiniFluoProps()
public SimpleConfiguration getClientConfiguration()
public static SimpleConfiguration getDefaultConfiguration()
public static void setDefaultConfiguration(SimpleConfiguration config)
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.