hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zs...@apache.org
Subject svn commit: r734352 - in /hadoop/hive/trunk: CHANGES.txt service/src/gen-rb/ service/src/gen-rb/ThriftHive.rb service/src/gen-rb/hive_service_constants.rb service/src/gen-rb/hive_service_types.rb
Date Wed, 14 Jan 2009 07:03:19 GMT
Author: zshao
Date: Tue Jan 13 23:03:19 2009
New Revision: 734352

URL: http://svn.apache.org/viewvc?rev=734352&view=rev
Log:
HIVE-216. Generate ruby bindings for service. (Raghotham Murthy via zshao)

Added:
    hadoop/hive/trunk/service/src/gen-rb/
    hadoop/hive/trunk/service/src/gen-rb/ThriftHive.rb
    hadoop/hive/trunk/service/src/gen-rb/hive_service_constants.rb
    hadoop/hive/trunk/service/src/gen-rb/hive_service_types.rb
Modified:
    hadoop/hive/trunk/CHANGES.txt

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=734352&r1=734351&r2=734352&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Tue Jan 13 23:03:19 2009
@@ -9,6 +9,8 @@
 
   NEW FEATURES
 
+    HIVE-216. Generate ruby bindings for service. (Raghotham Murthy via zshao)
+
     HIVE-163. JSON udf function added. (Hao Liu via zshao)
 
     HIVE-142. Add a metastore check command. (Johan Oskarsson via zshao)

