org.apache.hadoop.vertica
Class VerticaConfiguration

java.lang.Object
  extended by org.apache.hadoop.vertica.VerticaConfiguration

public class VerticaConfiguration
extends Object

A container for configuration property names for jobs with Vertica input/output. The job can be configured using the static methods in this class, VerticaInputFormat, and VerticaOutputFormat. Alternatively, the properties can be set in the configuration with proper values.

See Also:
configureVertica(Configuration, String[], String, String, String), configureVertica(Configuration, String[], String, String, String, String[], String, String, String)

Field Summary
static String DATABASE_PROP
          Name of database to connect to
static String DATE_STRING
          Whether to marshal dates as strings
static String DELIMITER
           
static String HOSTNAMES_PROP
          Host names to connect to, selected from at random
static String INPUT_DELIMITER_PROP
          Optional input delimiter for streaming
static String INPUT_TERMINATOR_PROP
          Optional input terminator for streaming
static int OPTIMIZE_POLL_TIMER
           
static String OPTIMIZE_POLL_TIMER_PROP
          Override the sleep timer for optimize to poll when new projetions have refreshed
static String OUTPUT_DATABASE_PROP
          Name of database to connect to
static String OUTPUT_DELIMITER_PROP
          Optional output format delimiter
static String OUTPUT_HOSTNAMES_PROP
          Host names to connect to, selected from at random
static String OUTPUT_PASSWORD_PROP
          Password for Vertica
static String OUTPUT_TABLE_DEF_PROP
          Definition of output table types
static String OUTPUT_TABLE_DROP
          Whether to drop tables
static String OUTPUT_TABLE_NAME_PROP
          Output table name
static String OUTPUT_TERMINATOR_PROP
          Optional output format terminator
static String OUTPUT_USERNAME_PROP
          User name for Vertica
static String PASSWORD_PROP
          Password for Vertica
static String QUERY_PARAM_PROP
          Query to run to retrieve parameters
static String QUERY_PARAMS_PROP
          Static parameters for query
static String QUERY_PROP
          Query to run for input
static String RECORD_TERMINATER
           
static String USERNAME_PROP
          User name for Vertica
static Integer VERSION_3_5
          Vertica Version Constants
static String VERTICA_DRIVER_CLASS
          Class name for Vertica JDBC Driver
 
Method Summary
static void configureVertica(org.apache.hadoop.conf.Configuration conf, String[] hostnames, String database, String username, String password)
          Sets the Vertica database connection information in the (@link Configuration)
static void configureVertica(org.apache.hadoop.conf.Configuration conf, String[] hostnames, String database, String username, String password, String[] output_hostnames, String output_database, String output_username, String output_password)
          Sets the Vertica database connection information in the (@link Configuration)
 org.apache.hadoop.conf.Configuration getConfiguration()
           
 boolean getDropTable()
          Return whether output table is truncated before loading
 String getInputDelimiter()
          For streaming return the delimiter to separate values to the mapper
 Collection<List<Object>> getInputParameters()
          Return static input parameters if set
 String getInputQuery()
           
 String getInputRecordTerminator()
          For streaming return the record terminator to separate values to the mapper
 Long getOptimizePollTimeout()
          Returns poll timer for optimize loop
 String getOutputDelimiter()
          For streaming return the delimiter used by the reducer
 String getOutputRecordTerminator()
          For streaming return the record terminator used by the reducer
 String[] getOutputTableDef()
          Return definition of columns for output table
 String getOutputTableName()
          Get the table that is the target of output
 String getParamsQuery()
          Return the query used to retrieve parameters for the input query (if set)
 void setDropTable(boolean drop_table)
          Set whether to truncate the output table before loading
 void setInputDelimiter(String delimiter)
          For streaming set the delimiter to separate values to the mapper
 void setInputParams(Collection<List<Object>> segment_params)
          Sets a collection of lists.
 void setInputQuery(String inputQuery)
          get Run this query and give the results to mappers.
 void setInputRecordTerminator(String terminator)
          For streaming set the record terminator to separate values to the mapper
 void setOptimizePollTimeout(Long timeout)
          Set the timour for the optimize poll loop
 void setOutputDelimiter(String delimiter)
          For streaming set the delimiter used by the reducer
 void setOutputRecordTerminator(String terminator)
          For streaming set the record terminator used by the reducer
 void setOutputTableDef(String... fieldNames)
          Set the definition of a table for output if it needs to be created
 void setOutputTableName(String tableName)
          Set table that is being loaded as output
 void setParamsQuery(String segment_params_query)
          Query used to retrieve parameters for the input query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_3_5

