Class FluoConfiguration

    • Constructor Detail

      • FluoConfiguration

        public FluoConfiguration()
      • FluoConfiguration

        public FluoConfiguration​(InputStream in)
      • FluoConfiguration

        public FluoConfiguration​(File propertiesFile)
      • FluoConfiguration

        public FluoConfiguration​(Map<String,​String> map)
    • Method Detail

      • validate

        public void validate()
      • getApplicationName

        public 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.

        Gets the value of the property "fluo.connection.application.name" if set

        Returns:
        The application name
        Throws:
        NoSuchElementException - if the property has not been set
      • getAppZookeepers

        public String getAppZookeepers()
        Returns the zookeeper application name string.
        Returns:
        The zookeeper application string.
      • getZookeeperSecret

        public String getZookeeperSecret()
        Get the secret configured to access data in zookeeper. If the secret is an empty string, then nothing in zookeeper is locked down.

        Gets the value of the property "fluo.connection.zookeeper.secret"

        Since:
        1.2.0
      • setZookeeperSecret

        public 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. If set to an empty string, then nothing in zookeeper will be locked down. This property defaults to an empty string.

        Sets the value of the property "fluo.connection.zookeeper.secret"

        Since:
        1.2.0
      • getClientRetryTimeout

        @Deprecated
        public int getClientRetryTimeout()
        Deprecated.
      • getConnectionRetryTimeout

        public int getConnectionRetryTimeout()
        Returns the value of the property "fluo.connection.retry.timeout.ms" if it is set, else the default value of -1. The integer returned represents milliseconds and is always positive.
        Since:
        1.2.0
      • setAccumuloInstance

        public FluoConfiguration setAccumuloInstance​(String accumuloInstance)
        Sets the Apache Accumulo instance property "fluo.accumulo.instance"
        Parameters:
        accumuloInstance - The instance to connect to, must not be empty
      • setAccumuloPassword

        public FluoConfiguration setAccumuloPassword​(String accumuloPassword)
        Sets the Apache Accumulo password property "fluo.accumulo.password"
        Parameters:
        accumuloPassword - The password to use, must not be null.
      • getAccumuloAuthorizations

        public String[] getAccumuloAuthorizations()
        Since:
        2.0.0
      • setAccumuloTable

        public FluoConfiguration setAccumuloTable​(String table)
        Sets Accumulo table. This property only needs to be set for FluoAdmin as it will be stored and retrieved from Zookeeper for clients.

        Sets the value of the property "fluo.accumulo.table"

      • setAccumuloJars

        public FluoConfiguration setAccumuloJars​(String path)
        Sets paths to jars to provide to Accumulo. If not set, Fluo will find jars on classpath

        Sets the value of the property "fluo.accumulo.jars"

        Parameters:
        path - CSV list of paths, must not be null
        Since:
        1.2.0
      • getAccumuloJars

        public String getAccumuloJars()
        Gets CSV list of jar paths to provide to Accumulo

        Gets the value of the property "fluo.accumulo.jars" if set, "" else

        Since:
        1.2.0
      • setDfsRoot

        public FluoConfiguration setDfsRoot​(String dfsRoot)
        Sets the root for the Hadoop DFS value in property "fluo.dfs.root"
        Parameters:
        dfsRoot - The path for the dfs root eg: hdfs://host:port/path note: may not be empty.
        Since:
        1.2.0
      • getDfsRoot

        public String getDfsRoot()
        Gets the value of property "fluo.dfs.root" if set, otherwise gets the default ""
        Since:
        1.2.0
      • setWorkerThreads

        public FluoConfiguration setWorkerThreads​(int numThreads)
        Sets the number of worker threads, must be positive. The default is 10 threads. Sets this value in the property "fluo.worker.num.threads"
        Parameters:
        numThreads - The number of threads to use, must be positive
      • getWorkerThreads

        public int getWorkerThreads()
        Gets the value of the property "fluo.worker.num.threads" if set otherwise returns 10
        Returns:
        The number of worker threads being used.
      • setObserverProvider

        public void setObserverProvider​(String className)
        Configure the observer provider that Fluo workers will use.

        Sets the property of "fluo.observer.provider"

        Parameters:
        className - Name of a class that implements ObserverProvider. Must be non-null and non-empty.
        Since:
        1.1.0
      • setObserverInitDir

        public FluoConfiguration setObserverInitDir​(String observerDir)
        Sets directory where observers jars can found for initialization

        Sets the value of the property "fluo.observer.init.dir"

        Parameters:
        observerDir - Path to directory, must not be null
        Since:
        1.2.0
      • getObserverInitDir

        public String getObserverInitDir()
        Gets directory where observer jars can be found for initialization

        Gets the value of the property "fluo.observer.init.dir" if set, "" otherwise

        Returns:
        Path to directory
        Since:
        1.2.0
      • setObserverJarsUrl

        public FluoConfiguration setObserverJarsUrl​(String observerJarsUrl)
        Sets URL to directory where observer jars can be found

        Sets the value of the property "fluo.observer.jars.url"

        Parameters:
        observerJarsUrl - URL to observer jars directory, must not be null
        Since:
        1.2.0
      • getObserverJarsUrl

        public String getObserverJarsUrl()
        Gets the directory where observer jars can be found

        Gets the value of the property "fluo.observer.jars.url" if set, "" otherwise

        Since:
        1.2.0
      • getObserverProvider

        public String getObserverProvider()
        Returns:
        The configured ObserverProvider class name. If one was not configured, returns ""
        Since:
        1.1.0
      • setTransactionRollbackTime

        public FluoConfiguration setTransactionRollbackTime​(long time,
                                                            TimeUnit tu)
        Sets the transaction rollback time, in milliseconds.

        Sets the value of the property "fluo.tx.rollback.time"

        Parameters:
        time - A long representation of the duration, must be positive
        tu - The TimeUnit to use
      • getTransactionRollbackTime

        public long getTransactionRollbackTime()
        Gets the transaction rollback time, in milliseconds.

        Gets the value of the property "fluo.tx.rollback.time" if set, 300000L otherwise

        Returns:
        A positive long representation of the rollback time.
      • setLoaderThreads

        public FluoConfiguration setLoaderThreads​(int numThreads)
        Sets the non negative number of threads each loader runs. If setting to zero, must also set the queue size to zero.

        Sets the value of the property "fluo.loader.num.threads"

        Parameters:
        numThreads - Must be positive
      • getLoaderThreads

        public int getLoaderThreads()
        Returns the number of threads each loader runs.

        Gets the value of the property "fluo.loader.num.threads" if set, 10 otherwise

        Returns:
        The number of threads each loader runs.
      • setLoaderQueueSize

        public FluoConfiguration setLoaderQueueSize​(int queueSize)
        Sets the queue size for the loader. This should be set to zero if the number of loader threads is zero.

        Sets the value of the property "fluo.loader.queue.size"

        Parameters:
        queueSize - The non negative size of the queue.
      • getLoaderQueueSize

        public int getLoaderQueueSize()
        Gets the loader queue size.

        Gets the value of the property "fluo.loader.queue.size" if set, 10 otherwise

        Returns:
        the loader queue size.
      • getReporterConfiguration

        public SimpleConfiguration getReporterConfiguration​(String reporter)
        Parameters:
        reporter - The name of the reporter to get configuration for, i.e. console, jmx, graphite.
        Returns:
        A subset of this configuration using the prefix "fluo.metrics.reporter" with the reporter parameter appended. Any change made to subset will be reflected in this configuration, but with the prefix added.
      • setMiniStartAccumulo

        public FluoConfiguration setMiniStartAccumulo​(boolean startAccumulo)
        Set the value of the property "fluo.mini.start.accumulo"
        Parameters:
        startAccumulo - Flag to mini start Accumulo or not
      • getMiniStartAccumulo

        public boolean getMiniStartAccumulo()
        Gets the value of the property "fluo.mini.start.accumulo" if set, else gets the value of true
      • print

        public void print()
        Logs all properties
      • hasRequiredConnectionProps

        public boolean hasRequiredConnectionProps()
        Verifies that the connection properties are set and and valid.
        Returns:
        A boolean if the requirements have been met.
      • hasRequiredClientProps

        public boolean hasRequiredClientProps()
        Returns true if required properties for FluoClient are set
      • hasRequiredAdminProps

        public boolean hasRequiredAdminProps()
        Returns true if required properties for FluoAdmin are set
      • hasRequiredOracleProps

        public boolean hasRequiredOracleProps()
        Returns true if required properties for Oracle are set
      • hasRequiredWorkerProps

        public boolean hasRequiredWorkerProps()
        Returns true if required properties for Worker are set
      • hasRequiredMiniFluoProps

        public boolean hasRequiredMiniFluoProps()
        Returns true if required properties for MiniFluo are set
      • getClientConfiguration

        public SimpleConfiguration getClientConfiguration()
        Returns a SimpleConfiguration clientConfig with properties set from this configuration
        Returns:
        SimpleConfiguration
      • getDefaultConfiguration

        public static SimpleConfiguration getDefaultConfiguration()
        Returns configuration with all Fluo properties set to their default. NOTE - some properties do not have defaults and will not be set.
      • setDefaultConfiguration

        public static void setDefaultConfiguration​(SimpleConfiguration config)
        Sets all Fluo properties to their default in the given configuration. NOTE - some properties do not have defaults and will not be set.