hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nzh...@apache.org
Subject svn commit: r1044070 [13/29] - in /hive/trunk: ./ eclipse-templates/ ivy/ lib/ metastore/ metastore/if/ metastore/src/gen-cpp/ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ metastore/src/gen-php/ metastore/src/gen-py/hive_metastore/ ...
Date Thu, 09 Dec 2010 18:31:09 GMT
Added: hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote?rev=1044070&view=auto
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote (added)
+++ hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote Thu
Dec  9 18:30:58 2010
@@ -0,0 +1,351 @@
+#!/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 '  void create_database(Database database)'
+  print '  Database get_database(string name)'
+  print '  void drop_database(string name, bool deleteData)'
+  print '   get_databases(string pattern)'
+  print '   get_all_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 '   get_schema(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 '   get_all_tables(string db_name)'
+  print '  Table get_table(string dbname, string tbl_name)'
+  print '  void alter_table(string dbname, string tbl_name, Table new_tbl)'
+  print '  Partition add_partition(Partition new_part)'
+  print '  Partition append_partition(string db_name, string tbl_name,  part_vals)'
+  print '  Partition append_partition_by_name(string db_name, string tbl_name, string part_name)'
+  print '  bool drop_partition(string db_name, string tbl_name,  part_vals, bool deleteData)'
+  print '  bool drop_partition_by_name(string db_name, string tbl_name, string part_name,
bool deleteData)'
+  print '  Partition get_partition(string db_name, string tbl_name,  part_vals)'
+  print '  Partition get_partition_by_name(string db_name, string tbl_name, string part_name)'
+  print '   get_partitions(string db_name, string tbl_name, i16 max_parts)'
+  print '   get_partition_names(string db_name, string tbl_name, i16 max_parts)'
+  print '   get_partitions_ps(string db_name, string tbl_name,  part_vals, i16 max_parts)'
+  print '   get_partition_names_ps(string db_name, string tbl_name,  part_vals, i16 max_parts)'
+  print '   get_partitions_by_filter(string db_name, string tbl_name, string filter, i16
max_parts)'
+  print '  void alter_partition(string db_name, string tbl_name, Partition new_part)'
+  print '  string get_config_value(string name, string defaultValue)'
+  print '   partition_name_to_vals(string part_name)'
+  print '   partition_name_to_spec(string part_name)'
+  print '  Index add_index(Index new_index, Table index_table)'
+  print '  void alter_index(string dbname, string base_tbl_name, string idx_name, Index new_idx)'
+  print '  bool drop_index_by_name(string db_name, string tbl_name, string index_name, bool
deleteData)'
+  print '  Index get_index_by_name(string db_name, string tbl_name, string index_name)'
+  print '   get_indexes(string db_name, string tbl_name, i16 max_indexes)'
+  print '   get_index_names(string db_name, string tbl_name, i16 max_indexes)'
+  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]
+  if url[4]:
+    uri += '?%s' % url[4]
+  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) != 1:
+    print 'create_database requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.create_database(eval(args[0]),))
+
+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) != 2:
+    print 'drop_database requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.drop_database(args[0],eval(args[1]),))
+
+elif cmd == 'get_databases':
+  if len(args) != 1:
+    print 'get_databases requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_databases(args[0],))
+
+elif cmd == 'get_all_databases':
+  if len(args) != 0:
+    print 'get_all_databases requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.get_all_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 == 'get_schema':
+  if len(args) != 2:
+    print 'get_schema requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_schema(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_all_tables':
+  if len(args) != 1:
+    print 'get_all_tables requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_all_tables(args[0],))
+
+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 == '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 == '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 == 'append_partition_by_name':
+  if len(args) != 3:
+    print 'append_partition_by_name requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.append_partition_by_name(args[0],args[1],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 == 'drop_partition_by_name':
+  if len(args) != 4:
+    print 'drop_partition_by_name requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.drop_partition_by_name(args[0],args[1],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_partition_by_name':
+  if len(args) != 3:
+    print 'get_partition_by_name requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_partition_by_name(args[0],args[1],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 == 'get_partition_names':
+  if len(args) != 3:
+    print 'get_partition_names requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_partition_names(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'get_partitions_ps':
+  if len(args) != 4:
+    print 'get_partitions_ps requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions_ps(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'get_partition_names_ps':
+  if len(args) != 4:
+    print 'get_partition_names_ps requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.get_partition_names_ps(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'get_partitions_by_filter':
+  if len(args) != 4:
+    print 'get_partitions_by_filter requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions_by_filter(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'alter_partition':
+  if len(args) != 3:
+    print 'alter_partition requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.alter_partition(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'get_config_value':
+  if len(args) != 2:
+    print 'get_config_value requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_config_value(args[0],args[1],))
+
+elif cmd == 'partition_name_to_vals':
+  if len(args) != 1:
+    print 'partition_name_to_vals requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.partition_name_to_vals(args[0],))
+
+elif cmd == 'partition_name_to_spec':
+  if len(args) != 1:
+    print 'partition_name_to_spec requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.partition_name_to_spec(args[0],))
+
+elif cmd == 'add_index':
+  if len(args) != 2:
+    print 'add_index requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.add_index(eval(args[0]),eval(args[1]),))
+
+elif cmd == 'alter_index':
+  if len(args) != 4:
+    print 'alter_index requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.alter_index(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'drop_index_by_name':
+  if len(args) != 4:
+    print 'drop_index_by_name requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.drop_index_by_name(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'get_index_by_name':
+  if len(args) != 3:
+    print 'get_index_by_name requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_index_by_name(args[0],args[1],args[2],))
+
+elif cmd == 'get_indexes':
+  if len(args) != 3:
+    print 'get_indexes requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_indexes(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'get_index_names':
+  if len(args) != 3:
+    print 'get_index_names requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_index_names(args[0],args[1],eval(args[2]),))
+
+else:
+  print 'Unrecognized method %s' % cmd
+  sys.exit(1)
+
+transport.close()



Mime
View raw message