public static final Integer VERSION_3_5
Vertica Version Constants


VERTICA_DRIVER_CLASS

public static final String VERTICA_DRIVER_CLASS
Class name for Vertica JDBC Driver

See Also:
Constant Field Values

HOSTNAMES_PROP

public static final String HOSTNAMES_PROP
Host names to connect to, selected from at random

See Also:
Constant Field Values

DATABASE_PROP

public static final String DATABASE_PROP
Name of database to connect to

See Also:
Constant Field Values

USERNAME_PROP

public static final String USERNAME_PROP
User name for Vertica

See Also:
Constant Field Values

PASSWORD_PROP

public static final String PASSWORD_PROP
Password for Vertica

See Also:
Constant Field Values

OUTPUT_HOSTNAMES_PROP

public static final String OUTPUT_HOSTNAMES_PROP
Host names to connect to, selected from at random

See Also:
Constant Field Values

OUTPUT_DATABASE_PROP

public static final String OUTPUT_DATABASE_PROP
Name of database to connect to

See Also:
Constant Field Values

OUTPUT_USERNAME_PROP

public static final String OUTPUT_USERNAME_PROP
User name for Vertica

See Also:
Constant Field Values

OUTPUT_PASSWORD_PROP

public static final String OUTPUT_PASSWORD_PROP
Password for Vertica

See Also:
Constant Field Values

QUERY_PROP

public static final String QUERY_PROP
Query to run for input

See Also:
Constant Field Values

QUERY_PARAM_PROP

public static final String QUERY_PARAM_PROP
Query to run to retrieve parameters

See Also:
Constant Field Values

QUERY_PARAMS_PROP

public static final String QUERY_PARAMS_PROP
Static parameters for query

See Also:
Constant Field Values

INPUT_DELIMITER_PROP

public static final String INPUT_DELIMITER_PROP
Optional input delimiter for streaming

See Also:
Constant Field Values

INPUT_TERMINATOR_PROP

public static final String INPUT_TERMINATOR_PROP
Optional input terminator for streaming

See Also:
Constant Field Values

DATE_STRING

public static final String DATE_STRING
Whether to marshal dates as strings

See Also:
Constant Field Values

OUTPUT_TABLE_NAME_PROP

public static final String OUTPUT_TABLE_NAME_PROP
Output table name

See Also:
Constant Field Values

OUTPUT_TABLE_DEF_PROP

public static final String OUTPUT_TABLE_DEF_PROP
Definition of output table types

See Also:
Constant Field Values

OUTPUT_TABLE_DROP

public static final String OUTPUT_TABLE_DROP
Whether to drop tables

See Also:
Constant Field Values

OUTPUT_DELIMITER_PROP

public static final String OUTPUT_DELIMITER_PROP
Optional output format delimiter

See Also:
Constant Field Values

OUTPUT_TERMINATOR_PROP

public static final String OUTPUT_TERMINATOR_PROP
Optional output format terminator

See Also:
Constant Field Values

OPTIMIZE_POLL_TIMER_PROP

public static final String OPTIMIZE_POLL_TIMER_PROP
Override the sleep timer for optimize to poll when new projetions have refreshed

See Also:
Constant Field Values

RECORD_TERMINATER

public static final String RECORD_TERMINATER
See Also:
Constant Field Values

DELIMITER

public static final String DELIMITER
See Also:
Constant Field Values

OPTIMIZE_POLL_TIMER

public static final int OPTIMIZE_POLL_TIMER
See Also:
Constant Field Values
Method Detail

configureVertica

public static void configureVertica(org.apache.hadoop.conf.Configuration conf,
                                    String[] hostnames,
                                    String database,
                                    String username,
                                    String password)
