Package org.apache.cassandra.hadoop
Class ConfigHelper
- java.lang.Object
-
- org.apache.cassandra.hadoop.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.StringgetInputColumnFamily(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetInputInitialAddress(org.apache.hadoop.conf.Configuration conf)static booleangetInputIsWide(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.StringgetInputKeyspace(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetInputKeyspacePassword(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetInputKeyspaceUserName(org.apache.hadoop.conf.Configuration conf)static IPartitionergetInputPartitioner(org.apache.hadoop.conf.Configuration conf)static intgetInputSplitSize(org.apache.hadoop.conf.Configuration conf)static intgetInputSplitSizeInMb(org.apache.hadoop.conf.Configuration conf)cassandra.input.split.size will be used if the value is undefined or negative.static java.lang.StringgetOutputColumnFamily(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetOutputCompressionChunkLength(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetOutputCompressionClass(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetOutputInitialAddress(org.apache.hadoop.conf.Configuration conf)static java.lang.IntegergetOutputInitialPort(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetOutputKeyspace(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetOutputKeyspacePassword(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetOutputKeyspaceUserName(org.apache.hadoop.conf.Configuration conf)static booleangetOutputLocalDCOnly(org.apache.hadoop.conf.Configuration conf)static IPartitionergetOutputPartitioner(org.apache.hadoop.conf.Configuration conf)static intgetRangeBatchSize(org.apache.hadoop.conf.Configuration conf)The number of rows to request with each get range slices request.static java.lang.StringgetReadConsistencyLevel(org.apache.hadoop.conf.Configuration conf)static java.lang.StringgetWriteConsistencyLevel(org.apache.hadoop.conf.Configuration conf)static voidsetInputColumnFamily(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 voidsetInputColumnFamily(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 voidsetInputInitialAddress(org.apache.hadoop.conf.Configuration conf, java.lang.String address)static voidsetInputKeyspacePassword(org.apache.hadoop.conf.Configuration conf, java.lang.String password)static voidsetInputKeyspaceUserName(org.apache.hadoop.conf.Configuration conf, java.lang.String username)static voidsetInputKeyspaceUserNameAndPassword(org.apache.hadoop.conf.Configuration conf, java.lang.String username, java.lang.String password)static voidsetInputPartitioner(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)static voidsetInputRange(org.apache.hadoop.conf.Configuration conf, java.lang.String startToken, java.lang.String endToken)Set the KeyRange to limit the rows.static voidsetInputSplitSize(org.apache.hadoop.conf.Configuration conf, int splitsize)Set the size of the input split.static voidsetInputSplitSizeInMb(org.apache.hadoop.conf.Configuration conf, int splitSizeMb)Set the size of the input split.static voidsetOutputColumnFamily(org.apache.hadoop.conf.Configuration conf, java.lang.String columnFamily)Set the column family for the output of this job.static voidsetOutputColumnFamily(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 voidsetOutputCompressionChunkLength(org.apache.hadoop.conf.Configuration conf, java.lang.String length)static voidsetOutputCompressionClass(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)static voidsetOutputInitialAddress(org.apache.hadoop.conf.Configuration conf, java.lang.String address)static voidsetOutputInitialPort(org.apache.hadoop.conf.Configuration conf, java.lang.Integer port)static voidsetOutputKeyspace(org.apache.hadoop.conf.Configuration conf, java.lang.String keyspace)Set the keyspace for the output of this job.static voidsetOutputKeyspacePassword(org.apache.hadoop.conf.Configuration conf, java.lang.String password)static voidsetOutputKeyspaceUserName(org.apache.hadoop.conf.Configuration conf, java.lang.String username)static voidsetOutputKeyspaceUserNameAndPassword(org.apache.hadoop.conf.Configuration conf, java.lang.String username, java.lang.String password)static voidsetOutputLocalDCOnly(org.apache.hadoop.conf.Configuration conf, boolean localDCOnly)static voidsetOutputPartitioner(org.apache.hadoop.conf.Configuration conf, java.lang.String classname)static voidsetRangeBatchSize(org.apache.hadoop.conf.Configuration conf, int batchsize)The number of rows to request with each get range slices request.static voidsetReadConsistencyLevel(org.apache.hadoop.conf.Configuration conf, java.lang.String consistencyLevel)static voidsetWriteConsistencyLevel(org.apache.hadoop.conf.Configuration conf, java.lang.String consistencyLevel)
-
-
-
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 runkeyspace-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 runkeyspace-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 runkeyspace-
-
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 runcolumnFamily-
-
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 runkeyspace-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 runbatchsize- 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 runsplitsize- 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 runsplitSizeMb- Input split size in MiB
-
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 MiB 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)
-
-