Added: hadoop/hive/trunk/service/src/gen-rb/ThriftHive.rb
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/src/gen-rb/ThriftHive.rb?rev=734352&view=auto
==============================================================================
--- hadoop/hive/trunk/service/src/gen-rb/ThriftHive.rb (added)
+++ hadoop/hive/trunk/service/src/gen-rb/ThriftHive.rb Tue Jan 13 23:03:19 2009
@@ -0,0 +1,241 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+require 'thrift/protocol/tprotocol'
+require 'ThriftHiveMetastore'
+require 'thrift/thrift'
+require 'hive_service_types'
+
+module ThriftHive
+  class Client < ThriftHiveMetastore::Client 
+    include ThriftClient
+
+    def execute(query)
+      send_execute(query)
+      recv_execute()
+    end
+
+    def send_execute(query)
+      send_message('execute', Execute_args, :query => query)
+    end
+
+    def recv_execute()
+      result = receive_message(Execute_result)
+      raise result.ex unless result.ex.nil?
+      return
+    end
+
+    def fetchOne()
+      send_fetchOne()
+      return recv_fetchOne()
+    end
+
+    def send_fetchOne()
+      send_message('fetchOne', FetchOne_args)
+    end
+
+    def recv_fetchOne()
+      result = receive_message(FetchOne_result)
+      return result.success unless result.success.nil?
+      raise result.ex unless result.ex.nil?
+      raise TApplicationException.new(TApplicationException::MISSING_RESULT, 'fetchOne failed:
unknown result')
+    end
+
+    def fetchN(numRows)
+      send_fetchN(numRows)
+      return recv_fetchN()
+    end
+
+    def send_fetchN(numRows)
+      send_message('fetchN', FetchN_args, :numRows => numRows)
+    end
+
+    def recv_fetchN()
+      result = receive_message(FetchN_result)
+      return result.success unless result.success.nil?
+      raise result.ex unless result.ex.nil?
+      raise TApplicationException.new(TApplicationException::MISSING_RESULT, 'fetchN failed:
unknown result')
+    end
+
+    def fetchAll()
+      send_fetchAll()
+      return recv_fetchAll()
+    end
+
+    def send_fetchAll()
+      send_message('fetchAll', FetchAll_args)
+    end
+
+    def recv_fetchAll()
+      result = receive_message(FetchAll_result)
+      return result.success unless result.success.nil?
+      raise result.ex unless result.ex.nil?
+      raise TApplicationException.new(TApplicationException::MISSING_RESULT, 'fetchAll failed:
unknown result')
+    end
+
+    def getSchema()
+      send_getSchema()
+      return recv_getSchema()
+    end
+
+    def send_getSchema()
+      send_message('getSchema', GetSchema_args)
+    end
+
+    def recv_getSchema()
+      result = receive_message(GetSchema_result)
+      return result.success unless result.success.nil?
+      raise result.ex unless result.ex.nil?
+      raise TApplicationException.new(TApplicationException::MISSING_RESULT, 'getSchema failed:
unknown result')
+    end
+
+  end
+
+  class Processor < ThriftHiveMetastore::Processor 
+    include TProcessor
+
+    def process_execute(seqid, iprot, oprot)
+      args = read_args(iprot, Execute_args)
+      result = Execute_result.new()
+      begin
+        @handler.execute(args.query)
+      rescue HiveServerException => ex
+        result.ex = ex
+      end
+      write_result(result, oprot, 'execute', seqid)
+    end
+
+    def process_fetchOne(seqid, iprot, oprot)
+      args = read_args(iprot, FetchOne_args)
+      result = FetchOne_result.new()
+      begin
+        result.success = @handler.fetchOne()
+      rescue HiveServerException => ex
+        result.ex = ex
+      end
+      write_result(result, oprot, 'fetchOne', seqid)
+    end
+
+    def process_fetchN(seqid, iprot, oprot)
+      args = read_args(iprot, FetchN_args)
+      result = FetchN_result.new()
+      begin
+        result.success = @handler.fetchN(args.numRows)
+      rescue HiveServerException => ex
+        result.ex = ex
+      end
+      write_result(result, oprot, 'fetchN', seqid)
+    end
+
+    def process_fetchAll(seqid, iprot, oprot)
+      args = read_args(iprot, FetchAll_args)
+      result = FetchAll_result.new()
+      begin
+        result.success = @handler.fetchAll()
+      rescue HiveServerException => ex
+        result.ex = ex
+      end
+      write_result(result, oprot, 'fetchAll', seqid)
+    end
+
+    def process_getSchema(seqid, iprot, oprot)
+      args = read_args(iprot, GetSchema_args)
+      result = GetSchema_result.new()
+      begin
+        result.success = @handler.getSchema()
+      rescue HiveServerException => ex
+        result.ex = ex
+      end
+      write_result(result, oprot, 'getSchema', seqid)
+    end
+
+  end
+
+  # HELPER FUNCTIONS AND STRUCTURES
+
+  class Execute_args
+    include ThriftStruct
+    attr_accessor :query
+    FIELDS = {
+      1 => {:type => TType::STRING, :name => 'query'}
+    }
+  end
+
+  class Execute_result
+    include ThriftStruct
+    attr_accessor :ex
+    FIELDS = {
+      1 => {:type => TType::STRUCT, :name => 'ex', :class => HiveServerException}
+    }
+  end
+
+  class FetchOne_args
+    include ThriftStruct
+    FIELDS = {
+
+    }
+  end
+
+  class FetchOne_result
+    include ThriftStruct
+    attr_accessor :success, :ex
+    FIELDS = {
+      0 => {:type => TType::STRING, :name => 'success'},
+      1 => {:type => TType::STRUCT, :name => 'ex', :class => HiveServerException}
+    }
+  end
+
+  class FetchN_args
+    include ThriftStruct
+    attr_accessor :numRows
+    FIELDS = {
+      1 => {:type => TType::I32, :name => 'numRows'}
+    }
+  end
+
+  class FetchN_result
+    include ThriftStruct
+    attr_accessor :success, :ex
+    FIELDS = {
+      0 => {:type => TType::LIST, :name => 'success', :element => {:type =>
TType::STRING}},
+      1 => {:type => TType::STRUCT, :name => 'ex', :class => HiveServerException}
+    }
+  end
+
+  class FetchAll_args
+    include ThriftStruct
+    FIELDS = {
+
+    }
+  end
+
+  class FetchAll_result
+    include ThriftStruct
+    attr_accessor :success, :ex
+    FIELDS = {
+      0 => {:type => TType::LIST, :name => 'success', :element => {:type =>
TType::STRING}},
+      1 => {:type => TType::STRUCT, :name => 'ex', :class => HiveServerException}
+    }
+  end
+
+  class GetSchema_args
+    include ThriftStruct
+    FIELDS = {
+
+    }
+  end
+
+  class GetSchema_result
+    include ThriftStruct
+    attr_accessor :success, :ex
+    FIELDS = {
+      0 => {:type => TType::STRING, :name => 'success'},
+      1 => {:type => TType::STRUCT, :name => 'ex', :class => HiveServerException}
+    }
+  end
+
+end
+

Added: hadoop/hive/trunk/service/src/gen-rb/hive_service_constants.rb
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/src/gen-rb/hive_service_constants.rb?rev=734352&view=auto
==============================================================================
--- hadoop/hive/trunk/service/src/gen-rb/hive_service_constants.rb (added)
+++ hadoop/hive/trunk/service/src/gen-rb/hive_service_constants.rb Tue Jan 13 23:03:19 2009
@@ -0,0 +1,9 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+require 'thrift/protocol/tprotocol'
+require 'hive_service_types'
+

Added: hadoop/hive/trunk/service/src/gen-rb/hive_service_types.rb
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/src/gen-rb/hive_service_types.rb?rev=734352&view=auto
==============================================================================
--- hadoop/hive/trunk/service/src/gen-rb/hive_service_types.rb (added)
+++ hadoop/hive/trunk/service/src/gen-rb/hive_service_types.rb Tue Jan 13 23:03:19 2009
@@ -0,0 +1,24 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+require 'thrift/protocol/tprotocol'
+require 'fb303_types'
+require 'hive_metastore_types'
+
+
+class HiveServerException < StandardError
+  include ThriftStruct
+  def initialize(message=nil)
+    super()
+    self.message = message
+  end
+
+  attr_accessor :message
+  FIELDS = {
+    -1 => {:type => TType::STRING, :name => 'message'}
+  }
+end
+



Mime
View raw message