Sets the Vertica database connection information in the (@link Configuration)

Parameters:
conf - the configuration
hostnames - one or more hosts in the Vertica cluster
database - the name of the Vertica database
username - Vertica database username
password - Vertica database password

configureVertica

public static void configureVertica(org.apache.hadoop.conf.Configuration conf,
                                    String[] hostnames,
                                    String database,
                                    String username,
                                    String password,
                                    String[] output_hostnames,
                                    String output_database,
                                    String output_username,
                                    String output_password)
Sets the Vertica database connection information in the (@link Configuration)

Parameters:
conf - the configuration
hostnames - one or more hosts in the source Cluster
database - the name of the source Vertica database
username - for the source Vertica database
password - for he source Vertica database
output_hostnames - one or more hosts in the output Cluster
output_database - the name of the output VerticaDatabase
output_username - for the target Vertica database
output_password - for the target Vertica database

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()

getInputQuery

public String getInputQuery()

setInputQuery

public void setInputQuery(String inputQuery)
get Run this query and give the results to mappers.

Parameters:
inputQuery -

getParamsQuery

public String getParamsQuery()
Return the query used to retrieve parameters for the input query (if set)

Returns:
Returns the query for input parameters

setParamsQuery

public void setParamsQuery(String segment_params_query)
Query used to retrieve parameters for the input query. The result set must match the input query parameters preceisely.

Parameters:
segment_params_query -

getInputParameters

public Collection<List<Object>> getInputParameters()
                                            throws IOException
Return static input parameters if set

Returns:
Collection of list of objects representing input parameters
Throws:
IOException

setInputParams

public void setInputParams(Collection<List<Object>> segment_params)
                    throws IOException
Sets a collection of lists. Each list is passed to an input split and used as arguments to the input query.

Parameters:
segment_params -
Throws:
IOException

getInputDelimiter

public String getInputDelimiter()
For streaming return the delimiter to separate values to the mapper

Returns:
Returns delimiter used to format streaming input data

setInputDelimiter

public void setInputDelimiter(String delimiter)
For streaming set the delimiter to separate values to the mapper


getInputRecordTerminator

public String getInputRecordTerminator()
For streaming return the record terminator to separate values to the mapper

Returns:
Returns recorder terminator for input data

setInputRecordTerminator

public void setInputRecordTerminator(String terminator)
For streaming set the record terminator to separate values to the mapper


getOutputTableName

public String getOutputTableName()
Get the table that is the target of output

Returns:
Returns table name for output

setOutputTableName

public void setOutputTableName(String tableName)
Set table that is being loaded as output

Parameters:
tableName -

getOutputTableDef

public String[] getOutputTableDef()
Return definition of columns for output table

Returns:
Returns table definition for output table

setOutputTableDef

public void setOutputTableDef(String... fieldNames)
Set the definition of a table for output if it needs to be created

Parameters:
fieldNames -

getDropTable

public boolean getDropTable()
Return whether output table is truncated before loading

Returns:
Returns true if output table should be dropped before loading

setDropTable

public void setDropTable(boolean drop_table)
Set whether to truncate the output table before loading

Parameters:
drop_table -

getOutputDelimiter

public String getOutputDelimiter()
For streaming return the delimiter used by the reducer

Returns:
Returns delimiter to use for output data

setOutputDelimiter

public void setOutputDelimiter(String delimiter)
For streaming set the delimiter used by the reducer

Parameters:
delimiter -

getOutputRecordTerminator

public String getOutputRecordTerminator()
For streaming return the record terminator used by the reducer

Returns:
Returns the record terminator for output data

setOutputRecordTerminator

public void setOutputRecordTerminator(String terminator)
For streaming set the record terminator used by the reducer

Parameters:
terminator -

getOptimizePollTimeout

public Long getOptimizePollTimeout()
Returns poll timer for optimize loop

Returns:
Returns poll timer for optimize loop

setOptimizePollTimeout

public void setOptimizePollTimeout(Long timeout)
Set the timour for the optimize poll loop

Parameters:
timeout -


Copyright © 2009 The Apache Software Foundation