# # Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require 'impala_plan_service_types' module Impala module Protocol module ImpalaPlanService class Client include ::Thrift::Client def CreateExecRequest(clientRequest) send_CreateExecRequest(clientRequest) return recv_CreateExecRequest() end def send_CreateExecRequest(clientRequest) send_message('CreateExecRequest', CreateExecRequest_args, :clientRequest => clientRequest) end def recv_CreateExecRequest() result = receive_message(CreateExecRequest_result) return result.success unless result.success.nil? raise result.e unless result.e.nil? raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CreateExecRequest failed: unknown result') end def RefreshMetadata() send_RefreshMetadata() recv_RefreshMetadata() end def send_RefreshMetadata() send_message('RefreshMetadata', RefreshMetadata_args) end def recv_RefreshMetadata() result = receive_message(RefreshMetadata_result) return end def GetExplainString(queryRequest) send_GetExplainString(queryRequest) return recv_GetExplainString() end def send_GetExplainString(queryRequest) send_message('GetExplainString', GetExplainString_args, :queryRequest => queryRequest) end def recv_GetExplainString() result = receive_message(GetExplainString_result) return result.success unless result.success.nil? raise result.e unless result.e.nil? raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetExplainString failed: unknown result') end def UpdateMetastore(update) send_UpdateMetastore(update) recv_UpdateMetastore() end def send_UpdateMetastore(update) send_message('UpdateMetastore', UpdateMetastore_args, :update => update) end def recv_UpdateMetastore() result = receive_message(UpdateMetastore_result) raise result.e unless result.e.nil? return end def ShutdownServer() send_ShutdownServer() recv_ShutdownServer() end def send_ShutdownServer() send_message('ShutdownServer', ShutdownServer_args) end def recv_ShutdownServer() result = receive_message(ShutdownServer_result) return end end class Processor include ::Thrift::Processor def process_CreateExecRequest(seqid, iprot, oprot) args = read_args(iprot, CreateExecRequest_args) result = CreateExecRequest_result.new() begin result.success = @handler.CreateExecRequest(args.clientRequest) rescue Impala::Protocol::TImpalaPlanServiceException => e result.e = e end write_result(result, oprot, 'CreateExecRequest', seqid) end def process_RefreshMetadata(seqid, iprot, oprot) args = read_args(iprot, RefreshMetadata_args) result = RefreshMetadata_result.new() @handler.RefreshMetadata() write_result(result, oprot, 'RefreshMetadata', seqid) end def process_GetExplainString(seqid, iprot, oprot) args = read_args(iprot, GetExplainString_args) result = GetExplainString_result.new() begin result.success = @handler.GetExplainString(args.queryRequest) rescue Impala::Protocol::TImpalaPlanServiceException => e result.e = e end write_result(result, oprot, 'GetExplainString', seqid) end def process_UpdateMetastore(seqid, iprot, oprot) args = read_args(iprot, UpdateMetastore_args) result = UpdateMetastore_result.new() begin @handler.UpdateMetastore(args.update) rescue Impala::Protocol::TImpalaPlanServiceException => e result.e = e end write_result(result, oprot, 'UpdateMetastore', seqid) end def process_ShutdownServer(seqid, iprot, oprot) args = read_args(iprot, ShutdownServer_args) result = ShutdownServer_result.new() @handler.ShutdownServer() write_result(result, oprot, 'ShutdownServer', seqid) end end # HELPER FUNCTIONS AND STRUCTURES class CreateExecRequest_args include ::Thrift::Struct, ::Thrift::Struct_Union CLIENTREQUEST = 1 FIELDS = { CLIENTREQUEST => { :type => ::Thrift::Types::STRUCT, :name => 'clientRequest', :class => Impala::Protocol::TClientRequest } } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class CreateExecRequest_result include ::Thrift::Struct, ::Thrift::Struct_Union SUCCESS = 0 E = 1 FIELDS = { SUCCESS => { :type => ::Thrift::Types::STRUCT, :name => 'success', :class => Impala::Protocol::TExecRequest }, E => { :type => ::Thrift::Types::STRUCT, :name => 'e', :class => Impala::Protocol::TImpalaPlanServiceException } } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class RefreshMetadata_args include ::Thrift::Struct, ::Thrift::Struct_Union FIELDS = { } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class RefreshMetadata_result include ::Thrift::Struct, ::Thrift::Struct_Union FIELDS = { } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class GetExplainString_args include ::Thrift::Struct, ::Thrift::Struct_Union QUERYREQUEST = 1 FIELDS = { QUERYREQUEST => { :type => ::Thrift::Types::STRUCT, :name => 'queryRequest', :class => Impala::Protocol::TClientRequest } } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class GetExplainString_result include ::Thrift::Struct, ::Thrift::Struct_Union SUCCESS = 0 E = 1 FIELDS = { SUCCESS => { :type => ::Thrift::Types::STRING, :name => 'success' }, E => { :type => ::Thrift::Types::STRUCT, :name => 'e', :class => Impala::Protocol::TImpalaPlanServiceException } } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class UpdateMetastore_args include ::Thrift::Struct, ::Thrift::Struct_Union UPDATE = 1 FIELDS = { UPDATE => { :type => ::Thrift::Types::STRUCT, :name => 'update', :class => Impala::Protocol::TCatalogUpdate } } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class UpdateMetastore_result include ::Thrift::Struct, ::Thrift::Struct_Union E = 1 FIELDS = { E => { :type => ::Thrift::Types::STRUCT, :name => 'e', :class => Impala::Protocol::TImpalaPlanServiceException } } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class ShutdownServer_args include ::Thrift::Struct, ::Thrift::Struct_Union FIELDS = { } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end class ShutdownServer_result include ::Thrift::Struct, ::Thrift::Struct_Union FIELDS = { } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end end end end