Parcourir la source

HADOOP-4087. Hive Metastore API for php and python clients.
(Prasad Chakka via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@696427 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur il y a 16 ans
Parent
commit
e7889c19f4

+ 3 - 0
CHANGES.txt

@@ -586,6 +586,9 @@ Trunk (unreleased changes)
     HADOOP-4125. Handles Reduce cleanup tip on the web ui.
     (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-4087. Hive Metastore API for php and python clients.
+    (Prasad Chakka via dhruba)
+
 Release 0.18.1 - 2008-09-17
 
   IMPROVEMENTS

+ 8 - 0
src/contrib/hive/build.xml

@@ -130,6 +130,8 @@
     <mkdir dir="${target.example.dir}"/>
     <mkdir dir="${target.example.dir}/files"/>
     <mkdir dir="${target.example.dir}/queries"/>
+    <mkdir dir="${target.lib.dir}/py"/>
+    <mkdir dir="${target.lib.dir}/php"/>
     <exec executable="cp" failonerror="true">
       <arg line="-p '${hive.root}/bin/hive' '${target.bin.dir}'"/>
     </exec>
@@ -137,6 +139,12 @@
     <copy file="${basedir}/conf/hive-default.xml" todir="${target.conf.dir}"/>
     <copy file="${basedir}/conf/hive-log4j.properties" todir="${target.conf.dir}"/>
     <copy file="${basedir}/conf/jpox.properties" todir="${target.conf.dir}"/>
+    <copy todir="${target.lib.dir}/php">
+      <fileset dir="${hive.root}/metastore/src/gen-php"/>
+    </copy>
+    <copy todir="${target.lib.dir}/py">
+      <fileset dir="${hive.root}/metastore/src/gen-py"/>
+    </copy>
     <copy todir="${target.lib.dir}" preservelastmodified="true" flatten="true">
       <fileset dir="${hive.root}" includes="*/*.jar, */*/*.jar" excludes="**/antlr-2*,**/antlr-3*"/>
       <fileset file="${build.dir.hive}/cli/hive_cli.jar"/>

+ 2 - 0
src/contrib/hive/conf/jpox.properties

@@ -13,3 +13,5 @@ javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver
 javax.jdo.option.ConnectionURL=jdbc:derby:;databaseName=test_metastore_db;create=true
 javax.jdo.option.ConnectionUserName=APP
 javax.jdo.option.ConnectionPassword=mine
+org.jpox.cache.level2=true
+org.jpox.cache.level2.type=SOFT

+ 20 - 13
src/contrib/hive/metastore/if/hive_metastore.thrift

@@ -88,8 +88,8 @@ struct Version {
 }
 
 struct FieldSchema {
-  string name,
-  string type,
+  string name, // name of the field
+  string type, // type of the field. primitive types defined above, specify list<TYPE_NAME>, map<TYPE_NAME, TYPE_NAME> for lists & maps 
   string comment
 }
 
@@ -124,20 +124,20 @@ struct Order {
 }
 
 struct StorageDescriptor {
-  list<FieldSchema> cols,
-  string location,
-  string inputFormat;
-  string outputFormat;
-  bool isCompressed;
+  list<FieldSchema> cols, // required (refer to types defined above)
+  string location, // defaults to <warehouse loc>/<db loc>/tablename
+  string inputFormat; // SequenceFileInputFormat (binary) or TextInputFormat`  or custom format
+  string outputFormat; // SequenceFileOutputFormat (binary) or IgnoreKeyTextOutputFormat or custom format
+  bool isCompressed; // compressed or not
   i32 numBuckets = 32, // this must be specified if there are any dimension columns
-  SerDeInfo serdeInfo;
-  list<string> bucketCols, //reducer grouping columns and clustering columns and bucketing columns`
-  list<Order> sortCols,
-  map<string, string> parameters
+  SerDeInfo serdeInfo; // serialization and deserialization information
+  list<string> bucketCols, // reducer grouping columns and clustering columns and bucketing columns`
+  list<Order> sortCols, // sort order of the data in each bucket
+  map<string, string> parameters // any user supplied key value hash
 }
 
 struct Table {
-  string tableName,
+  string tableName, 
   string database,
   string owner,
   i32 createTime,
@@ -214,7 +214,14 @@ service ThriftHiveMetastore extends fb303.FacebookService
   list<FieldSchema> get_fields(string db_name, string table_name) throws (MetaException ouch1, UnknownTableException ouch2, UnknownDBException ouch3),
 
   // Tables
-  // create the table with the given table object in the given database
+  // create a Hive table. Following fields must be set
+  // Table.tableName
+  // Table.database (only 'default' for now until Hive QL supports databases)
+  // Table.owner (not needed, but good to have for tracking purposes)
+  // Table.sd.cols (list of field schemas)
+  // Table.sd.inputFormat ( SequenceFileInputFormat (binary like falcon tables or u_full) or TextInputFormat)
+  // Table.sd.outputFormat ( SequenceFileInputFormat (binary) or TextInputFormat)
+  // Table.sd.serdeInfo.serializationLib (SerDe class name such as org.apache.hadoop.hive.serde.simple_meta.MetadataTypedColumnsetSerDe
   void create_table(1:Table tbl) throws(1:AlreadyExistsException ouch1, 2:InvalidObjectException ouch2, 3:MetaException ouch3, 4:NoSuchObjectException o4)
   // drops the table and all the partitions associated with it if the table has partitions
   // delete data (including partitions) if deleteData is set to true

+ 0 - 184
src/contrib/hive/metastore/src/gen-py/hive_metastore/ThriftHiveMetaStore-remote

@@ -1,184 +0,0 @@
-#!/usr/bin/env python
-#
-# Autogenerated by Thrift
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-
-import sys
-import pprint
-from urlparse import urlparse
-from thrift.transport import TTransport
-from thrift.transport import TSocket
-from thrift.transport import THttpClient
-from thrift.protocol import TBinaryProtocol
-
-import ThriftHiveMetaStore
-from ttypes import *
-
-if len(sys.argv) <= 1 or sys.argv[1] == '--help':
-  print ''
-  print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
-  print ''
-  print 'Functions:'
-  print '   get_tables(string pattern)'
-  print '   get_schema(string table_name)'
-  print '   get_fields(string table_name)'
-  print '   get_partition_cols(string table_name)'
-  print '  void save_table(string table_name,  schema, bool overwrite)'
-  print '   cat(string table_name, i32 high, string partition)'
-  print '  void drop(string table_name, bool delete_data)'
-  print '  void rename(string current_table_name, string new_table_name, bool move_data)'
-  print '  bool schema_exists(string table_name)'
-  print '  bool exists(string table_name)'
-  print '  void alter_table(string table_name,  columns)'
-  print '  void create_table(string table_name,  columns,  partition_cols)'
-  print '   get_partitions(string table_name)'
-  print '  void write_log(string table_name, string logName,  new_entry)'
-  print '   read_log(string table_name, string logName)'
-  print '   get_log_names(string table_name)'
-  print ''
-  sys.exit(0)
-
-pp = pprint.PrettyPrinter(indent = 2)
-host = 'localhost'
-port = 9090
-uri = ''
-framed = False
-http = False
-argi = 1
-
-if sys.argv[argi] == '-h':
-  parts = sys.argv[argi+1].split(':') 
-  host = parts[0]
-  port = int(parts[1])
-  argi += 2
-
-if sys.argv[argi] == '-u':
-  url = urlparse(sys.argv[argi+1])
-  parts = url[1].split(':') 
-  host = parts[0]
-  if len(parts) > 1:
-    port = int(parts[1])
-  else:
-    port = 80
-  uri = url[2]
-  http = True
-  argi += 2
-
-if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
-  framed = True
-  argi += 1
-
-cmd = sys.argv[argi]
-args = sys.argv[argi+1:]
-
-if http:
-  transport = THttpClient.THttpClient(host, port, uri)
-else:
-  socket = TSocket.TSocket(host, port)
-  if framed:
-    transport = TTransport.TFramedTransport(socket)
-  else:
-    transport = TTransport.TBufferedTransport(socket)
-protocol = TBinaryProtocol.TBinaryProtocol(transport)
-client = ThriftHiveMetaStore.Client(protocol)
-transport.open()
-
-if cmd == 'get_tables':
-  if len(args) != 1:
-    print 'get_tables requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.get_tables(args[0],))
-
-elif cmd == 'get_schema':
-  if len(args) != 1:
-    print 'get_schema requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.get_schema(args[0],))
-
-elif cmd == 'get_fields':
-  if len(args) != 1:
-    print 'get_fields requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.get_fields(args[0],))
-
-elif cmd == 'get_partition_cols':
-  if len(args) != 1:
-    print 'get_partition_cols requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.get_partition_cols(args[0],))
-
-elif cmd == 'save_table':
-  if len(args) != 3:
-    print 'save_table requires 3 args'
-    sys.exit(1)
-  pp.pprint(client.save_table(args[0],eval(args[1]),eval(args[2]),))
-
-elif cmd == 'cat':
-  if len(args) != 3:
-    print 'cat requires 3 args'
-    sys.exit(1)
-  pp.pprint(client.cat(args[0],eval(args[1]),args[2],))
-
-elif cmd == 'drop':
-  if len(args) != 2:
-    print 'drop requires 2 args'
-    sys.exit(1)
-  pp.pprint(client.drop(args[0],eval(args[1]),))
-
-elif cmd == 'rename':
-  if len(args) != 3:
-    print 'rename requires 3 args'
-    sys.exit(1)
-  pp.pprint(client.rename(args[0],args[1],eval(args[2]),))
-
-elif cmd == 'schema_exists':
-  if len(args) != 1:
-    print 'schema_exists requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.schema_exists(args[0],))
-
-elif cmd == 'exists':
-  if len(args) != 1:
-    print 'exists requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.exists(args[0],))
-
-elif cmd == 'alter_table':
-  if len(args) != 2:
-    print 'alter_table requires 2 args'
-    sys.exit(1)
-  pp.pprint(client.alter_table(args[0],eval(args[1]),))
-
-elif cmd == 'create_table':
-  if len(args) != 3:
-    print 'create_table requires 3 args'
-    sys.exit(1)
-  pp.pprint(client.create_table(args[0],eval(args[1]),eval(args[2]),))
-
-elif cmd == 'get_partitions':
-  if len(args) != 1:
-    print 'get_partitions requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.get_partitions(args[0],))
-
-elif cmd == 'write_log':
-  if len(args) != 3:
-    print 'write_log requires 3 args'
-    sys.exit(1)
-  pp.pprint(client.write_log(args[0],args[1],eval(args[2]),))
-
-elif cmd == 'read_log':
-  if len(args) != 2:
-    print 'read_log requires 2 args'
-    sys.exit(1)
-  pp.pprint(client.read_log(args[0],args[1],))
-
-elif cmd == 'get_log_names':
-  if len(args) != 1:
-    print 'get_log_names requires 1 args'
-    sys.exit(1)
-  pp.pprint(client.get_log_names(args[0],))
-
-transport.close()

+ 247 - 0
src/contrib/hive/metastore/src/gen-py/hive_metastore/ThriftHiveMetastore-remote

@@ -0,0 +1,247 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+import sys
+import pprint
+from urlparse import urlparse
+from thrift.transport import TTransport
+from thrift.transport import TSocket
+from thrift.transport import THttpClient
+from thrift.protocol import TBinaryProtocol
+
+import ThriftHiveMetastore
+from ttypes import *
+
+if len(sys.argv) <= 1 or sys.argv[1] == '--help':
+  print ''
+  print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
+  print ''
+  print 'Functions:'
+  print '  bool create_database(string name, string location_uri)'
+  print '  Database get_database(string name)'
+  print '  bool drop_database(string name)'
+  print '   get_databases()'
+  print '  Type get_type(string name)'
+  print '  bool create_type(Type type)'
+  print '  bool drop_type(string type)'
+  print '   get_type_all(string name)'
+  print '   get_fields(string db_name, string table_name)'
+  print '  void create_table(Table tbl)'
+  print '  void drop_table(string dbname, string name, bool deleteData)'
+  print '   get_tables(string db_name, string pattern)'
+  print '  Table get_table(string dbname, string tbl_name)'
+  print '  bool set_table_parameters(string dbname, string tbl_name,  params)'
+  print '  void alter_table(string dbname, string tbl_name, Table new_tbl)'
+  print '  void truncate_table(string db_name, string table_name, string partition)'
+  print '   cat(string db_name, string table_name, string partition, i32 high)'
+  print '  Partition add_partition(Partition new_part)'
+  print '  Partition append_partition(string db_name, string tbl_name,  part_vals)'
+  print '  bool drop_partition(string db_name, string tbl_name,  part_vals, bool deleteData)'
+  print '  Partition get_partition(string db_name, string tbl_name,  part_vals)'
+  print '   get_partitions(string db_name, string tbl_name, i16 max_parts)'
+  print '  bool set_partition_parameters(string db_name, string tbl_name, string pname,  params)'
+  print '  bool alter_partitions(StorageDescriptor sd,  parts)'
+  print '  bool create_index(Index index_def)'
+  print ''
+  sys.exit(0)
+
+pp = pprint.PrettyPrinter(indent = 2)
+host = 'localhost'
+port = 9090
+uri = ''
+framed = False
+http = False
+argi = 1
+
+if sys.argv[argi] == '-h':
+  parts = sys.argv[argi+1].split(':') 
+  host = parts[0]
+  port = int(parts[1])
+  argi += 2
+
+if sys.argv[argi] == '-u':
+  url = urlparse(sys.argv[argi+1])
+  parts = url[1].split(':') 
+  host = parts[0]
+  if len(parts) > 1:
+    port = int(parts[1])
+  else:
+    port = 80
+  uri = url[2]
+  http = True
+  argi += 2
+
+if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
+  framed = True
+  argi += 1
+
+cmd = sys.argv[argi]
+args = sys.argv[argi+1:]
+
+if http:
+  transport = THttpClient.THttpClient(host, port, uri)
+else:
+  socket = TSocket.TSocket(host, port)
+  if framed:
+    transport = TTransport.TFramedTransport(socket)
+  else:
+    transport = TTransport.TBufferedTransport(socket)
+protocol = TBinaryProtocol.TBinaryProtocol(transport)
+client = ThriftHiveMetastore.Client(protocol)
+transport.open()
+
+if cmd == 'create_database':
+  if len(args) != 2:
+    print 'create_database requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.create_database(args[0],args[1],))
+
+elif cmd == 'get_database':
+  if len(args) != 1:
+    print 'get_database requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_database(args[0],))
+
+elif cmd == 'drop_database':
+  if len(args) != 1:
+    print 'drop_database requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.drop_database(args[0],))
+
+elif cmd == 'get_databases':
+  if len(args) != 0:
+    print 'get_databases requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.get_databases())
+
+elif cmd == 'get_type':
+  if len(args) != 1:
+    print 'get_type requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_type(args[0],))
+
+elif cmd == 'create_type':
+  if len(args) != 1:
+    print 'create_type requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.create_type(eval(args[0]),))
+
+elif cmd == 'drop_type':
+  if len(args) != 1:
+    print 'drop_type requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.drop_type(args[0],))
+
+elif cmd == 'get_type_all':
+  if len(args) != 1:
+    print 'get_type_all requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_type_all(args[0],))
+
+elif cmd == 'get_fields':
+  if len(args) != 2:
+    print 'get_fields requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_fields(args[0],args[1],))
+
+elif cmd == 'create_table':
+  if len(args) != 1:
+    print 'create_table requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.create_table(eval(args[0]),))
+
+elif cmd == 'drop_table':
+  if len(args) != 3:
+    print 'drop_table requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.drop_table(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'get_tables':
+  if len(args) != 2:
+    print 'get_tables requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_tables(args[0],args[1],))
+
+elif cmd == 'get_table':
+  if len(args) != 2:
+    print 'get_table requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_table(args[0],args[1],))
+
+elif cmd == 'set_table_parameters':
+  if len(args) != 3:
+    print 'set_table_parameters requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.set_table_parameters(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'alter_table':
+  if len(args) != 3:
+    print 'alter_table requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.alter_table(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'truncate_table':
+  if len(args) != 3:
+    print 'truncate_table requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.truncate_table(args[0],args[1],args[2],))
+
+elif cmd == 'cat':
+  if len(args) != 4:
+    print 'cat requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.cat(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'add_partition':
+  if len(args) != 1:
+    print 'add_partition requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.add_partition(eval(args[0]),))
+
+elif cmd == 'append_partition':
+  if len(args) != 3:
+    print 'append_partition requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.append_partition(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'drop_partition':
+  if len(args) != 4:
+    print 'drop_partition requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.drop_partition(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'get_partition':
+  if len(args) != 3:
+    print 'get_partition requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_partition(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'get_partitions':
+  if len(args) != 3:
+    print 'get_partitions requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'set_partition_parameters':
+  if len(args) != 4:
+    print 'set_partition_parameters requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.set_partition_parameters(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'alter_partitions':
+  if len(args) != 2:
+    print 'alter_partitions requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.alter_partitions(eval(args[0]),eval(args[1]),))
+
+elif cmd == 'create_index':
+  if len(args) != 1:
+    print 'create_index requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.create_index(eval(args[0]),))
+
+transport.close()

+ 5231 - 0
src/contrib/hive/metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py

@@ -0,0 +1,5231 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+import fb303.FacebookService
+from ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol
+try:
+  from thrift.protocol import fastbinary
+except:
+  fastbinary = None
+
+
+class Iface(fb303.FacebookService.Iface):
+  def create_database(self, name, location_uri):
+    pass
+
+  def get_database(self, name):
+    pass
+
+  def drop_database(self, name):
+    pass
+
+  def get_databases(self, ):
+    pass
+
+  def get_type(self, name):
+    pass
+
+  def create_type(self, type):
+    pass
+
+  def drop_type(self, type):
+    pass
+
+  def get_type_all(self, name):
+    pass
+
+  def get_fields(self, db_name, table_name):
+    pass
+
+  def create_table(self, tbl):
+    pass
+
+  def drop_table(self, dbname, name, deleteData):
+    pass
+
+  def get_tables(self, db_name, pattern):
+    pass
+
+  def get_table(self, dbname, tbl_name):
+    pass
+
+  def set_table_parameters(self, dbname, tbl_name, params):
+    pass
+
+  def alter_table(self, dbname, tbl_name, new_tbl):
+    pass
+
+  def truncate_table(self, db_name, table_name, partition):
+    pass
+
+  def cat(self, db_name, table_name, partition, high):
+    pass
+
+  def add_partition(self, new_part):
+    pass
+
+  def append_partition(self, db_name, tbl_name, part_vals):
+    pass
+
+  def drop_partition(self, db_name, tbl_name, part_vals, deleteData):
+    pass
+
+  def get_partition(self, db_name, tbl_name, part_vals):
+    pass
+
+  def get_partitions(self, db_name, tbl_name, max_parts):
+    pass
+
+  def set_partition_parameters(self, db_name, tbl_name, pname, params):
+    pass
+
+  def alter_partitions(self, sd, parts):
+    pass
+
+  def create_index(self, index_def):
+    pass
+
+
+class Client(fb303.FacebookService.Client, Iface):
+  def __init__(self, iprot, oprot=None):
+    fb303.FacebookService.Client.__init__(self, iprot, oprot)
+
+  def create_database(self, name, location_uri):
+    self.send_create_database(name, location_uri)
+    return self.recv_create_database()
+
+  def send_create_database(self, name, location_uri):
+    self._oprot.writeMessageBegin('create_database', TMessageType.CALL, self._seqid)
+    args = create_database_args()
+    args.name = name
+    args.location_uri = location_uri
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_create_database(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = create_database_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "create_database failed: unknown result");
+
+  def get_database(self, name):
+    self.send_get_database(name)
+    return self.recv_get_database()
+
+  def send_get_database(self, name):
+    self._oprot.writeMessageBegin('get_database', TMessageType.CALL, self._seqid)
+    args = get_database_args()
+    args.name = name
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_database(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_database_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_database failed: unknown result");
+
+  def drop_database(self, name):
+    self.send_drop_database(name)
+    return self.recv_drop_database()
+
+  def send_drop_database(self, name):
+    self._oprot.writeMessageBegin('drop_database', TMessageType.CALL, self._seqid)
+    args = drop_database_args()
+    args.name = name
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_drop_database(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = drop_database_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "drop_database failed: unknown result");
+
+  def get_databases(self, ):
+    self.send_get_databases()
+    return self.recv_get_databases()
+
+  def send_get_databases(self, ):
+    self._oprot.writeMessageBegin('get_databases', TMessageType.CALL, self._seqid)
+    args = get_databases_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_databases(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_databases_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_databases failed: unknown result");
+
+  def get_type(self, name):
+    self.send_get_type(name)
+    return self.recv_get_type()
+
+  def send_get_type(self, name):
+    self._oprot.writeMessageBegin('get_type', TMessageType.CALL, self._seqid)
+    args = get_type_args()
+    args.name = name
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_type(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_type_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_type failed: unknown result");
+
+  def create_type(self, type):
+    self.send_create_type(type)
+    return self.recv_create_type()
+
+  def send_create_type(self, type):
+    self._oprot.writeMessageBegin('create_type', TMessageType.CALL, self._seqid)
+    args = create_type_args()
+    args.type = type
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_create_type(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = create_type_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    if result.o3 != None:
+      raise result.o3
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "create_type failed: unknown result");
+
+  def drop_type(self, type):
+    self.send_drop_type(type)
+    return self.recv_drop_type()
+
+  def send_drop_type(self, type):
+    self._oprot.writeMessageBegin('drop_type', TMessageType.CALL, self._seqid)
+    args = drop_type_args()
+    args.type = type
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_drop_type(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = drop_type_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "drop_type failed: unknown result");
+
+  def get_type_all(self, name):
+    self.send_get_type_all(name)
+    return self.recv_get_type_all()
+
+  def send_get_type_all(self, name):
+    self._oprot.writeMessageBegin('get_type_all', TMessageType.CALL, self._seqid)
+    args = get_type_all_args()
+    args.name = name
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_type_all(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_type_all_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_type_all failed: unknown result");
+
+  def get_fields(self, db_name, table_name):
+    self.send_get_fields(db_name, table_name)
+    return self.recv_get_fields()
+
+  def send_get_fields(self, db_name, table_name):
+    self._oprot.writeMessageBegin('get_fields', TMessageType.CALL, self._seqid)
+    args = get_fields_args()
+    args.db_name = db_name
+    args.table_name = table_name
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_fields(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_fields_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.ouch1 != None:
+      raise result.ouch1
+    if result.ouch2 != None:
+      raise result.ouch2
+    if result.ouch3 != None:
+      raise result.ouch3
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_fields failed: unknown result");
+
+  def create_table(self, tbl):
+    self.send_create_table(tbl)
+    self.recv_create_table()
+
+  def send_create_table(self, tbl):
+    self._oprot.writeMessageBegin('create_table', TMessageType.CALL, self._seqid)
+    args = create_table_args()
+    args.tbl = tbl
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_create_table(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = create_table_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.ouch1 != None:
+      raise result.ouch1
+    if result.ouch2 != None:
+      raise result.ouch2
+    if result.ouch3 != None:
+      raise result.ouch3
+    if result.o4 != None:
+      raise result.o4
+    return
+
+  def drop_table(self, dbname, name, deleteData):
+    self.send_drop_table(dbname, name, deleteData)
+    self.recv_drop_table()
+
+  def send_drop_table(self, dbname, name, deleteData):
+    self._oprot.writeMessageBegin('drop_table', TMessageType.CALL, self._seqid)
+    args = drop_table_args()
+    args.dbname = dbname
+    args.name = name
+    args.deleteData = deleteData
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_drop_table(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = drop_table_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.o1 != None:
+      raise result.o1
+    if result.ouch3 != None:
+      raise result.ouch3
+    return
+
+  def get_tables(self, db_name, pattern):
+    self.send_get_tables(db_name, pattern)
+    return self.recv_get_tables()
+
+  def send_get_tables(self, db_name, pattern):
+    self._oprot.writeMessageBegin('get_tables', TMessageType.CALL, self._seqid)
+    args = get_tables_args()
+    args.db_name = db_name
+    args.pattern = pattern
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_tables(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_tables_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.ouch1 != None:
+      raise result.ouch1
+    if result.ouch2 != None:
+      raise result.ouch2
+    if result.ouch3 != None:
+      raise result.ouch3
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_tables failed: unknown result");
+
+  def get_table(self, dbname, tbl_name):
+    self.send_get_table(dbname, tbl_name)
+    return self.recv_get_table()
+
+  def send_get_table(self, dbname, tbl_name):
+    self._oprot.writeMessageBegin('get_table', TMessageType.CALL, self._seqid)
+    args = get_table_args()
+    args.dbname = dbname
+    args.tbl_name = tbl_name
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_table(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_table_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_table failed: unknown result");
+
+  def set_table_parameters(self, dbname, tbl_name, params):
+    self.send_set_table_parameters(dbname, tbl_name, params)
+    return self.recv_set_table_parameters()
+
+  def send_set_table_parameters(self, dbname, tbl_name, params):
+    self._oprot.writeMessageBegin('set_table_parameters', TMessageType.CALL, self._seqid)
+    args = set_table_parameters_args()
+    args.dbname = dbname
+    args.tbl_name = tbl_name
+    args.params = params
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_set_table_parameters(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = set_table_parameters_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "set_table_parameters failed: unknown result");
+
+  def alter_table(self, dbname, tbl_name, new_tbl):
+    self.send_alter_table(dbname, tbl_name, new_tbl)
+    self.recv_alter_table()
+
+  def send_alter_table(self, dbname, tbl_name, new_tbl):
+    self._oprot.writeMessageBegin('alter_table', TMessageType.CALL, self._seqid)
+    args = alter_table_args()
+    args.dbname = dbname
+    args.tbl_name = tbl_name
+    args.new_tbl = new_tbl
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_alter_table(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = alter_table_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    return
+
+  def truncate_table(self, db_name, table_name, partition):
+    self.send_truncate_table(db_name, table_name, partition)
+    self.recv_truncate_table()
+
+  def send_truncate_table(self, db_name, table_name, partition):
+    self._oprot.writeMessageBegin('truncate_table', TMessageType.CALL, self._seqid)
+    args = truncate_table_args()
+    args.db_name = db_name
+    args.table_name = table_name
+    args.partition = partition
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_truncate_table(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = truncate_table_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.ouch1 != None:
+      raise result.ouch1
+    if result.ouch2 != None:
+      raise result.ouch2
+    if result.ouch3 != None:
+      raise result.ouch3
+    return
+
+  def cat(self, db_name, table_name, partition, high):
+    self.send_cat(db_name, table_name, partition, high)
+    return self.recv_cat()
+
+  def send_cat(self, db_name, table_name, partition, high):
+    self._oprot.writeMessageBegin('cat', TMessageType.CALL, self._seqid)
+    args = cat_args()
+    args.db_name = db_name
+    args.table_name = table_name
+    args.partition = partition
+    args.high = high
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_cat(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = cat_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.ouch1 != None:
+      raise result.ouch1
+    if result.ouch2 != None:
+      raise result.ouch2
+    if result.ouch3 != None:
+      raise result.ouch3
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "cat failed: unknown result");
+
+  def add_partition(self, new_part):
+    self.send_add_partition(new_part)
+    return self.recv_add_partition()
+
+  def send_add_partition(self, new_part):
+    self._oprot.writeMessageBegin('add_partition', TMessageType.CALL, self._seqid)
+    args = add_partition_args()
+    args.new_part = new_part
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_add_partition(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = add_partition_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    if result.o3 != None:
+      raise result.o3
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "add_partition failed: unknown result");
+
+  def append_partition(self, db_name, tbl_name, part_vals):
+    self.send_append_partition(db_name, tbl_name, part_vals)
+    return self.recv_append_partition()
+
+  def send_append_partition(self, db_name, tbl_name, part_vals):
+    self._oprot.writeMessageBegin('append_partition', TMessageType.CALL, self._seqid)
+    args = append_partition_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.part_vals = part_vals
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_append_partition(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = append_partition_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    if result.o3 != None:
+      raise result.o3
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "append_partition failed: unknown result");
+
+  def drop_partition(self, db_name, tbl_name, part_vals, deleteData):
+    self.send_drop_partition(db_name, tbl_name, part_vals, deleteData)
+    return self.recv_drop_partition()
+
+  def send_drop_partition(self, db_name, tbl_name, part_vals, deleteData):
+    self._oprot.writeMessageBegin('drop_partition', TMessageType.CALL, self._seqid)
+    args = drop_partition_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.part_vals = part_vals
+    args.deleteData = deleteData
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_drop_partition(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = drop_partition_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "drop_partition failed: unknown result");
+
+  def get_partition(self, db_name, tbl_name, part_vals):
+    self.send_get_partition(db_name, tbl_name, part_vals)
+    return self.recv_get_partition()
+
+  def send_get_partition(self, db_name, tbl_name, part_vals):
+    self._oprot.writeMessageBegin('get_partition', TMessageType.CALL, self._seqid)
+    args = get_partition_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.part_vals = part_vals
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_partition(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_partition_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_partition failed: unknown result");
+
+  def get_partitions(self, db_name, tbl_name, max_parts):
+    self.send_get_partitions(db_name, tbl_name, max_parts)
+    return self.recv_get_partitions()
+
+  def send_get_partitions(self, db_name, tbl_name, max_parts):
+    self._oprot.writeMessageBegin('get_partitions', TMessageType.CALL, self._seqid)
+    args = get_partitions_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.max_parts = max_parts
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_partitions(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_partitions_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_partitions failed: unknown result");
+
+  def set_partition_parameters(self, db_name, tbl_name, pname, params):
+    self.send_set_partition_parameters(db_name, tbl_name, pname, params)
+    return self.recv_set_partition_parameters()
+
+  def send_set_partition_parameters(self, db_name, tbl_name, pname, params):
+    self._oprot.writeMessageBegin('set_partition_parameters', TMessageType.CALL, self._seqid)
+    args = set_partition_parameters_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.pname = pname
+    args.params = params
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_set_partition_parameters(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = set_partition_parameters_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "set_partition_parameters failed: unknown result");
+
+  def alter_partitions(self, sd, parts):
+    self.send_alter_partitions(sd, parts)
+    return self.recv_alter_partitions()
+
+  def send_alter_partitions(self, sd, parts):
+    self._oprot.writeMessageBegin('alter_partitions', TMessageType.CALL, self._seqid)
+    args = alter_partitions_args()
+    args.sd = sd
+    args.parts = parts
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_alter_partitions(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = alter_partitions_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "alter_partitions failed: unknown result");
+
+  def create_index(self, index_def):
+    self.send_create_index(index_def)
+    return self.recv_create_index()
+
+  def send_create_index(self, index_def):
+    self._oprot.writeMessageBegin('create_index', TMessageType.CALL, self._seqid)
+    args = create_index_args()
+    args.index_def = index_def
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_create_index(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = create_index_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "create_index failed: unknown result");
+
+
+class Processor(fb303.FacebookService.Processor, Iface, TProcessor):
+  def __init__(self, handler):
+    fb303.FacebookService.Processor.__init__(self, handler)
+    self._processMap["create_database"] = Processor.process_create_database
+    self._processMap["get_database"] = Processor.process_get_database
+    self._processMap["drop_database"] = Processor.process_drop_database
+    self._processMap["get_databases"] = Processor.process_get_databases
+    self._processMap["get_type"] = Processor.process_get_type
+    self._processMap["create_type"] = Processor.process_create_type
+    self._processMap["drop_type"] = Processor.process_drop_type
+    self._processMap["get_type_all"] = Processor.process_get_type_all
+    self._processMap["get_fields"] = Processor.process_get_fields
+    self._processMap["create_table"] = Processor.process_create_table
+    self._processMap["drop_table"] = Processor.process_drop_table
+    self._processMap["get_tables"] = Processor.process_get_tables
+    self._processMap["get_table"] = Processor.process_get_table
+    self._processMap["set_table_parameters"] = Processor.process_set_table_parameters
+    self._processMap["alter_table"] = Processor.process_alter_table
+    self._processMap["truncate_table"] = Processor.process_truncate_table
+    self._processMap["cat"] = Processor.process_cat
+    self._processMap["add_partition"] = Processor.process_add_partition
+    self._processMap["append_partition"] = Processor.process_append_partition
+    self._processMap["drop_partition"] = Processor.process_drop_partition
+    self._processMap["get_partition"] = Processor.process_get_partition
+    self._processMap["get_partitions"] = Processor.process_get_partitions
+    self._processMap["set_partition_parameters"] = Processor.process_set_partition_parameters
+    self._processMap["alter_partitions"] = Processor.process_alter_partitions
+    self._processMap["create_index"] = Processor.process_create_index
+
+  def process(self, iprot, oprot):
+    (name, type, seqid) = iprot.readMessageBegin()
+    if name not in self._processMap:
+      iprot.skip(TType.STRUCT)
+      iprot.readMessageEnd()
+      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+      x.write(oprot)
+      oprot.writeMessageEnd()
+      oprot.trans.flush()
+      return
+    else:
+      self._processMap[name](self, seqid, iprot, oprot)
+    return True
+
+  def process_create_database(self, seqid, iprot, oprot):
+    args = create_database_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = create_database_result()
+    try:
+      result.success = self._handler.create_database(args.name, args.location_uri)
+    except AlreadyExistsException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("create_database", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_database(self, seqid, iprot, oprot):
+    args = get_database_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_database_result()
+    try:
+      result.success = self._handler.get_database(args.name)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_database", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_drop_database(self, seqid, iprot, oprot):
+    args = drop_database_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = drop_database_result()
+    try:
+      result.success = self._handler.drop_database(args.name)
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("drop_database", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_databases(self, seqid, iprot, oprot):
+    args = get_databases_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_databases_result()
+    try:
+      result.success = self._handler.get_databases()
+    except MetaException, o1:
+      result.o1 = o1
+    oprot.writeMessageBegin("get_databases", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_type(self, seqid, iprot, oprot):
+    args = get_type_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_type_result()
+    try:
+      result.success = self._handler.get_type(args.name)
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_type", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_create_type(self, seqid, iprot, oprot):
+    args = create_type_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = create_type_result()
+    try:
+      result.success = self._handler.create_type(args.type)
+    except AlreadyExistsException, o1:
+      result.o1 = o1
+    except InvalidObjectException, o2:
+      result.o2 = o2
+    except MetaException, o3:
+      result.o3 = o3
+    oprot.writeMessageBegin("create_type", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_drop_type(self, seqid, iprot, oprot):
+    args = drop_type_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = drop_type_result()
+    try:
+      result.success = self._handler.drop_type(args.type)
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("drop_type", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_type_all(self, seqid, iprot, oprot):
+    args = get_type_all_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_type_all_result()
+    try:
+      result.success = self._handler.get_type_all(args.name)
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_type_all", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_fields(self, seqid, iprot, oprot):
+    args = get_fields_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_fields_result()
+    try:
+      result.success = self._handler.get_fields(args.db_name, args.table_name)
+    except MetaException, ouch1:
+      result.ouch1 = ouch1
+    except UnknownTableException, ouch2:
+      result.ouch2 = ouch2
+    except UnknownDBException, ouch3:
+      result.ouch3 = ouch3
+    oprot.writeMessageBegin("get_fields", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_create_table(self, seqid, iprot, oprot):
+    args = create_table_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = create_table_result()
+    try:
+      self._handler.create_table(args.tbl)
+    except AlreadyExistsException, ouch1:
+      result.ouch1 = ouch1
+    except InvalidObjectException, ouch2:
+      result.ouch2 = ouch2
+    except MetaException, ouch3:
+      result.ouch3 = ouch3
+    except NoSuchObjectException, o4:
+      result.o4 = o4
+    oprot.writeMessageBegin("create_table", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_drop_table(self, seqid, iprot, oprot):
+    args = drop_table_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = drop_table_result()
+    try:
+      self._handler.drop_table(args.dbname, args.name, args.deleteData)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, ouch3:
+      result.ouch3 = ouch3
+    oprot.writeMessageBegin("drop_table", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_tables(self, seqid, iprot, oprot):
+    args = get_tables_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_tables_result()
+    try:
+      result.success = self._handler.get_tables(args.db_name, args.pattern)
+    except MetaException, ouch1:
+      result.ouch1 = ouch1
+    except UnknownTableException, ouch2:
+      result.ouch2 = ouch2
+    except UnknownDBException, ouch3:
+      result.ouch3 = ouch3
+    oprot.writeMessageBegin("get_tables", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_table(self, seqid, iprot, oprot):
+    args = get_table_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_table_result()
+    try:
+      result.success = self._handler.get_table(args.dbname, args.tbl_name)
+    except MetaException, o1:
+      result.o1 = o1
+    except NoSuchObjectException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_table", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_set_table_parameters(self, seqid, iprot, oprot):
+    args = set_table_parameters_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = set_table_parameters_result()
+    try:
+      result.success = self._handler.set_table_parameters(args.dbname, args.tbl_name, args.params)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("set_table_parameters", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_alter_table(self, seqid, iprot, oprot):
+    args = alter_table_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = alter_table_result()
+    try:
+      self._handler.alter_table(args.dbname, args.tbl_name, args.new_tbl)
+    except InvalidOperationException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("alter_table", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_truncate_table(self, seqid, iprot, oprot):
+    args = truncate_table_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = truncate_table_result()
+    try:
+      self._handler.truncate_table(args.db_name, args.table_name, args.partition)
+    except MetaException, ouch1:
+      result.ouch1 = ouch1
+    except UnknownTableException, ouch2:
+      result.ouch2 = ouch2
+    except UnknownDBException, ouch3:
+      result.ouch3 = ouch3
+    oprot.writeMessageBegin("truncate_table", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_cat(self, seqid, iprot, oprot):
+    args = cat_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = cat_result()
+    try:
+      result.success = self._handler.cat(args.db_name, args.table_name, args.partition, args.high)
+    except MetaException, ouch1:
+      result.ouch1 = ouch1
+    except UnknownDBException, ouch2:
+      result.ouch2 = ouch2
+    except UnknownTableException, ouch3:
+      result.ouch3 = ouch3
+    oprot.writeMessageBegin("cat", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_add_partition(self, seqid, iprot, oprot):
+    args = add_partition_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = add_partition_result()
+    try:
+      result.success = self._handler.add_partition(args.new_part)
+    except InvalidObjectException, o1:
+      result.o1 = o1
+    except AlreadyExistsException, o2:
+      result.o2 = o2
+    except MetaException, o3:
+      result.o3 = o3
+    oprot.writeMessageBegin("add_partition", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_append_partition(self, seqid, iprot, oprot):
+    args = append_partition_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = append_partition_result()
+    try:
+      result.success = self._handler.append_partition(args.db_name, args.tbl_name, args.part_vals)
+    except InvalidObjectException, o1:
+      result.o1 = o1
+    except AlreadyExistsException, o2:
+      result.o2 = o2
+    except MetaException, o3:
+      result.o3 = o3
+    oprot.writeMessageBegin("append_partition", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_drop_partition(self, seqid, iprot, oprot):
+    args = drop_partition_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = drop_partition_result()
+    try:
+      result.success = self._handler.drop_partition(args.db_name, args.tbl_name, args.part_vals, args.deleteData)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("drop_partition", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_partition(self, seqid, iprot, oprot):
+    args = get_partition_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_partition_result()
+    try:
+      result.success = self._handler.get_partition(args.db_name, args.tbl_name, args.part_vals)
+    except MetaException, o1:
+      result.o1 = o1
+    oprot.writeMessageBegin("get_partition", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_partitions(self, seqid, iprot, oprot):
+    args = get_partitions_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_partitions_result()
+    try:
+      result.success = self._handler.get_partitions(args.db_name, args.tbl_name, args.max_parts)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_partitions", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_set_partition_parameters(self, seqid, iprot, oprot):
+    args = set_partition_parameters_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = set_partition_parameters_result()
+    try:
+      result.success = self._handler.set_partition_parameters(args.db_name, args.tbl_name, args.pname, args.params)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("set_partition_parameters", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_alter_partitions(self, seqid, iprot, oprot):
+    args = alter_partitions_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = alter_partitions_result()
+    try:
+      result.success = self._handler.alter_partitions(args.sd, args.parts)
+    except InvalidOperationException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("alter_partitions", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_create_index(self, seqid, iprot, oprot):
+    args = create_index_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = create_index_result()
+    try:
+      result.success = self._handler.create_index(args.index_def)
+    except IndexAlreadyExistsException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("create_index", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+class create_database_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'name', None, None, ), # 1
+    (2, TType.STRING, 'location_uri', None, None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.name = None
+    self.location_uri = None
+    if isinstance(d, dict):
+      if 'name' in d:
+        self.name = d['name']
+      if 'location_uri' in d:
+        self.location_uri = d['location_uri']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.location_uri = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_database_args')
+    if self.name != None:
+      oprot.writeFieldBegin('name', TType.STRING, 1)
+      oprot.writeString(self.name)
+      oprot.writeFieldEnd()
+    if self.location_uri != None:
+      oprot.writeFieldBegin('location_uri', TType.STRING, 2)
+      oprot.writeString(self.location_uri)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class create_database_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = AlreadyExistsException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_database_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_database_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'name', None, None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.name = None
+    if isinstance(d, dict):
+      if 'name' in d:
+        self.name = d['name']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_database_args')
+    if self.name != None:
+      oprot.writeFieldBegin('name', TType.STRING, 1)
+      oprot.writeString(self.name)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_database_result:
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Database, Database.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Database()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_database_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_database_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'name', None, None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.name = None
+    if isinstance(d, dict):
+      if 'name' in d:
+        self.name = d['name']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_database_args')
+    if self.name != None:
+      oprot.writeFieldBegin('name', TType.STRING, 1)
+      oprot.writeString(self.name)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_database_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    None, # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_database_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_databases_args:
+
+  thrift_spec = (
+  )
+
+  def __init__(self, d=None):
+    pass
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_databases_args')
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_databases_result:
+
+  thrift_spec = (
+    (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0
+    (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.LIST:
+          self.success = []
+          (_etype88, _size85) = iprot.readListBegin()
+          for _i89 in xrange(_size85):
+            _elem90 = iprot.readString();
+            self.success.append(_elem90)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = MetaException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_databases_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.LIST, 0)
+      oprot.writeListBegin(TType.STRING, len(self.success))
+      for iter91 in self.success:
+        oprot.writeString(iter91)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_type_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'name', None, None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.name = None
+    if isinstance(d, dict):
+      if 'name' in d:
+        self.name = d['name']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_type_args')
+    if self.name != None:
+      oprot.writeFieldBegin('name', TType.STRING, 1)
+      oprot.writeString(self.name)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_type_result:
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Type, Type.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Type()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_type_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 1)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class create_type_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'type', (Type, Type.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.type = None
+    if isinstance(d, dict):
+      if 'type' in d:
+        self.type = d['type']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.type = Type()
+          self.type.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_type_args')
+    if self.type != None:
+      oprot.writeFieldBegin('type', TType.STRUCT, 1)
+      self.type.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class create_type_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (InvalidObjectException, InvalidObjectException.thrift_spec), None, ), # 2
+    (3, TType.STRUCT, 'o3', (MetaException, MetaException.thrift_spec), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    self.o3 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+      if 'o3' in d:
+        self.o3 = d['o3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = AlreadyExistsException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = InvalidObjectException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.o3 = MetaException()
+          self.o3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_type_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o3 != None:
+      oprot.writeFieldBegin('o3', TType.STRUCT, 3)
+      self.o3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_type_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'type', None, None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.type = None
+    if isinstance(d, dict):
+      if 'type' in d:
+        self.type = d['type']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.type = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_type_args')
+    if self.type != None:
+      oprot.writeFieldBegin('type', TType.STRING, 1)
+      oprot.writeString(self.type)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_type_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_type_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 1)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_type_all_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'name', None, None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.name = None
+    if isinstance(d, dict):
+      if 'name' in d:
+        self.name = d['name']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_type_all_args')
+    if self.name != None:
+      oprot.writeFieldBegin('name', TType.STRING, 1)
+      oprot.writeString(self.name)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_type_all_result:
+
+  thrift_spec = (
+    (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(Type, Type.thrift_spec)), None, ), # 0
+    (1, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.MAP:
+          self.success = {}
+          (_ktype93, _vtype94, _size92 ) = iprot.readMapBegin() 
+          for _i96 in xrange(_size92):
+            _key97 = iprot.readString();
+            _val98 = Type()
+            _val98.read(iprot)
+            self.success[_key97] = _val98
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_type_all_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.MAP, 0)
+      oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success))
+      for kiter99,viter100 in self.success.items():
+        oprot.writeString(kiter99)
+        viter100.write(oprot)
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 1)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_fields_args:
+
+  thrift_spec = None
+  def __init__(self, d=None):
+    self.db_name = None
+    self.table_name = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'table_name' in d:
+        self.table_name = d['table_name']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == -1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == -2:
+        if ftype == TType.STRING:
+          self.table_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_fields_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, -1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.table_name != None:
+      oprot.writeFieldBegin('table_name', TType.STRING, -2)
+      oprot.writeString(self.table_name)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_fields_result:
+
+  thrift_spec = None
+  def __init__(self, d=None):
+    self.success = None
+    self.ouch1 = None
+    self.ouch2 = None
+    self.ouch3 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'ouch1' in d:
+        self.ouch1 = d['ouch1']
+      if 'ouch2' in d:
+        self.ouch2 = d['ouch2']
+      if 'ouch3' in d:
+        self.ouch3 = d['ouch3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.LIST:
+          self.success = []
+          (_etype104, _size101) = iprot.readListBegin()
+          for _i105 in xrange(_size101):
+            _elem106 = FieldSchema()
+            _elem106.read(iprot)
+            self.success.append(_elem106)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == -3:
+        if ftype == TType.STRUCT:
+          self.ouch1 = MetaException()
+          self.ouch1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == -4:
+        if ftype == TType.STRUCT:
+          self.ouch2 = UnknownTableException()
+          self.ouch2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == -5:
+        if ftype == TType.STRUCT:
+          self.ouch3 = UnknownDBException()
+          self.ouch3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_fields_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.LIST, 0)
+      oprot.writeListBegin(TType.STRUCT, len(self.success))
+      for iter107 in self.success:
+        iter107.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.ouch1 != None:
+      oprot.writeFieldBegin('ouch1', TType.STRUCT, -3)
+      self.ouch1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch2 != None:
+      oprot.writeFieldBegin('ouch2', TType.STRUCT, -4)
+      self.ouch2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch3 != None:
+      oprot.writeFieldBegin('ouch3', TType.STRUCT, -5)
+      self.ouch3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class create_table_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'tbl', (Table, Table.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.tbl = None
+    if isinstance(d, dict):
+      if 'tbl' in d:
+        self.tbl = d['tbl']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.tbl = Table()
+          self.tbl.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_table_args')
+    if self.tbl != None:
+      oprot.writeFieldBegin('tbl', TType.STRUCT, 1)
+      self.tbl.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class create_table_result:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'ouch1', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'ouch2', (InvalidObjectException, InvalidObjectException.thrift_spec), None, ), # 2
+    (3, TType.STRUCT, 'ouch3', (MetaException, MetaException.thrift_spec), None, ), # 3
+    (4, TType.STRUCT, 'o4', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 4
+  )
+
+  def __init__(self, d=None):
+    self.ouch1 = None
+    self.ouch2 = None
+    self.ouch3 = None
+    self.o4 = None
+    if isinstance(d, dict):
+      if 'ouch1' in d:
+        self.ouch1 = d['ouch1']
+      if 'ouch2' in d:
+        self.ouch2 = d['ouch2']
+      if 'ouch3' in d:
+        self.ouch3 = d['ouch3']
+      if 'o4' in d:
+        self.o4 = d['o4']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.ouch1 = AlreadyExistsException()
+          self.ouch1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.ouch2 = InvalidObjectException()
+          self.ouch2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.ouch3 = MetaException()
+          self.ouch3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRUCT:
+          self.o4 = NoSuchObjectException()
+          self.o4.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_table_result')
+    if self.ouch1 != None:
+      oprot.writeFieldBegin('ouch1', TType.STRUCT, 1)
+      self.ouch1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch2 != None:
+      oprot.writeFieldBegin('ouch2', TType.STRUCT, 2)
+      self.ouch2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch3 != None:
+      oprot.writeFieldBegin('ouch3', TType.STRUCT, 3)
+      self.ouch3.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o4 != None:
+      oprot.writeFieldBegin('o4', TType.STRUCT, 4)
+      self.o4.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_table_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'dbname', None, None, ), # 1
+    (2, TType.STRING, 'name', None, None, ), # 2
+    (3, TType.BOOL, 'deleteData', None, None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.dbname = None
+    self.name = None
+    self.deleteData = None
+    if isinstance(d, dict):
+      if 'dbname' in d:
+        self.dbname = d['dbname']
+      if 'name' in d:
+        self.name = d['name']
+      if 'deleteData' in d:
+        self.deleteData = d['deleteData']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.dbname = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.BOOL:
+          self.deleteData = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_table_args')
+    if self.dbname != None:
+      oprot.writeFieldBegin('dbname', TType.STRING, 1)
+      oprot.writeString(self.dbname)
+      oprot.writeFieldEnd()
+    if self.name != None:
+      oprot.writeFieldBegin('name', TType.STRING, 2)
+      oprot.writeString(self.name)
+      oprot.writeFieldEnd()
+    if self.deleteData != None:
+      oprot.writeFieldBegin('deleteData', TType.BOOL, 3)
+      oprot.writeBool(self.deleteData)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_table_result:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'ouch3', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.o1 = None
+    self.ouch3 = None
+    if isinstance(d, dict):
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'ouch3' in d:
+        self.ouch3 = d['ouch3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.ouch3 = MetaException()
+          self.ouch3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_table_result')
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch3 != None:
+      oprot.writeFieldBegin('ouch3', TType.STRUCT, 2)
+      self.ouch3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_tables_args:
+
+  thrift_spec = None
+  def __init__(self, d=None):
+    self.db_name = None
+    self.pattern = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'pattern' in d:
+        self.pattern = d['pattern']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == -1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == -2:
+        if ftype == TType.STRING:
+          self.pattern = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_tables_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, -1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.pattern != None:
+      oprot.writeFieldBegin('pattern', TType.STRING, -2)
+      oprot.writeString(self.pattern)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_tables_result:
+
+  thrift_spec = None
+  def __init__(self, d=None):
+    self.success = None
+    self.ouch1 = None
+    self.ouch2 = None
+    self.ouch3 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'ouch1' in d:
+        self.ouch1 = d['ouch1']
+      if 'ouch2' in d:
+        self.ouch2 = d['ouch2']
+      if 'ouch3' in d:
+        self.ouch3 = d['ouch3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.LIST:
+          self.success = []
+          (_etype111, _size108) = iprot.readListBegin()
+          for _i112 in xrange(_size108):
+            _elem113 = iprot.readString();
+            self.success.append(_elem113)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == -3:
+        if ftype == TType.STRUCT:
+          self.ouch1 = MetaException()
+          self.ouch1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == -4:
+        if ftype == TType.STRUCT:
+          self.ouch2 = UnknownTableException()
+          self.ouch2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == -5:
+        if ftype == TType.STRUCT:
+          self.ouch3 = UnknownDBException()
+          self.ouch3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_tables_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.LIST, 0)
+      oprot.writeListBegin(TType.STRING, len(self.success))
+      for iter114 in self.success:
+        oprot.writeString(iter114)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.ouch1 != None:
+      oprot.writeFieldBegin('ouch1', TType.STRUCT, -3)
+      self.ouch1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch2 != None:
+      oprot.writeFieldBegin('ouch2', TType.STRUCT, -4)
+      self.ouch2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch3 != None:
+      oprot.writeFieldBegin('ouch3', TType.STRUCT, -5)
+      self.ouch3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_table_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'dbname', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.dbname = None
+    self.tbl_name = None
+    if isinstance(d, dict):
+      if 'dbname' in d:
+        self.dbname = d['dbname']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.dbname = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_table_args')
+    if self.dbname != None:
+      oprot.writeFieldBegin('dbname', TType.STRING, 1)
+      oprot.writeString(self.dbname)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_table_result:
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Table, Table.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Table()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = MetaException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = NoSuchObjectException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_table_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class set_table_parameters_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'dbname', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.MAP, 'params', (TType.STRING,None,TType.STRING,None), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.dbname = None
+    self.tbl_name = None
+    self.params = None
+    if isinstance(d, dict):
+      if 'dbname' in d:
+        self.dbname = d['dbname']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+      if 'params' in d:
+        self.params = d['params']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.dbname = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.MAP:
+          self.params = {}
+          (_ktype116, _vtype117, _size115 ) = iprot.readMapBegin() 
+          for _i119 in xrange(_size115):
+            _key120 = iprot.readString();
+            _val121 = iprot.readString();
+            self.params[_key120] = _val121
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('set_table_parameters_args')
+    if self.dbname != None:
+      oprot.writeFieldBegin('dbname', TType.STRING, 1)
+      oprot.writeString(self.dbname)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.params != None:
+      oprot.writeFieldBegin('params', TType.MAP, 3)
+      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
+      for kiter122,viter123 in self.params.items():
+        oprot.writeString(kiter122)
+        oprot.writeString(viter123)
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class set_table_parameters_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('set_table_parameters_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class alter_table_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'dbname', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.STRUCT, 'new_tbl', (Table, Table.thrift_spec), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.dbname = None
+    self.tbl_name = None
+    self.new_tbl = None
+    if isinstance(d, dict):
+      if 'dbname' in d:
+        self.dbname = d['dbname']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+      if 'new_tbl' in d:
+        self.new_tbl = d['new_tbl']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.dbname = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.new_tbl = Table()
+          self.new_tbl.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('alter_table_args')
+    if self.dbname != None:
+      oprot.writeFieldBegin('dbname', TType.STRING, 1)
+      oprot.writeString(self.dbname)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.new_tbl != None:
+      oprot.writeFieldBegin('new_tbl', TType.STRUCT, 3)
+      self.new_tbl.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class alter_table_result:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'o1', (InvalidOperationException, InvalidOperationException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = InvalidOperationException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('alter_table_result')
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class truncate_table_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'table_name', None, None, ), # 2
+    (3, TType.STRING, 'partition', None, None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.db_name = None
+    self.table_name = None
+    self.partition = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'table_name' in d:
+        self.table_name = d['table_name']
+      if 'partition' in d:
+        self.partition = d['partition']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.table_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.partition = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('truncate_table_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.table_name != None:
+      oprot.writeFieldBegin('table_name', TType.STRING, 2)
+      oprot.writeString(self.table_name)
+      oprot.writeFieldEnd()
+    if self.partition != None:
+      oprot.writeFieldBegin('partition', TType.STRING, 3)
+      oprot.writeString(self.partition)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class truncate_table_result:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'ouch1', (MetaException, MetaException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'ouch2', (UnknownTableException, UnknownTableException.thrift_spec), None, ), # 2
+    (3, TType.STRUCT, 'ouch3', (UnknownDBException, UnknownDBException.thrift_spec), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.ouch1 = None
+    self.ouch2 = None
+    self.ouch3 = None
+    if isinstance(d, dict):
+      if 'ouch1' in d:
+        self.ouch1 = d['ouch1']
+      if 'ouch2' in d:
+        self.ouch2 = d['ouch2']
+      if 'ouch3' in d:
+        self.ouch3 = d['ouch3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.ouch1 = MetaException()
+          self.ouch1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.ouch2 = UnknownTableException()
+          self.ouch2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.ouch3 = UnknownDBException()
+          self.ouch3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('truncate_table_result')
+    if self.ouch1 != None:
+      oprot.writeFieldBegin('ouch1', TType.STRUCT, 1)
+      self.ouch1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch2 != None:
+      oprot.writeFieldBegin('ouch2', TType.STRUCT, 2)
+      self.ouch2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch3 != None:
+      oprot.writeFieldBegin('ouch3', TType.STRUCT, 3)
+      self.ouch3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class cat_args:
+
+  thrift_spec = None
+  def __init__(self, d=None):
+    self.db_name = None
+    self.table_name = None
+    self.partition = None
+    self.high = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'table_name' in d:
+        self.table_name = d['table_name']
+      if 'partition' in d:
+        self.partition = d['partition']
+      if 'high' in d:
+        self.high = d['high']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.table_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.partition = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == -1:
+        if ftype == TType.I32:
+          self.high = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('cat_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.table_name != None:
+      oprot.writeFieldBegin('table_name', TType.STRING, 2)
+      oprot.writeString(self.table_name)
+      oprot.writeFieldEnd()
+    if self.partition != None:
+      oprot.writeFieldBegin('partition', TType.STRING, 3)
+      oprot.writeString(self.partition)
+      oprot.writeFieldEnd()
+    if self.high != None:
+      oprot.writeFieldBegin('high', TType.I32, -1)
+      oprot.writeI32(self.high)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class cat_result:
+
+  thrift_spec = None
+  def __init__(self, d=None):
+    self.success = None
+    self.ouch1 = None
+    self.ouch2 = None
+    self.ouch3 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'ouch1' in d:
+        self.ouch1 = d['ouch1']
+      if 'ouch2' in d:
+        self.ouch2 = d['ouch2']
+      if 'ouch3' in d:
+        self.ouch3 = d['ouch3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.LIST:
+          self.success = []
+          (_etype127, _size124) = iprot.readListBegin()
+          for _i128 in xrange(_size124):
+            _elem129 = iprot.readString();
+            self.success.append(_elem129)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == -2:
+        if ftype == TType.STRUCT:
+          self.ouch1 = MetaException()
+          self.ouch1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == -3:
+        if ftype == TType.STRUCT:
+          self.ouch2 = UnknownDBException()
+          self.ouch2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == -4:
+        if ftype == TType.STRUCT:
+          self.ouch3 = UnknownTableException()
+          self.ouch3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('cat_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.LIST, 0)
+      oprot.writeListBegin(TType.STRING, len(self.success))
+      for iter130 in self.success:
+        oprot.writeString(iter130)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.ouch1 != None:
+      oprot.writeFieldBegin('ouch1', TType.STRUCT, -2)
+      self.ouch1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch2 != None:
+      oprot.writeFieldBegin('ouch2', TType.STRUCT, -3)
+      self.ouch2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.ouch3 != None:
+      oprot.writeFieldBegin('ouch3', TType.STRUCT, -4)
+      self.ouch3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class add_partition_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'new_part', (Partition, Partition.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.new_part = None
+    if isinstance(d, dict):
+      if 'new_part' in d:
+        self.new_part = d['new_part']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.new_part = Partition()
+          self.new_part.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('add_partition_args')
+    if self.new_part != None:
+      oprot.writeFieldBegin('new_part', TType.STRUCT, 1)
+      self.new_part.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class add_partition_result:
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Partition, Partition.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o1', (InvalidObjectException, InvalidObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 2
+    (3, TType.STRUCT, 'o3', (MetaException, MetaException.thrift_spec), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    self.o3 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+      if 'o3' in d:
+        self.o3 = d['o3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Partition()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = InvalidObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = AlreadyExistsException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.o3 = MetaException()
+          self.o3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('add_partition_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o3 != None:
+      oprot.writeFieldBegin('o3', TType.STRUCT, 3)
+      self.o3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class append_partition_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.LIST, 'part_vals', (TType.STRING,None), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.db_name = None
+    self.tbl_name = None
+    self.part_vals = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+      if 'part_vals' in d:
+        self.part_vals = d['part_vals']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.LIST:
+          self.part_vals = []
+          (_etype134, _size131) = iprot.readListBegin()
+          for _i135 in xrange(_size131):
+            _elem136 = iprot.readString();
+            self.part_vals.append(_elem136)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('append_partition_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.part_vals != None:
+      oprot.writeFieldBegin('part_vals', TType.LIST, 3)
+      oprot.writeListBegin(TType.STRING, len(self.part_vals))
+      for iter137 in self.part_vals:
+        oprot.writeString(iter137)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class append_partition_result:
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Partition, Partition.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o1', (InvalidObjectException, InvalidObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 2
+    (3, TType.STRUCT, 'o3', (MetaException, MetaException.thrift_spec), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    self.o3 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+      if 'o3' in d:
+        self.o3 = d['o3']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Partition()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = InvalidObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = AlreadyExistsException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.o3 = MetaException()
+          self.o3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('append_partition_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o3 != None:
+      oprot.writeFieldBegin('o3', TType.STRUCT, 3)
+      self.o3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_partition_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.LIST, 'part_vals', (TType.STRING,None), None, ), # 3
+    (4, TType.BOOL, 'deleteData', None, None, ), # 4
+  )
+
+  def __init__(self, d=None):
+    self.db_name = None
+    self.tbl_name = None
+    self.part_vals = None
+    self.deleteData = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+      if 'part_vals' in d:
+        self.part_vals = d['part_vals']
+      if 'deleteData' in d:
+        self.deleteData = d['deleteData']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.LIST:
+          self.part_vals = []
+          (_etype141, _size138) = iprot.readListBegin()
+          for _i142 in xrange(_size138):
+            _elem143 = iprot.readString();
+            self.part_vals.append(_elem143)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.BOOL:
+          self.deleteData = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_partition_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.part_vals != None:
+      oprot.writeFieldBegin('part_vals', TType.LIST, 3)
+      oprot.writeListBegin(TType.STRING, len(self.part_vals))
+      for iter144 in self.part_vals:
+        oprot.writeString(iter144)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.deleteData != None:
+      oprot.writeFieldBegin('deleteData', TType.BOOL, 4)
+      oprot.writeBool(self.deleteData)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_partition_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_partition_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_partition_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.LIST, 'part_vals', (TType.STRING,None), None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.db_name = None
+    self.tbl_name = None
+    self.part_vals = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+      if 'part_vals' in d:
+        self.part_vals = d['part_vals']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.LIST:
+          self.part_vals = []
+          (_etype148, _size145) = iprot.readListBegin()
+          for _i149 in xrange(_size145):
+            _elem150 = iprot.readString();
+            self.part_vals.append(_elem150)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_partition_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.part_vals != None:
+      oprot.writeFieldBegin('part_vals', TType.LIST, 3)
+      oprot.writeListBegin(TType.STRING, len(self.part_vals))
+      for iter151 in self.part_vals:
+        oprot.writeString(iter151)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_partition_result:
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Partition, Partition.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Partition()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = MetaException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_partition_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_partitions_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.I16, 'max_parts', None, None, ), # 3
+  )
+
+  def __init__(self, d=None):
+    self.db_name = None
+    self.tbl_name = None
+    self.max_parts = -1
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+      if 'max_parts' in d:
+        self.max_parts = d['max_parts']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.I16:
+          self.max_parts = iprot.readI16();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_partitions_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.max_parts != None:
+      oprot.writeFieldBegin('max_parts', TType.I16, 3)
+      oprot.writeI16(self.max_parts)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_partitions_result:
+
+  thrift_spec = (
+    (0, TType.LIST, 'success', (TType.STRUCT,(Partition, Partition.thrift_spec)), None, ), # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.LIST:
+          self.success = []
+          (_etype155, _size152) = iprot.readListBegin()
+          for _i156 in xrange(_size152):
+            _elem157 = Partition()
+            _elem157.read(iprot)
+            self.success.append(_elem157)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_partitions_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.LIST, 0)
+      oprot.writeListBegin(TType.STRUCT, len(self.success))
+      for iter158 in self.success:
+        iter158.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class set_partition_parameters_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.STRING, 'pname', None, None, ), # 3
+    (4, TType.MAP, 'params', (TType.STRING,None,TType.STRING,None), None, ), # 4
+  )
+
+  def __init__(self, d=None):
+    self.db_name = None
+    self.tbl_name = None
+    self.pname = None
+    self.params = None
+    if isinstance(d, dict):
+      if 'db_name' in d:
+        self.db_name = d['db_name']
+      if 'tbl_name' in d:
+        self.tbl_name = d['tbl_name']
+      if 'pname' in d:
+        self.pname = d['pname']
+      if 'params' in d:
+        self.params = d['params']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.pname = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.MAP:
+          self.params = {}
+          (_ktype160, _vtype161, _size159 ) = iprot.readMapBegin() 
+          for _i163 in xrange(_size159):
+            _key164 = iprot.readString();
+            _val165 = iprot.readString();
+            self.params[_key164] = _val165
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('set_partition_parameters_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.pname != None:
+      oprot.writeFieldBegin('pname', TType.STRING, 3)
+      oprot.writeString(self.pname)
+      oprot.writeFieldEnd()
+    if self.params != None:
+      oprot.writeFieldBegin('params', TType.MAP, 4)
+      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
+      for kiter166,viter167 in self.params.items():
+        oprot.writeString(kiter166)
+        oprot.writeString(viter167)
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class set_partition_parameters_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('set_partition_parameters_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class alter_partitions_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'sd', (StorageDescriptor, StorageDescriptor.thrift_spec), None, ), # 1
+    (2, TType.LIST, 'parts', (TType.STRING,None), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.sd = None
+    self.parts = None
+    if isinstance(d, dict):
+      if 'sd' in d:
+        self.sd = d['sd']
+      if 'parts' in d:
+        self.parts = d['parts']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.sd = StorageDescriptor()
+          self.sd.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.LIST:
+          self.parts = []
+          (_etype171, _size168) = iprot.readListBegin()
+          for _i172 in xrange(_size168):
+            _elem173 = iprot.readString();
+            self.parts.append(_elem173)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('alter_partitions_args')
+    if self.sd != None:
+      oprot.writeFieldBegin('sd', TType.STRUCT, 1)
+      self.sd.write(oprot)
+      oprot.writeFieldEnd()
+    if self.parts != None:
+      oprot.writeFieldBegin('parts', TType.LIST, 2)
+      oprot.writeListBegin(TType.STRING, len(self.parts))
+      for iter174 in self.parts:
+        oprot.writeString(iter174)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class alter_partitions_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (InvalidOperationException, InvalidOperationException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = InvalidOperationException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('alter_partitions_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class create_index_args:
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'index_def', (Index, Index.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, d=None):
+    self.index_def = None
+    if isinstance(d, dict):
+      if 'index_def' in d:
+        self.index_def = d['index_def']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.index_def = Index()
+          self.index_def.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_index_args')
+    if self.index_def != None:
+      oprot.writeFieldBegin('index_def', TType.STRUCT, 1)
+      self.index_def.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class create_index_result:
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (IndexAlreadyExistsException, IndexAlreadyExistsException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, d=None):
+    self.success = None
+    self.o1 = None
+    self.o2 = None
+    if isinstance(d, dict):
+      if 'success' in d:
+        self.success = d['success']
+      if 'o1' in d:
+        self.o1 = d['o1']
+      if 'o2' in d:
+        self.o2 = d['o2']
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = IndexAlreadyExistsException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('create_index_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __str__(self): 
+    return str(self.__dict__)
+
+  def __repr__(self): 
+    return repr(self.__dict__)
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+

+ 149 - 0
src/contrib/hive/metastore/src/gen-py/hive_metastore/ThriftMetaStore-remote

@@ -0,0 +1,149 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+import sys
+import pprint
+from urlparse import urlparse
+from thrift.transport import TTransport
+from thrift.transport import TSocket
+from thrift.transport import THttpClient
+from thrift.protocol import TBinaryProtocol
+
+import ThriftMetaStore
+from ttypes import *
+
+if len(sys.argv) <= 1 or sys.argv[1] == '--help':
+  print ''
+  print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
+  print ''
+  print 'Functions:'
+  print '   get_fields(string db_name, string table_name)'
+  print '   get_tables(string db_name, string pattern)'
+  print '   get_schema(string table_name)'
+  print '  void alter_table(string db_name, string table_name,  schema)'
+  print '  void create_table(string db_name, string table_name,  schema)'
+  print '  void drop_table(string db_name, string table_name)'
+  print '  void truncate_table(string db_name, string table_name, string partition)'
+  print '  bool table_exists(string db_name, string table_name)'
+  print '   get_partitions(string db_name, string table_name)'
+  print '   get_dbs()'
+  print '   cat(string db_name, string table_name, string partition, i32 high)'
+  print ''
+  sys.exit(0)
+
+pp = pprint.PrettyPrinter(indent = 2)
+host = 'localhost'
+port = 9090
+uri = ''
+framed = False
+http = False
+argi = 1
+
+if sys.argv[argi] == '-h':
+  parts = sys.argv[argi+1].split(':') 
+  host = parts[0]
+  port = int(parts[1])
+  argi += 2
+
+if sys.argv[argi] == '-u':
+  url = urlparse(sys.argv[argi+1])
+  parts = url[1].split(':') 
+  host = parts[0]
+  if len(parts) > 1:
+    port = int(parts[1])
+  else:
+    port = 80
+  uri = url[2]
+  http = True
+  argi += 2
+
+if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
+  framed = True
+  argi += 1
+
+cmd = sys.argv[argi]
+args = sys.argv[argi+1:]
+
+if http:
+  transport = THttpClient.THttpClient(host, port, uri)
+else:
+  socket = TSocket.TSocket(host, port)
+  if framed:
+    transport = TTransport.TFramedTransport(socket)
+  else:
+    transport = TTransport.TBufferedTransport(socket)
+protocol = TBinaryProtocol.TBinaryProtocol(transport)
+client = ThriftMetaStore.Client(protocol)
+transport.open()
+
+if cmd == 'get_fields':
+  if len(args) != 2:
+    print 'get_fields requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_fields(args[0],args[1],))
+
+elif cmd == 'get_tables':
+  if len(args) != 2:
+    print 'get_tables requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_tables(args[0],args[1],))
+
+elif cmd == 'get_schema':
+  if len(args) != 1:
+    print 'get_schema requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_schema(args[0],))
+
+elif cmd == 'alter_table':
+  if len(args) != 3:
+    print 'alter_table requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.alter_table(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'create_table':
+  if len(args) != 3:
+    print 'create_table requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.create_table(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'drop_table':
+  if len(args) != 2:
+    print 'drop_table requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.drop_table(args[0],args[1],))
+
+elif cmd == 'truncate_table':
+  if len(args) != 3:
+    print 'truncate_table requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.truncate_table(args[0],args[1],args[2],))
+
+elif cmd == 'table_exists':
+  if len(args) != 2:
+    print 'table_exists requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.table_exists(args[0],args[1],))
+
+elif cmd == 'get_partitions':
+  if len(args) != 2:
+    print 'get_partitions requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions(args[0],args[1],))
+
+elif cmd == 'get_dbs':
+  if len(args) != 0:
+    print 'get_dbs requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.get_dbs())
+
+elif cmd == 'cat':
+  if len(args) != 4:
+    print 'cat requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.cat(args[0],args[1],args[2],eval(args[3]),))
+
+transport.close()

Fichier diff supprimé car celui-ci est trop grand
+ 255 - 457
src/contrib/hive/metastore/src/gen-py/hive_metastore/ThriftMetaStore.py


+ 161 - 68
src/contrib/hive/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java

@@ -30,7 +30,6 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
 import org.apache.hadoop.hive.metastore.api.Database;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
@@ -57,10 +56,12 @@ import com.facebook.fb303.FacebookBase;
 import com.facebook.fb303.FacebookService;
 import com.facebook.fb303.fb_status;
 import com.facebook.thrift.TException;
+import com.facebook.thrift.protocol.TBinaryProtocol;
 import com.facebook.thrift.server.TServer;
 import com.facebook.thrift.server.TThreadPoolServer;
 import com.facebook.thrift.transport.TServerSocket;
 import com.facebook.thrift.transport.TServerTransport;
+import com.facebook.thrift.transport.TTransportFactory;
 
 /**
  * TODO:pc remove application logic to a separate interface. rename to MetaStoreServer
@@ -68,11 +69,28 @@ import com.facebook.thrift.transport.TServerTransport;
 public class HiveMetaStore extends ThriftHiveMetastore {
   
     public static class HMSHandler extends FacebookBase implements ThriftHiveMetastore.Iface{
-      public static final Log LOG = LogFactory.getLog("hive.metastore");
+      public static final Log LOG = LogFactory.getLog(HiveMetaStore.class.getName());
+      private static boolean createDefaultDB = false;
+      private String rawStoreClassName;
       private HiveConf hiveConf; // stores datastore (jpox) properties, right now they come from jpox.properties
-      private RawStore ms; // a metadata store
       private Warehouse wh; // hdfs warehouse
-    
+      private ThreadLocal<RawStore> threadLocalMS = new ThreadLocal() {
+        protected synchronized Object initialValue() {
+            return null;
+        }
+      };
+
+      // The next serial number to be assigned
+      private static int nextSerialNum = 0;
+      private static ThreadLocal<Integer> threadLocalId = new ThreadLocal() {
+        protected synchronized Object initialValue() {
+          return new Integer(nextSerialNum++);
+        }
+      };
+      public static Integer get() {
+        return threadLocalId.get();     
+      }
+      
       public HMSHandler(String name) throws MetaException {
         super(name);
         hiveConf = new HiveConf(this.getClass());
@@ -94,18 +112,42 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       }
       
       private boolean init() throws MetaException {
-        String rawStoreClassName = hiveConf.get("hive.metastore.rawstore.impl");
+        rawStoreClassName = hiveConf.get("hive.metastore.rawstore.impl");
         wh = new Warehouse(hiveConf);
-        LOG.info("Opening raw store ... impl class:" + rawStoreClassName);
-        ms = (RawStore) ReflectionUtils.newInstance(getClass(rawStoreClassName, RawStore.class), hiveConf);
-        // create default database if it doesn't exist
+        createDefaultDB();
+        return true;
+      }
+
+      /**
+       * @return
+       * @throws MetaException 
+       */
+      private RawStore getMS() throws MetaException {
+        RawStore ms = threadLocalMS.get();
+        if(ms == null) {
+          LOG.info(threadLocalId.get() + ": Opening raw store with implemenation class:" + rawStoreClassName);
+          ms = (RawStore) ReflectionUtils.newInstance(getClass(rawStoreClassName, RawStore.class), hiveConf);
+          threadLocalMS.set(ms);
+          ms = threadLocalMS.get();
+        }
+        return ms;
+      }
+
+      /**
+       * create default database if it doesn't exist
+       * @throws MetaException
+       */
+      private void createDefaultDB() throws MetaException {
+        if(HMSHandler.createDefaultDB) {
+          return;
+        }
         try {
-          ms.getDatabase(MetaStoreUtils.DEFAULT_DATABASE_NAME);
+          getMS().getDatabase(MetaStoreUtils.DEFAULT_DATABASE_NAME);
         } catch (NoSuchObjectException e) {
-          ms.createDatabase(new Database(MetaStoreUtils.DEFAULT_DATABASE_NAME, 
+          getMS().createDatabase(new Database(MetaStoreUtils.DEFAULT_DATABASE_NAME, 
                     wh.getDefaultDatabasePath(MetaStoreUtils.DEFAULT_DATABASE_NAME).toString()));
         }
-        return true;
+        HMSHandler.createDefaultDB = true;
       }
 
       private Class<?> getClass(String rawStoreClassName, Class<RawStore> class1) throws MetaException {
@@ -115,31 +157,46 @@ public class HiveMetaStore extends ThriftHiveMetastore {
           throw new MetaException(rawStoreClassName + " class not found");
         }
       }
+      
+      private void logStartFunction(String m) {
+        LOG.info(threadLocalId.get().toString() + ": " + m);
+      }
 
+      private void logStartFunction(String f, String db, String tbl) {
+        LOG.info(threadLocalId.get().toString() + ": " + f + " : db=" + db + " tbl=" + tbl);
+      }
+      
       @Override
       public int getStatus() {
         return fb_status.ALIVE;
       }
       
       public void shutdown() {
-        LOG.info("Shutting down the object store...");
-        ms.shutdown();
-        super.shutdown();
+        logStartFunction("Shutting down the object store...");
+        try {
+          if(threadLocalMS.get() != null) {
+            getMS().shutdown();
+          }
+        } catch (MetaException e) {
+          LOG.error("unable to shutdown metastore", e);
+        }
+        System.exit(0);
       }
 
       public boolean create_database(String name, String location_uri)
       throws AlreadyExistsException, MetaException {
         this.incrementCounter("create_database");
+        logStartFunction("create_database: " + name);
         boolean success = false;
         try {
-          ms.openTransaction();
+          getMS().openTransaction();
           Database db = new Database(name, location_uri);
-          if(ms.createDatabase(db) && wh.mkdirs(wh.getDefaultDatabasePath(name))) {
-            success = ms.commitTransaction();
+          if(getMS().createDatabase(db) && wh.mkdirs(wh.getDefaultDatabasePath(name))) {
+            success = getMS().commitTransaction();
           }
         } finally {
           if(!success) {
-            ms.rollbackTransaction();
+            getMS().rollbackTransaction();
           }
         }
         return success;
@@ -147,24 +204,25 @@ public class HiveMetaStore extends ThriftHiveMetastore {
 
       public Database get_database(String name) throws NoSuchObjectException, MetaException {
         this.incrementCounter("get_database");
-        return ms.getDatabase(name);
+        logStartFunction("get_database: " + name);
+        return getMS().getDatabase(name);
       }
 
       public boolean drop_database(String name) throws MetaException {
         this.incrementCounter("drop_database");
+        logStartFunction("drop_database: " + name);
         if(name.equalsIgnoreCase(MetaStoreUtils.DEFAULT_DATABASE_NAME)) {
           throw new MetaException("Can't drop default database");
         }
         boolean success = false;
         try {
-          ms.openTransaction();
-          success = ms.dropDatabase(name);
-          if(ms.dropDatabase(name)) {
-            success = ms.commitTransaction();
+          getMS().openTransaction();
+          if(getMS().dropDatabase(name)) {
+            success = getMS().commitTransaction();
           }
         } finally {
           if(!success) {
-            ms.rollbackTransaction();
+            getMS().rollbackTransaction();
           } else {
             wh.deleteDir(wh.getDefaultDatabasePath(name), true);
             // it is not a terrible thing even if the data is not deleted
@@ -175,45 +233,51 @@ public class HiveMetaStore extends ThriftHiveMetastore {
 
       public List<String> get_databases() throws MetaException {
         this.incrementCounter("get_databases");
-        return ms.getDatabases();
+        logStartFunction("get_databases");
+        return getMS().getDatabases();
       }
 
       public boolean create_type(Type type) throws AlreadyExistsException, MetaException, InvalidObjectException {
         this.incrementCounter("create_type");
+        logStartFunction("create_type: " + type.getName());
         // check whether type already exists
         if(get_type(type.getName()) != null) {
           throw new AlreadyExistsException("Type " + type.getName() + " already exists");
         }
 
         //TODO:pc Validation of types should be done by clients or here????
-        return ms.createType(type);
+        return getMS().createType(type);
       }
 
       public Type get_type(String name) throws MetaException {
         this.incrementCounter("get_type");
-        return ms.getType(name);
+        logStartFunction("get_type: " + name);
+        return getMS().getType(name);
       }
 
-      public boolean drop_type(String type) throws MetaException {
+      public boolean drop_type(String name) throws MetaException {
         this.incrementCounter("drop_type");
+        logStartFunction("drop_type: " + name);
         // TODO:pc validate that there are no types that refer to this 
-        return ms.dropType(type);
+        return getMS().dropType(name);
       }
 
       public Map<String, Type> get_type_all(String name) throws MetaException {
         this.incrementCounter("get_type_all");
         // TODO Auto-generated method stub
-        return null;
+        logStartFunction("get_type_all");
+        throw new MetaException("Not yet implemented");
       }
 
       public void create_table(Table tbl) throws AlreadyExistsException, MetaException, InvalidObjectException {
         this.incrementCounter("create_table");
+        logStartFunction("create_table: db=" + tbl.getDatabase() + " tbl=" + tbl.getTableName());
         boolean success = false;
         if(!MetaStoreUtils.validateName(tbl.getTableName())) {
           throw new InvalidObjectException(tbl.getTableName() + " is not a valid object name");
         }
         try {
-          ms.openTransaction();
+          getMS().openTransaction();
           Path tblPath = null;
           if(tbl.getSd().getLocation() == null || tbl.getSd().getLocation().isEmpty()) {
             tblPath = wh.getDefaultTablePath(tbl.getDatabase(), tbl.getTableName());
@@ -228,24 +292,25 @@ public class HiveMetaStore extends ThriftHiveMetastore {
             }
           } catch (NoSuchObjectException e) {
           }
-          ms.createTable(tbl);
+          getMS().createTable(tbl);
           if(wh.mkdirs(tblPath)) {
-            success = ms.commitTransaction();
+            success = getMS().commitTransaction();
           }
       
         } finally {
           if(!success) {
-            ms.rollbackTransaction();
+            getMS().rollbackTransaction();
           }
         }
       }
       
       public void drop_table(String dbname, String name, boolean deleteData) throws NoSuchObjectException, MetaException {
         this.incrementCounter("drop_table");
+        logStartFunction("drop_table", dbname, name);
         boolean success = false;
         Path tblPath = null;
         try {
-          ms.openTransaction();
+          getMS().openTransaction();
           // drop any partitions
           Table tbl = get_table(dbname, name);
           if (tbl == null) {
@@ -254,14 +319,14 @@ public class HiveMetaStore extends ThriftHiveMetastore {
           if(tbl.getSd() == null  || tbl.getSd().getLocation() == null) {
             throw new MetaException("Table metadata is corrupted");
           }
-          if(!ms.dropTable(dbname, name)) {
+          if(!getMS().dropTable(dbname, name)) {
             throw new MetaException("Unable to drop table");
           }
-          success  = ms.commitTransaction();
+          success  = getMS().commitTransaction();
           tblPath = new Path(tbl.getSd().getLocation());
         } finally {
           if(!success) {
-            ms.rollbackTransaction();
+            getMS().rollbackTransaction();
           } else if(deleteData && (tblPath != null)) {
             wh.deleteDir(tblPath, true);
             // ok even if the data is not deleted
@@ -271,7 +336,8 @@ public class HiveMetaStore extends ThriftHiveMetastore {
 
       public Table get_table(String dbname, String name) throws MetaException, NoSuchObjectException {
         this.incrementCounter("get_table");
-        Table t = ms.getTable(dbname, name);
+        logStartFunction("get_table", dbname, name);
+        Table t = getMS().getTable(dbname, name);
         if(t == null) {
           throw new NoSuchObjectException(dbname + "." + name + " table not found");
         }
@@ -282,6 +348,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
           Map<String, String> params) throws NoSuchObjectException,
           MetaException {
         this.incrementCounter("set_table_parameters");
+        logStartFunction("set_table_parameters", dbname, name);
         // TODO Auto-generated method stub
         return false;
       }
@@ -289,16 +356,22 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       public Partition append_partition(String dbName, String tableName, List<String> part_vals)
           throws InvalidObjectException, AlreadyExistsException, MetaException {
         this.incrementCounter("append_partition");
+        logStartFunction("append_partition", dbName, tableName);
         Partition part = new Partition();
         boolean success = false;
         try {
-          ms.openTransaction();
+          getMS().openTransaction();
           part = new Partition();
           part.setDatabase(dbName);
           part.setTableName(tableName);
           part.setValues(part_vals);
 
-          Table tbl = ms.getTable(part.getDatabase(), part.getTableName());
+          Partition old_part = this.get_partition(part.getDatabase(), part.getTableName(), part.getValues());
+          if( old_part != null) {
+            throw new AlreadyExistsException("Partition already exists:" + part);
+          }
+          
+          Table tbl = getMS().getTable(part.getDatabase(), part.getTableName());
           if(tbl == null) {
             throw new InvalidObjectException("Unable to add partition because table or database do not exist");
           }
@@ -306,16 +379,16 @@ public class HiveMetaStore extends ThriftHiveMetastore {
           Path partLocation = new Path(tbl.getSd().getLocation(), Warehouse.makePartName(tbl.getPartitionKeys(), part_vals));
           part.getSd().setLocation(partLocation.toString());
 
-          success = ms.addPartition(part);
+          success = getMS().addPartition(part);
           if(success) {
-            success = ms.commitTransaction();
+            success = getMS().commitTransaction();
           }
         } finally {
           if(!success) {
-            ms.rollbackTransaction();
+            getMS().rollbackTransaction();
           } else {
             Path path = new Path(part.getSd().getLocation());
-            MetaStoreUtils.makeDir(path, hiveConf);
+            wh.mkdirs(path);
           }
         }
         return part;
@@ -324,24 +397,29 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       public Partition add_partition(Partition part) throws InvalidObjectException,
           AlreadyExistsException, MetaException {
         this.incrementCounter("add_partition");
+        logStartFunction("add_partition", part.getDatabase(), part.getTableName());
         boolean success = false;
         try {
-          ms.openTransaction();
-          Table tbl = ms.getTable(part.getDatabase(), part.getTableName());
+          getMS().openTransaction();
+          Partition old_part = this.get_partition(part.getDatabase(), part.getTableName(), part.getValues());
+          if( old_part != null) {
+            throw new AlreadyExistsException("Partition already exists:" + part);
+          }
+          Table tbl = getMS().getTable(part.getDatabase(), part.getTableName());
           if(tbl == null) {
             throw new InvalidObjectException("Unable to add partition because table or database do not exist");
           }
           // add partition
-          success = ms.addPartition(part);
+          success = getMS().addPartition(part);
           if(success) {
-            success = ms.commitTransaction();
+            success = getMS().commitTransaction();
           }
         } finally {
           if(!success) {
-            ms.rollbackTransaction();
+            getMS().rollbackTransaction();
           } else {
             Path path = new Path(part.getSd().getLocation());
-            MetaStoreUtils.makeDir(path, hiveConf);
+            wh.mkdirs(path);
           }
         }
         return part;
@@ -350,54 +428,62 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       public boolean drop_partition(String db_name, String tbl_name, List<String> part_vals, boolean deleteData) throws NoSuchObjectException, MetaException,
           TException {
         this.incrementCounter("drop_partition");
+        logStartFunction("drop_partition", db_name, tbl_name);
         // TODO:pc drop the data as needed
-        return ms.dropPartition(db_name, tbl_name, part_vals);
+        return getMS().dropPartition(db_name, tbl_name, part_vals);
       }
 
       public Partition get_partition(String db_name, String tbl_name, List<String> part_vals)
           throws MetaException {
         this.incrementCounter("get_partition");
-        return ms.getPartition(db_name, tbl_name, part_vals);
+        logStartFunction("get_partition", db_name, tbl_name);
+        return getMS().getPartition(db_name, tbl_name, part_vals);
       }
 
       public List<Partition> get_partitions(String db_name, String tbl_name, short max_parts)
           throws NoSuchObjectException, MetaException {
         this.incrementCounter("get_partitions");
-        return ms.getPartitions(db_name, tbl_name, max_parts);
+        logStartFunction("get_partitions", db_name, tbl_name);
+        return getMS().getPartitions(db_name, tbl_name, max_parts);
       }
 
       public boolean alter_partitions(StorageDescriptor sd, List<String> parts) throws InvalidOperationException,
           MetaException {
         this.incrementCounter("alter_partitions");
+        logStartFunction("alter_partitions");
         // TODO Auto-generated method stub
-        return false;
+        throw new MetaException("Not yet implemented");
       }
 
       
       public boolean set_partition_parameters(String db_name, String tbl_name, String pname, Map<String, String> params) throws NoSuchObjectException,
           MetaException {
         this.incrementCounter("set_partition_parameters");
+        logStartFunction("set_partition_parameters: db=" + db_name + " tbl=" + tbl_name);
         // TODO Auto-generated method stub
-        return false;
+        throw new MetaException("Not yet implemented");
       }
 
       public boolean create_index(Index index_def)
           throws IndexAlreadyExistsException, MetaException {
         this.incrementCounter("create_index");
+        logStartFunction("truncate_table: db=" + index_def.getTableName() + " tbl=" + index_def.getTableName() + " name=" + index_def.getIndexName());
         // TODO Auto-generated method stub
-        return false;
+        throw new MetaException("Not yet implemented");
       }
 
       public String getVersion() throws TException {
         this.incrementCounter("getVersion");
+        logStartFunction("getVersion");
         return "3.0";
       }
 
       public void alter_table(String dbname, String name, Table newTable) throws InvalidOperationException,
           MetaException {
         this.incrementCounter("alter_table");
+        logStartFunction("truncate_table: db=" + dbname + " tbl=" + name + " newtbl=" + newTable.getTableName());
         try {
-          ms.alterTable(dbname, name, newTable);
+          getMS().alterTable(dbname, name, newTable);
         } catch (InvalidObjectException e) {
           LOG.error(StringUtils.stringifyException(e));
           throw new InvalidOperationException("alter is not possible");
@@ -408,14 +494,16 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       public List<String> cat(String db_name, String table_name, String partition, int high)
           throws MetaException, UnknownDBException, UnknownTableException {
         this.incrementCounter("cat");
+        logStartFunction("cat: db=" + db_name + " tbl=" + table_name + " part=" + partition + " high=" + high);
         // TODO Auto-generated method stub
-        return null;
+        throw new MetaException("Not implemented. Please use select * query instead");
       }
 
       @Override
       public List<String> get_tables(String dbname, String pattern) throws MetaException {
         this.incrementCounter("get_tables");
-        return ms.getTables(dbname, pattern);
+        logStartFunction("get_tables: db=" + dbname + " pat=" + pattern);
+        return getMS().getTables(dbname, pattern);
       }
 
       @Override
@@ -423,6 +511,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
           throws MetaException, UnknownTableException, UnknownDBException {
         // TODO Auto-generated method stub
         this.incrementCounter("truncate_table");
+        logStartFunction("truncate_table: db=" + db_name + " tbl=" + table_name);
       }
       
       /**
@@ -479,10 +568,11 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         return ret;
       }
 
-      public ArrayList<FieldSchema> get_fields(String db, String table_name) throws MetaException,UnknownTableException, UnknownDBException {
+      public ArrayList<FieldSchema> get_fields(String db, String tableName) throws MetaException,UnknownTableException, UnknownDBException {
         this.incrementCounter("get_fields");
+        logStartFunction("get_fields: db=" + db + "tbl=" + tableName);
         ArrayList<FieldSchema> str_fields = new ArrayList<FieldSchema>();
-        String [] names = table_name.split("\\.");
+        String [] names = tableName.split("\\.");
         String base_table_name = names[0];
         List<SerDeField> hive_fields = new ArrayList<SerDeField>();
 
@@ -531,7 +621,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
         }
       }
   }
-
+    
   /**
    * @param args
    */
@@ -545,15 +635,18 @@ public class HiveMetaStore extends ThriftHiveMetastore {
       TServerTransport serverTransport = new TServerSocket(port);
       Iface handler = new HMSHandler("new db based metaserver");
       FacebookService.Processor processor = new ThriftHiveMetastore.Processor(handler);
-      TServer server = new TThreadPoolServer(processor, serverTransport);
-      HMSHandler.LOG.info("Starting the new metaserver on port [" + port + "]...");
-
+      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
+      options.minWorkerThreads = 200;
+      TServer server = new TThreadPoolServer(processor, serverTransport,
+          new TTransportFactory(), new TTransportFactory(),
+          new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(), options);
+      HMSHandler.LOG.info("Started the new metaserver on port [" + port + "]...");
+      HMSHandler.LOG.info("Options.minWorkerThreads = " + options.minWorkerThreads);
+      HMSHandler.LOG.info("Options.maxWorkerThreads = " + options.maxWorkerThreads);
       server.serve();
-
     } catch (Exception x) {
       x.printStackTrace();
     }
   }
-
 }
 

+ 41 - 23
src/contrib/hive/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java

@@ -34,6 +34,7 @@ import javax.jdo.PersistenceManager;
 import javax.jdo.PersistenceManagerFactory;
 import javax.jdo.Query;
 import javax.jdo.Transaction;
+import javax.jdo.datastore.DataStoreCache;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -70,18 +71,26 @@ import org.apache.hadoop.util.StringUtils;
 public class ObjectStore implements RawStore, Configurable {
   @SuppressWarnings("nls")
   private static final String JPOX_CONFIG = "jpox.properties";
-  private static Properties prop;
+  private static Properties prop = null;
+  private static PersistenceManagerFactory pmf = null;
+  private static final Log LOG = LogFactory.getLog(ObjectStore.class.getName());
+  private static enum TXN_STATUS {
+    NO_STATE,
+    OPEN,
+    COMMITED,
+    ROLLBACK
+  }
   private boolean isInitialized = false;
   private PersistenceManager pm = null;
   private Configuration hiveConf;
-  @SuppressWarnings("nls")
-  public static final Log LOG = LogFactory.getLog(ObjectStore.class.getName());
+  private int openTrasactionCalls = 0;
+  private Transaction currentTransaction = null;
+  private TXN_STATUS transactionStatus = TXN_STATUS.NO_STATE;
   
   public ObjectStore() {}
 
   @Override
   public Configuration getConf() {
-    // TODO Auto-generated method stub
     return hiveConf;
   }
 
@@ -112,8 +121,8 @@ public class ObjectStore implements RawStore, Configurable {
   @SuppressWarnings("nls")
   private void initialize() {
     LOG.info("ObjectStore, initialize called");
-    getDataSourceProps();
-    pm = createPersistenceManager();
+    initDataSourceProps();
+    pm = getPersistenceManager();
     if(pm != null)
       isInitialized = true;
     return;
@@ -124,7 +133,10 @@ public class ObjectStore implements RawStore, Configurable {
    * jpox.properties.
    */
   @SuppressWarnings("nls")
-  private void getDataSourceProps() {
+  private void initDataSourceProps() {
+    if(prop != null) {
+      return;
+    }
     URL url= classLoader.getResource(JPOX_CONFIG);
     prop = new Properties();
     if (url == null) {
@@ -167,10 +179,26 @@ public class ObjectStore implements RawStore, Configurable {
       prop.setProperty(param, val);
     }
   }
-
-  private static PersistenceManager createPersistenceManager() {
-    PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(prop);
-    return pmf.getPersistenceManager();
+  private static PersistenceManagerFactory getPMF() {
+    if(pmf == null) {
+      pmf = JDOHelper.getPersistenceManagerFactory(prop);
+      DataStoreCache dsc = pmf.getDataStoreCache();
+      if(dsc != null) {
+        dsc.pinAll(true, MTable.class);
+        dsc.pinAll(true, MStorageDescriptor.class);
+        dsc.pinAll(true, MSerDeInfo.class);
+        dsc.pinAll(true, MPartition.class);
+        dsc.pinAll(true, MDatabase.class);
+        dsc.pinAll(true, MType.class);
+        dsc.pinAll(true, MFieldSchema.class);
+        dsc.pinAll(true, MOrder.class);
+      }
+    }
+    return pmf;
+  }
+  
+  private PersistenceManager getPersistenceManager() {
+    return getPMF().getPersistenceManager();
   }
   
   public void shutdown() {
@@ -179,16 +207,6 @@ public class ObjectStore implements RawStore, Configurable {
     }
   }
 
-  private int openTrasactionCalls = 0;
-  private Transaction currentTransaction = null;
-  private static enum TXN_STATUS {
-    NO_STATE,
-    OPEN,
-    COMMITED,
-    ROLLBACK
-  }
-  private TXN_STATUS transactionStatus = TXN_STATUS.NO_STATE;
-  
   /**
    * Opens a new one or the one already created
    * Every call of this function must have corresponding commit or rollback function call
@@ -621,7 +639,7 @@ public class ObjectStore implements RawStore, Configurable {
   private List<Order> convertToOrders(List<MOrder> mkeys) {
     List<Order> keys = null;
     if(mkeys != null) {
-      keys = new ArrayList<Order>(mkeys.size());
+      keys = new ArrayList<Order>();
       for (MOrder part : mkeys) {
         keys.add(new Order(part.getCol(), part.getOrder()));
       }
@@ -817,8 +835,8 @@ public class ObjectStore implements RawStore, Configurable {
       query.declareParameters("java.lang.String t1, java.lang.String t2"); 
       mparts = (List<MPartition>) query.execute(tableName.trim(), dbName.trim()); 
       pm.retrieveAll(mparts);
-      
       success = commitTransaction();
+      LOG.debug("Done e xecuting listMPartitions");
     } finally {
       if(!success) {
         rollbackTransaction();

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff