org.apache.cassandra.hadoop
Class ConfigHelper

java.lang.Object
  extended by org.apache.cassandra.hadoop.ConfigHelper

public class ConfigHelper
extends java.lang.Object


Constructor Summary
ConfigHelper()
           
 
Method Summary
static org.apache.cassandra.thrift.Cassandra.Client createConnection(java.lang.String host, java.lang.Integer port, boolean framed)
           
static org.apache.cassandra.thrift.Cassandra.Client getClientFromInputAddressList(org.apache.hadoop.conf.Configuration conf)
           
static org.apache.cassandra.thrift.Cassandra.Client getClientFromOutputAddressList(org.apache.hadoop.conf.Configuration conf)
           
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 org.apache.cassandra.thrift.KeyRange getInputKeyRange(org.apache.hadoop.conf.Configuration conf)
          may be null if unset
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 getInputRpcPort(org.apache.hadoop.conf.Configuration conf)
           
static org.apache.cassandra.thrift.SlicePredicate getInputSlicePredicate(org.apache.hadoop.conf.Configuration conf)
           
static int getInputSplitSize(org.apache.hadoop.conf.Configuration conf)
           
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 CompressionParameters getOutputCompressionParamaters(org.apache.hadoop.conf.Configuration conf)
           
static java.lang.String getOutputInitialAddress(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 IPartitioner getOutputPartitioner(org.apache.hadoop.conf.Configuration conf)
           
static int getOutputRpcPort(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 setInputPartitioner(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)
           
static void setInputRange(org.apache.hadoop.conf.Configuration conf, java.util.List<org.apache.cassandra.thrift.IndexExpression> filter)
          Set the KeyRange to limit the rows.
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 setInputRange(org.apache.hadoop.conf.Configuration conf, java.lang.String startToken, java.lang.String endToken, java.util.List<org.apache.cassandra.thrift.IndexExpression> filter)
          Set the KeyRange to limit the rows.
static void setInputRpcPort(org.apache.hadoop.conf.Configuration conf, java.lang.String port)
           
static void setInputSlicePredicate(org.apache.hadoop.conf.Configuration conf, org.apache.cassandra.thrift.SlicePredicate predicate)
          Set the predicate that determines what columns will be selected from each row.
static void setInputSplitSize(org.apache.hadoop.conf.Configuration conf, int splitsize)
          Set the size of the input split.
static void setOutputColumnFamily(org.apache.hadoop.conf.Configuration conf, java.lang.String keyspace, java.lang.String columnFamily)
          Set the keyspace and 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 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 setOutputPartitioner(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)
           
static void setOutputRpcPort(org.apache.hadoop.conf.Configuration conf, java.lang.String port)
           
static void setRangeBatchSize(org.apache.hadoop.conf.Configuration conf, int batchsize)
          The number of rows to request with each get range slices request.
 
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 -

setOutputColumnFamily

public static void setOutputColumnFamily(org.apache.hadoop.conf.Configuration conf,
                                         java.lang.String keyspace,
                                         java.lang.String columnFamily)
Set the keyspace and 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 - Size of the input split

getInputSplitSize

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

setInputSlicePredicate

public static void setInputSlicePredicate(org.apache.hadoop.conf.Configuration conf,
                                          org.apache.cassandra.thrift.SlicePredicate predicate)
Set the predicate that determines what columns will be selected from each row.

Parameters:
conf - Job configuration you are about to run
predicate -

getInputSlicePredicate

public static org.apache.cassandra.thrift.SlicePredicate getInputSlicePredicate(org.apache.hadoop.conf.Configuration conf)

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

setInputRange

public static void setInputRange(org.apache.hadoop.conf.Configuration conf,
                                 java.lang.String startToken,
                                 java.lang.String endToken,
                                 java.util.List<org.apache.cassandra.thrift.IndexExpression> filter)
Set the KeyRange to limit the rows.

Parameters:
conf - Job configuration you are about to run

setInputRange

public static void setInputRange(org.apache.hadoop.conf.Configuration conf,
                                 java.util.List<org.apache.cassandra.thrift.IndexExpression> filter)
Set the KeyRange to limit the rows.

Parameters:
conf - Job configuration you are about to run

getInputKeyRange

public static org.apache.cassandra.thrift.KeyRange getInputKeyRange(org.apache.hadoop.conf.Configuration conf)
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)

getInputKeyspaceUserName

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

getInputKeyspacePassword

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

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)

getInputIsWide

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

getOutputColumnFamily

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

getReadConsistencyLevel

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

getWriteConsistencyLevel

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

getInputRpcPort

public static int getInputRpcPort(org.apache.hadoop.conf.Configuration conf)

setInputRpcPort

public static void setInputRpcPort(org.apache.hadoop.conf.Configuration conf,
                                   java.lang.String port)

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)

getOutputRpcPort

public static int getOutputRpcPort(org.apache.hadoop.conf.Configuration conf)

setOutputRpcPort

public static void setOutputRpcPort(org.apache.hadoop.conf.Configuration conf,
                                    java.lang.String port)

getOutputInitialAddress

public static java.lang.String getOutputInitialAddress(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)

getOutputCompressionParamaters

public static CompressionParameters getOutputCompressionParamaters(org.apache.hadoop.conf.Configuration conf)

getClientFromInputAddressList

public static org.apache.cassandra.thrift.Cassandra.Client getClientFromInputAddressList(org.apache.hadoop.conf.Configuration conf)
                                                                                  throws java.io.IOException
Throws:
java.io.IOException

getClientFromOutputAddressList

public static org.apache.cassandra.thrift.Cassandra.Client getClientFromOutputAddressList(org.apache.hadoop.conf.Configuration conf)
                                                                                   throws java.io.IOException
Throws:
java.io.IOException

createConnection

public static org.apache.cassandra.thrift.Cassandra.Client createConnection(java.lang.String host,
                                                                            java.lang.Integer port,
                                                                            boolean framed)
                                                                     throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2012 The Apache Software Foundation