org.apache.hcatalog.mapreduce
Class HCatTableInfo

java.lang.Object
  extended by org.apache.hcatalog.mapreduce.HCatTableInfo
All Implemented Interfaces:
java.io.Serializable

public class HCatTableInfo
extends java.lang.Object
implements java.io.Serializable

HCatTableInfo - class to communicate table information to HCatInputFormat and HCatOutputFormat

See Also:
Serialized Form

Nested Class Summary
static class HCatTableInfo.TableInfoType
           
 
Method Summary
 java.lang.String getDatabaseName()
          Gets the value of dbName
 java.util.List<java.lang.String> getDynamicPartitioningKeys()
           
 java.lang.String getFilter()
          Gets the value of partition filter
static HCatTableInfo getInputTableInfo(java.lang.String serverUri, java.lang.String serverKerberosPrincipal, java.lang.String dbName, java.lang.String tableName)
          Initializes a new HCatTableInfo instance to be used with HCatInputFormat for reading data from a table.
static HCatTableInfo getInputTableInfo(java.lang.String serverUri, java.lang.String serverKerberosPrincipal, java.lang.String dbName, java.lang.String tableName, java.lang.String filter)
          Initializes a new HCatTableInfo instance to be used with HCatInputFormat for reading data from a table.
 JobInfo getJobInfo()
          Gets the value of job info
static HCatTableInfo getOutputTableInfo(java.lang.String serverUri, java.lang.String serverKerberosPrincipal, java.lang.String dbName, java.lang.String tableName, java.util.Map<java.lang.String,java.lang.String> partitionValues)
          Initializes a new HCatTableInfo instance to be used with HCatOutputFormat for writing data from a table.
 java.lang.String getPartitionPredicates()
          Gets the value of partitionPredicates
 java.util.Map<java.lang.String,java.lang.String> getPartitionValues()
          Gets the value of partitionValues
 java.lang.String getServerKerberosPrincipal()
           
 java.lang.String getServerUri()
          Gets the value of serverUri
 java.lang.String getTableName()
          Gets the value of tableName
 HCatTableInfo.TableInfoType getTableType()
           
 int hashCode()
           
 boolean isDynamicPartitioningUsed()
          Returns whether or not Dynamic Partitioning is used
 void setDynamicPartitioningKeys(java.util.List<java.lang.String> dynamicPartitioningKeys)
          Sets the list of dynamic partitioning keys used for outputting without specifying all the keys
 void setJobInfo(JobInfo jobInfo)
          Sets the value of jobInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInputTableInfo

public static HCatTableInfo getInputTableInfo(java.lang.String serverUri,
                                              java.lang.String serverKerberosPrincipal,
                                              java.lang.String dbName,
                                              java.lang.String tableName)
Initializes a new HCatTableInfo instance to be used with HCatInputFormat for reading data from a table.

Parameters:
serverUri - the Metadata server uri
serverKerberosPrincipal - If the hcat server is configured to work with hadoop security, the kerberos principal name of the server - else null The principal name should be of the form: /_HOST@ like "hcat/_HOST@myrealm.com" The special string _HOST will be replaced automatically with the correct host name
dbName - the db name
tableName - the table name

getInputTableInfo

public static HCatTableInfo getInputTableInfo(java.lang.String serverUri,
                                              java.lang.String serverKerberosPrincipal,
                                              java.lang.String dbName,
                                              java.lang.String tableName,
                                              java.lang.String filter)
Initializes a new HCatTableInfo instance to be used with HCatInputFormat for reading data from a table.

Parameters:
serverUri - the Metadata server uri
serverKerberosPrincipal - If the hcat server is configured to work with hadoop security, the kerberos principal name of the server - else null The principal name should be of the form: /_HOST@ like "hcat/_HOST@myrealm.com" The special string _HOST will be replaced automatically with the correct host name
dbName - the db name
tableName - the table name
filter - the partition filter

getOutputTableInfo

public static HCatTableInfo getOutputTableInfo(java.lang.String serverUri,
                                               java.lang.String serverKerberosPrincipal,
                                               java.lang.String dbName,
                                               java.lang.String tableName,
                                               java.util.Map<java.lang.String,java.lang.String> partitionValues)
Initializes a new HCatTableInfo instance to be used with HCatOutputFormat for writing data from a table.

Parameters:
serverUri - the Metadata server uri
serverKerberosPrincipal - If the hcat server is configured to work with hadoop security, the kerberos principal name of the server - else null The principal name should be of the form: /_HOST@ like "hcat/_HOST@myrealm.com" The special string _HOST will be replaced automatically with the correct host name
dbName - the db name
tableName - the table name
partitionValues - The partition values to publish to, can be null or empty Map to indicate write to a unpartitioned table. For partitioned tables, this map should contain keys for all partition columns with corresponding values.

getServerUri

public java.lang.String getServerUri()
Gets the value of serverUri

Returns:
the serverUri

getDatabaseName

public java.lang.String getDatabaseName()
Gets the value of dbName

Returns:
the dbName

getTableName

public java.lang.String getTableName()
Gets the value of tableName

Returns:
the tableName

getPartitionPredicates

public java.lang.String getPartitionPredicates()
Gets the value of partitionPredicates

Returns:
the partitionPredicates

getPartitionValues

public java.util.Map<java.lang.String,java.lang.String> getPartitionValues()
Gets the value of partitionValues

Returns:
the partitionValues

getJobInfo

public JobInfo getJobInfo()
Gets the value of job info

Returns:
the job info

setJobInfo

public void setJobInfo(JobInfo jobInfo)
Sets the value of jobInfo

Parameters:
jobInfo - the jobInfo to set

getTableType

public HCatTableInfo.TableInfoType getTableType()

getFilter

public java.lang.String getFilter()
Gets the value of partition filter

Returns:
the filter string

getServerKerberosPrincipal

public java.lang.String getServerKerberosPrincipal()
Returns:
the serverKerberosPrincipal

isDynamicPartitioningUsed

public boolean isDynamicPartitioningUsed()
Returns whether or not Dynamic Partitioning is used

Returns:
whether or not dynamic partitioning is currently enabled and used

setDynamicPartitioningKeys

public void setDynamicPartitioningKeys(java.util.List<java.lang.String> dynamicPartitioningKeys)
Sets the list of dynamic partitioning keys used for outputting without specifying all the keys

Parameters:
dynamicPartitioningKeys -

getDynamicPartitioningKeys

public java.util.List<java.lang.String> getDynamicPartitioningKeys()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object