org.apache.hadoop.hive.metastore
Class MetaStoreServer.ThriftMetaStoreHandler

java.lang.Object
  extended by com.facebook.fb303.FacebookBase
      extended by org.apache.hadoop.hive.metastore.MetaStoreServer.ThriftMetaStoreHandler
All Implemented Interfaces:
com.facebook.fb303.FacebookService.Iface, ThriftMetaStore.Iface
Enclosing class:
MetaStoreServer

public static class MetaStoreServer.ThriftMetaStoreHandler
extends com.facebook.fb303.FacebookBase
implements ThriftMetaStore.Iface


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
MetaStoreServer.ThriftMetaStoreHandler(String name)
          ThriftMetaStoreHandler Constructor for the MetaStore glue with Thrift Class.
MetaStoreServer.ThriftMetaStoreHandler(String name, org.apache.hadoop.conf.Configuration configuration)
           
 
Method Summary
 void alter_table(String dbName, String tableName, Map<String,String> schema)
          alter_table For a columnsetSerDe table, add column names to it
 ArrayList<String> cat(String dbName, String tableName, String partition, int num)
           
 void create_table(String dbName, String tableName, Map<String,String> schema)
          create_table Create names columns for a columnset type table
 void drop_table(String dbName, String tableName)
          drop drop a table
 List<String> get_dbs()
          get_dbs
 ArrayList<FieldSchema> get_fields(String db, String table_name)
           
 ArrayList<String> get_partitions(String dbName, String tableName)
          getPartitions return a table's partitions
 AbstractMap<String,String> get_schema(String tableName)
          get_schema Gets the (opaque) schema which is currently represented as a key=>value map.
 ArrayList<String> get_tables(String dbName, String pattern)
           
 int getStatus()
          getStatus
 String getVersion()
          getVersion
 void setOption(String key, String val)
           
 void shutdown()
          shutdown cleanly closes everything and exit.
 boolean table_exists(String dbName, String tableName)
          table_exists check if the table's schema exists in the metastore
 void truncate_table(String dbName, String tableName, String partition)
          truncate drop a table
 
Methods inherited from class com.facebook.fb303.FacebookBase
aliveSince, deleteCounter, getCounter, getCounters, getCpuProfile, getExportedValue, getExportedValues, getLimitedReflection, getName, getOption, getOptions, getStatusDetails, incrementCounter, reinitialize, resetCounter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.facebook.fb303.FacebookService.Iface
aliveSince, getCounter, getCounters, getLimitedReflection, getName, getOption, getOptions, getStatusDetails, reinitialize
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

MetaStoreServer.ThriftMetaStoreHandler

public MetaStoreServer.ThriftMetaStoreHandler(String name)
ThriftMetaStoreHandler Constructor for the MetaStore glue with Thrift Class.

Parameters:
name - - the name of this handler

MetaStoreServer.ThriftMetaStoreHandler

public MetaStoreServer.ThriftMetaStoreHandler(String name,
                                              org.apache.hadoop.conf.Configuration configuration)
Method Detail

setOption

public void setOption(String key,
                      String val)
Specified by:
setOption in interface com.facebook.fb303.FacebookService.Iface
Overrides:
setOption in class com.facebook.fb303.FacebookBase

getStatus

public int getStatus()
getStatus

Specified by:
getStatus in interface com.facebook.fb303.FacebookService.Iface
Specified by:
getStatus in class com.facebook.fb303.FacebookBase
Returns:
ALIVE

getVersion

public String getVersion()
getVersion

Specified by:
getVersion in interface com.facebook.fb303.FacebookService.Iface
Returns:
current version of the store. Should proxy this request to the MetaStore class actually!

shutdown

public void shutdown()
shutdown cleanly closes everything and exit.

Specified by:
shutdown in interface com.facebook.fb303.FacebookService.Iface
Overrides:
shutdown in class com.facebook.fb303.FacebookBase

get_tables

public ArrayList<String> get_tables(String dbName,
                                    String pattern)
                             throws com.facebook.thrift.TException,
                                    MetaException,
                                    UnknownDBException
Specified by:
get_tables in interface ThriftMetaStore.Iface
Throws:
com.facebook.thrift.TException
MetaException
UnknownDBException

cat

public ArrayList<String> cat(String dbName,
                             String tableName,
                             String partition,
                             int num)
                      throws com.facebook.thrift.TException,
                             MetaException,
                             UnknownDBException,
                             UnknownTableException
