Class ConfigHelper


  • public class ConfigHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getInputColumnFamily​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getInputInitialAddress​(org.apache.hadoop.conf.Configuration conf)  
      static boolean getInputIsWide​(org.apache.hadoop.conf.Configuration conf)  
      static Pair<java.lang.String,​java.lang.String> getInputKeyRange​(org.apache.hadoop.conf.Configuration conf)
      The start and end token of the input key range as a pair.
      static java.lang.String getInputKeyspace​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getInputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getInputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf)  
      static IPartitioner getInputPartitioner​(org.apache.hadoop.conf.Configuration conf)  
      static int getInputSplitSize​(org.apache.hadoop.conf.Configuration conf)  
      static int getInputSplitSizeInMb​(org.apache.hadoop.conf.Configuration conf)
      cassandra.input.split.size will be used if the value is undefined or negative.
      static java.lang.String getOutputColumnFamily​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getOutputCompressionChunkLength​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getOutputCompressionClass​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getOutputInitialAddress​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.Integer getOutputInitialPort​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getOutputKeyspace​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getOutputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getOutputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf)  
      static boolean getOutputLocalDCOnly​(org.apache.hadoop.conf.Configuration conf)  
      static IPartitioner getOutputPartitioner​(org.apache.hadoop.conf.Configuration conf)  
      static int getRangeBatchSize​(org.apache.hadoop.conf.Configuration conf)
      The number of rows to request with each get range slices request.
      static java.lang.String getReadConsistencyLevel​(org.apache.hadoop.conf.Configuration conf)  
      static java.lang.String getWriteConsistencyLevel​(org.apache.hadoop.conf.Configuration conf)  
      static void setInputColumnFamily​(org.apache.hadoop.conf.Configuration conf, java.lang.String keyspace, java.lang.String columnFamily)
      Set the keyspace and column family for the input of this job.
      static void setInputColumnFamily​(org.apache.hadoop.conf.Configuration conf, java.lang.String keyspace, java.lang.String columnFamily, boolean widerows)
      Set the keyspace and column family for the input of this job.
      static void setInputInitialAddress​(org.apache.hadoop.conf.Configuration conf, java.lang.String address)  
      static void setInputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf, java.lang.String password)  
      static void setInputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf, java.lang.String username)  
      static void setInputKeyspaceUserNameAndPassword​(org.apache.hadoop.conf.Configuration conf, java.lang.String username, java.lang.String password)  
      static void setInputPartitioner​(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)  
      static void setInputRange​(org.apache.hadoop.conf.Configuration conf, java.lang.String startToken, java.lang.String endToken)
      Set the KeyRange to limit the rows.
      static void setInputSplitSize​(org.apache.hadoop.conf.Configuration conf, int splitsize)
      Set the size of the input split.
      static void setInputSplitSizeInMb​(org.apache.hadoop.conf.Configuration conf, int splitSizeMb)
      Set the size of the input split.
      static void setOutputColumnFamily​(org.apache.hadoop.conf.Configuration conf, java.lang.String columnFamily)
      Set the column family for the output of this job.
      static void setOutputColumnFamily​(org.apache.hadoop.conf.Configuration conf, java.lang.String keyspace, java.lang.String columnFamily)
      Set the column family for the output of this job.
      static void setOutputCompressionChunkLength​(org.apache.hadoop.conf.Configuration conf, java.lang.String length)  
      static void setOutputCompressionClass​(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)  
      static void setOutputInitialAddress​(org.apache.hadoop.conf.Configuration conf, java.lang.String address)  
      static void setOutputInitialPort​(org.apache.hadoop.conf.Configuration conf, java.lang.Integer port)  
      static void setOutputKeyspace​(org.apache.hadoop.conf.Configuration conf, java.lang.String keyspace)
      Set the keyspace for the output of this job.
      static void setOutputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf, java.lang.String password)  
      static void setOutputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf, java.lang.String username)  
      static void setOutputKeyspaceUserNameAndPassword​(org.apache.hadoop.conf.Configuration conf, java.lang.String username, java.lang.String password)  
      static void setOutputLocalDCOnly​(org.apache.hadoop.conf.Configuration conf, boolean localDCOnly)  
      static void setOutputPartitioner​(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)  
      static void setRangeBatchSize​(org.apache.hadoop.conf.Configuration conf, int batchsize)
      The number of rows to request with each get range slices request.
      static void setReadConsistencyLevel​(org.apache.hadoop.conf.Configuration conf, java.lang.String consistencyLevel)  
      static void setWriteConsistencyLevel​(org.apache.hadoop.conf.Configuration conf, java.lang.String consistencyLevel)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfigHelper

        public ConfigHelper()
    • Method Detail

      • setInputColumnFamily

        public static void setInputColumnFamily​(org.apache.hadoop.conf.Configuration conf,
                                                java.lang.String keyspace,
                                                java.lang.String columnFamily,
                                                boolean widerows)
        Set the keyspace and column family for the input of this job.
        Parameters:
        conf - Job configuration you are about to run
        keyspace -
        columnFamily -
        widerows -
      • setInputColumnFamily

        public static void setInputColumnFamily​(org.apache.hadoop.conf.Configuration conf,
                                                java.lang.String keyspace,
                                                java.lang.String columnFamily)
        Set the keyspace and column family for the input of this job.
        Parameters:
        conf - Job configuration you are about to run
        keyspace -
        columnFamily -
      • setOutputKeyspace

        public static void setOutputKeyspace​(org.apache.hadoop.conf.Configuration conf,
                                             java.lang.String keyspace)
        Set the keyspace for the output of this job.
        Parameters:
        conf - Job configuration you are about to run
        keyspace -
      • setOutputColumnFamily

        public static void setOutputColumnFamily​(org.apache.hadoop.conf.Configuration conf,
                                                 java.lang.String columnFamily)
        Set the column family for the output of this job.
        Parameters:
        conf - Job configuration you are about to run
        columnFamily -
      • setOutputColumnFamily

        public static void setOutputColumnFamily​(org.apache.hadoop.conf.Configuration conf,
                                                 java.lang.String keyspace,
                                                 java.lang.String columnFamily)
        Set the column family for the output of this job.
        Parameters:
        conf - Job configuration you are about to run
        keyspace -
        columnFamily -
      • setRangeBatchSize

        public static void setRangeBatchSize​(org.apache.hadoop.conf.Configuration conf,
                                             int batchsize)
        The number of rows to request with each get range slices request. Too big and you can either get timeouts when it takes Cassandra too long to fetch all the data. Too small and the performance will be eaten up by the overhead of each request.
        Parameters:
        conf - Job configuration you are about to run
        batchsize - Number of rows to request each time
      • getRangeBatchSize

        public static int getRangeBatchSize​(org.apache.hadoop.conf.Configuration conf)
        The number of rows to request with each get range slices request. Too big and you can either get timeouts when it takes Cassandra too long to fetch all the data. Too small and the performance will be eaten up by the overhead of each request.
        Parameters:
        conf - Job configuration you are about to run
        Returns:
        Number of rows to request each time
      • setInputSplitSize

        public static void setInputSplitSize​(org.apache.hadoop.conf.Configuration conf,
                                             int splitsize)
        Set the size of the input split. This affects the number of maps created, if the number is too small the overhead of each map will take up the bulk of the job time.
        Parameters:
        conf - Job configuration you are about to run
        splitsize - Number of partitions in the input split
      • getInputSplitSize

        public static int getInputSplitSize​(org.apache.hadoop.conf.Configuration conf)
      • setInputSplitSizeInMb

        public static void setInputSplitSizeInMb​(org.apache.hadoop.conf.Configuration conf,
                                                 int splitSizeMb)
        Set the size of the input split. setInputSplitSize value is used if this is not set. This affects the number of maps created, if the number is too small the overhead of each map will take up the bulk of the job time.
        Parameters:
        conf - Job configuration you are about to run
        splitSizeMb - Input split size in MB
      • getInputSplitSizeInMb

        public static int getInputSplitSizeInMb​(org.apache.hadoop.conf.Configuration conf)
        cassandra.input.split.size will be used if the value is undefined or negative.
        Parameters:
        conf - Job configuration you are about to run
        Returns:
        split size in MB or -1 if it is undefined.
      • setInputRange

        public static void setInputRange​(org.apache.hadoop.conf.Configuration conf,
                                         java.lang.String startToken,
                                         java.lang.String endToken)
        Set the KeyRange to limit the rows.
        Parameters:
        conf - Job configuration you are about to run
      • getInputKeyRange

        public static Pair<java.lang.String,​java.lang.String> getInputKeyRange​(org.apache.hadoop.conf.Configuration conf)
        The start and end token of the input key range as a pair. may be null if unset.
      • getInputKeyspace

        public static java.lang.String getInputKeyspace​(org.apache.hadoop.conf.Configuration conf)
      • getOutputKeyspace

        public static java.lang.String getOutputKeyspace​(org.apache.hadoop.conf.Configuration conf)
      • setInputKeyspaceUserNameAndPassword

        public static void setInputKeyspaceUserNameAndPassword​(org.apache.hadoop.conf.Configuration conf,
                                                               java.lang.String username,
                                                               java.lang.String password)
      • setInputKeyspaceUserName

        public static void setInputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf,
                                                    java.lang.String username)
      • getInputKeyspaceUserName

        public static java.lang.String getInputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf)
      • setInputKeyspacePassword

        public static void setInputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf,
                                                    java.lang.String password)
      • getInputKeyspacePassword

        public static java.lang.String getInputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf)
      • setOutputKeyspaceUserNameAndPassword

        public static void setOutputKeyspaceUserNameAndPassword​(org.apache.hadoop.conf.Configuration conf,
                                                                java.lang.String username,
                                                                java.lang.String password)
      • setOutputKeyspaceUserName

        public static void setOutputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf,
                                                     java.lang.String username)
      • getOutputKeyspaceUserName

        public static java.lang.String getOutputKeyspaceUserName​(org.apache.hadoop.conf.Configuration conf)
      • setOutputKeyspacePassword

        public static void setOutputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf,
                                                     java.lang.String password)
      • getOutputKeyspacePassword

        public static java.lang.String getOutputKeyspacePassword​(org.apache.hadoop.conf.Configuration conf)
      • getInputColumnFamily

        public static java.lang.String getInputColumnFamily​(org.apache.hadoop.conf.Configuration conf)
      • getOutputColumnFamily

        public static java.lang.String getOutputColumnFamily​(org.apache.hadoop.conf.Configuration conf)
      • getInputIsWide

        public static boolean getInputIsWide​(org.apache.hadoop.conf.Configuration conf)
      • getReadConsistencyLevel

        public static java.lang.String getReadConsistencyLevel​(org.apache.hadoop.conf.Configuration conf)
      • setReadConsistencyLevel

        public static void setReadConsistencyLevel​(org.apache.hadoop.conf.Configuration conf,
                                                   java.lang.String consistencyLevel)
      • getWriteConsistencyLevel

        public static java.lang.String getWriteConsistencyLevel​(org.apache.hadoop.conf.Configuration conf)
      • setWriteConsistencyLevel

        public static void setWriteConsistencyLevel​(org.apache.hadoop.conf.Configuration conf,
                                                    java.lang.String consistencyLevel)
      • getInputInitialAddress

        public static java.lang.String getInputInitialAddress​(org.apache.hadoop.conf.Configuration conf)
      • setInputInitialAddress

        public static void setInputInitialAddress​(org.apache.hadoop.conf.Configuration conf,
                                                  java.lang.String address)
      • setInputPartitioner

        public static void setInputPartitioner​(org.apache.hadoop.conf.Configuration conf,
                                               java.lang.String classname)
      • getInputPartitioner

        public static IPartitioner getInputPartitioner​(org.apache.hadoop.conf.Configuration conf)
      • getOutputInitialAddress

        public static java.lang.String getOutputInitialAddress​(org.apache.hadoop.conf.Configuration conf)
      • setOutputInitialPort

        public static void setOutputInitialPort​(org.apache.hadoop.conf.Configuration conf,
                                                java.lang.Integer port)
      • getOutputInitialPort

        public static java.lang.Integer getOutputInitialPort​(org.apache.hadoop.conf.Configuration conf)
      • setOutputInitialAddress

        public static void setOutputInitialAddress​(org.apache.hadoop.conf.Configuration conf,
                                                   java.lang.String address)
      • setOutputPartitioner

        public static void setOutputPartitioner​(org.apache.hadoop.conf.Configuration conf,
                                                java.lang.String classname)
      • getOutputPartitioner

        public static IPartitioner getOutputPartitioner​(org.apache.hadoop.conf.Configuration conf)
      • getOutputCompressionClass

        public static java.lang.String getOutputCompressionClass​(org.apache.hadoop.conf.Configuration conf)
      • getOutputCompressionChunkLength

        public static java.lang.String getOutputCompressionChunkLength​(org.apache.hadoop.conf.Configuration conf)
      • setOutputCompressionClass

        public static void setOutputCompressionClass​(org.apache.hadoop.conf.Configuration conf,
                                                     java.lang.String classname)
      • setOutputCompressionChunkLength

        public static void setOutputCompressionChunkLength​(org.apache.hadoop.conf.Configuration conf,
                                                           java.lang.String length)
      • getOutputLocalDCOnly

        public static boolean getOutputLocalDCOnly​(org.apache.hadoop.conf.Configuration conf)
      • setOutputLocalDCOnly

        public static void setOutputLocalDCOnly​(org.apache.hadoop.conf.Configuration conf,
                                                boolean localDCOnly)