Specified by:
cat in interface ThriftMetaStore.Iface
Throws:
com.facebook.thrift.TException
MetaException
UnknownDBException
UnknownTableException

get_dbs

public List<String> get_dbs()
                     throws com.facebook.thrift.TException,
                            MetaException
get_dbs

Specified by:
get_dbs in interface ThriftMetaStore.Iface
Returns:
a list of all the dbs
Throws:
com.facebook.thrift.TException - if Thrift problem.
MetaException - if internal meta store problem

get_partitions

public ArrayList<String> get_partitions(String dbName,
                                        String tableName)
                                 throws com.facebook.thrift.TException,
                                        MetaException,
                                        UnknownTableException,
                                        UnknownDBException
getPartitions return a table's partitions

Specified by:
get_partitions in interface ThriftMetaStore.Iface
Parameters:
dbName - the database name
tableName - a valid table name
Returns:
a string (including '\n's) of the rows
Throws:
com.facebook.thrift.TException - if thrift problem
MetaException - if internal problem or bad input
UnknownTableException - if we don't know about this table.
UnknownDBException

table_exists

public boolean table_exists(String dbName,
                            String tableName)
                     throws com.facebook.thrift.TException,
                            MetaException,
                            UnknownDBException
table_exists check if the table's schema exists in the metastore

Specified by:
table_exists in interface ThriftMetaStore.Iface
Parameters:
tableName - - a valid table name
Returns:
true/false
Throws:
com.facebook.thrift.TException - if thrift problem
MetaException - if internal problem or bad input
UnknownDBException

alter_table

public void alter_table(String dbName,
                        String tableName,
                        Map<String,String> schema)
                 throws com.facebook.thrift.TException,
                        MetaException,
                        UnknownTableException,
                        UnknownDBException
alter_table For a columnsetSerDe table, add column names to it

Specified by:
alter_table in interface ThriftMetaStore.Iface
Parameters:
dbName - the database
tableName - a valid existing table name
schema - The schema information for the table
Throws:
com.facebook.thrift.TException - if thrift problem
MetaException - if internal problem or bad input
UnknownTableException - if table does not exist already
UnknownDBException

create_table

public void create_table(String dbName,
                         String tableName,
                         Map<String,String> schema)
                  throws com.facebook.thrift.TException,
                         MetaException,
                         UnknownDBException
create_table Create names columns for a columnset type table

Specified by:
create_table in interface ThriftMetaStore.Iface
Parameters:
dbName - a valid database name
tableName - - a valid table name
Throws:
com.facebook.thrift.TException - if thrift problem
MetaException - if internal problem or bad input
UnknownDBException

get_fields

public ArrayList<FieldSchema> get_fields(String db,
                                         String table_name)
                                  throws MetaException,
                                         UnknownTableException,
                                         UnknownDBException
Specified by:
get_fields in interface ThriftMetaStore.Iface
Throws:
MetaException
UnknownTableException
UnknownDBException

drop_table

public void drop_table(String dbName,
                       String tableName)
                throws com.facebook.thrift.TException,
                       MetaException,
                       UnknownTableException,
                       UnknownDBException
drop drop a table

Specified by:
drop_table in interface ThriftMetaStore.Iface
Parameters:
dbName - the name of a database
tableName - a valid existing table name
Throws:
com.facebook.thrift.TException - if thrift problem
MetaException - if internal problem or bad input
UnknownTableException - if table does not exist already
UnknownDBException

truncate_table

public void truncate_table(String dbName,
                           String tableName,
                           String partition)
                    throws com.facebook.thrift.TException,
                           MetaException,
                           UnknownTableException,
                           UnknownDBException
truncate drop a table

Specified by:
truncate_table in interface ThriftMetaStore.Iface
Parameters:
dbName - a valid database name
tableName - a valid existing table name
Throws:
com.facebook.thrift.TException - if thrift problem
MetaException - if internal problem or bad input
UnknownTableException - if table does not exist already
UnknownDBException

get_schema

public AbstractMap<String,String> get_schema(String tableName)
                                      throws MetaException,
                                             UnknownTableException,
                                             UnknownDBException
get_schema Gets the (opaque) schema which is currently represented as a key=>value map.

Specified by:
get_schema in interface ThriftMetaStore.Iface
Parameters:
tableName - - the name of the table
Returns:
the key/value of the opaque schema
Throws:
MetaException - if internal problem
UnknownTableException - if the table doesn't exist
UnknownDBException


Copyright © 2009 The Apache Software Foundation