http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a2585810/src/distribution/src/main/scripts/interface/gen-rb/blur.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur.rb index 538eb35..e700e32 100644 --- a/src/distribution/src/main/scripts/interface/gen-rb/blur.rb +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur.rb @@ -310,13 +310,13 @@ module Blur raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe failed: unknown result') end - def cancelQuery(session, id) - send_cancelQuery(session, id) + def cancelQuery(session, server, id) + send_cancelQuery(session, server, id) recv_cancelQuery() end - def send_cancelQuery(session, id) - send_message('cancelQuery', CancelQuery_args, :session => session, :id => id) + def send_cancelQuery(session, server, id) + send_message('cancelQuery', CancelQuery_args, :session => session, :server => server, :id => id) end def recv_cancelQuery() @@ -325,13 +325,13 @@ module Blur return end - def queryStatusIdList(session) - send_queryStatusIdList(session) + def queryStatusIdList(session, server) + send_queryStatusIdList(session, server) return recv_queryStatusIdList() end - def send_queryStatusIdList(session) - send_message('queryStatusIdList', QueryStatusIdList_args, :session => session) + def send_queryStatusIdList(session, server) + send_message('queryStatusIdList', QueryStatusIdList_args, :session => session, :server => server) end def recv_queryStatusIdList() @@ -341,13 +341,13 @@ module Blur raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'queryStatusIdList failed: unknown result') end - def queryStatus(session, id) - send_queryStatus(session, id) + def queryStatus(session, server, id) + send_queryStatus(session, server, id) return recv_queryStatus() end - def send_queryStatus(session, id) - send_message('queryStatus', QueryStatus_args, :session => session, :id => id) + def send_queryStatus(session, server, id) + send_message('queryStatus', QueryStatus_args, :session => session, :server => server, :id => id) end def recv_queryStatus() @@ -607,7 +607,7 @@ module Blur args = read_args(iprot, CancelQuery_args) result = CancelQuery_result.new() begin - @handler.cancelQuery(args.session, args.id) + @handler.cancelQuery(args.session, args.server, args.id) rescue ::Blur::BlurException => ex result.ex = ex end @@ -618,7 +618,7 @@ module Blur args = read_args(iprot, QueryStatusIdList_args) result = QueryStatusIdList_result.new() begin - result.success = @handler.queryStatusIdList(args.session) + result.success = @handler.queryStatusIdList(args.session, args.server) rescue ::Blur::BlurException => ex result.ex = ex end @@ -629,7 +629,7 @@ module Blur args = read_args(iprot, QueryStatus_args) result = QueryStatus_result.new() begin - result.success = @handler.queryStatus(args.session, args.id) + result.success = @handler.queryStatus(args.session, args.server, args.id) rescue ::Blur::BlurException => ex result.ex = ex end @@ -1316,11 +1316,13 @@ module Blur class CancelQuery_args include ::Thrift::Struct, ::Thrift::Struct_Union SESSION = 1 - ID = 2 + SERVER = 2 + ID = 3 FIELDS = { SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => ::Blur::Session}, - ID => {:type => ::Thrift::Types::I64, :name => 'id'} + SERVER => {:type => ::Thrift::Types::STRING, :name => 'server'}, + ID => {:type => ::Thrift::Types::STRING, :name => 'id'} } def struct_fields; FIELDS; end @@ -1350,9 +1352,11 @@ module Blur class QueryStatusIdList_args include ::Thrift::Struct, ::Thrift::Struct_Union SESSION = 1 + SERVER = 2 FIELDS = { - SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => ::Blur::Session} + SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => ::Blur::Session}, + SERVER => {:type => ::Thrift::Types::STRING, :name => 'server'} } def struct_fields; FIELDS; end @@ -1369,7 +1373,7 @@ module Blur EX = 1 FIELDS = { - SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::I64}}, + SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}}, EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} } @@ -1384,11 +1388,13 @@ module Blur class QueryStatus_args include ::Thrift::Struct, ::Thrift::Struct_Union SESSION = 1 - ID = 2 + SERVER = 2 + ID = 3 FIELDS = { SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => ::Blur::Session}, - ID => {:type => ::Thrift::Types::I64, :name => 'id'} + SERVER => {:type => ::Thrift::Types::STRING, :name => 'server'}, + ID => {:type => ::Thrift::Types::STRING, :name => 'id'} } def struct_fields; FIELDS; end @@ -1405,7 +1411,7 @@ module Blur EX = 1 FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Blur::QueryStatus}, + SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::QueryStatus}}, EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} }
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a2585810/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb index 646358c..b6acc28 100644 --- a/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_types.rb @@ -94,57 +94,6 @@ module Blur end # - class CpuTime - include ::Thrift::Struct, ::Thrift::Struct_Union - CPUTIME = 1 - REALTIME = 2 - - FIELDS = { - # - CPUTIME => {:type => ::Thrift::Types::I64, :name => 'cpuTime'}, - # - REALTIME => {:type => ::Thrift::Types::I64, :name => 'realTime'} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - # - class QueryStatus - include ::Thrift::Struct, ::Thrift::Struct_Union - CPUTIMES = 1 - COMPLETESHARDS = 2 - TOTALSHARDS = 3 - STATE = 4 - - FIELDS = { - # - CPUTIMES => {:type => ::Thrift::Types::MAP, :name => 'cpuTimes', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::CpuTime}}, - # - COMPLETESHARDS => {:type => ::Thrift::Types::I32, :name => 'completeShards'}, - # - TOTALSHARDS => {:type => ::Thrift::Types::I32, :name => 'totalShards'}, - # - STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => ::Blur::QueryState} - } - - def struct_fields; FIELDS; end - - def validate - unless @state.nil? || ::Blur::QueryState::VALID_VALUES.include?(@state) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!') - end - end - - ::Thrift::Struct.generate_accessors self - end - - # class TableStats include ::Thrift::Struct, ::Thrift::Struct_Union BYTES = 1 @@ -469,8 +418,8 @@ module Blur SHARDINDEXES = 10 FIELDS = { - # Unique id for controlling the given query. - ID => {:type => ::Thrift::Types::I64, :name => 'id'}, + # Unique id for controlling the given query, leave null for server side assignment. + ID => {:type => ::Thrift::Types::STRING, :name => 'id'}, # If after is left null then the first N (where N is numberToFetch) # ScoreDocs are fetched. If after is not null then the first N # ScoreDocs are fetched that occur after the given ScoreDoc. @@ -505,6 +454,48 @@ module Blur ::Thrift::Struct.generate_accessors self end + # Contains the query status information for a query on a server. + class QueryStatus + include ::Thrift::Struct, ::Thrift::Struct_Union + STARTTIME = 1 + ENDTIME = 2 + CPUTIME = 3 + USERTIME = 4 + COMPLETESHARDS = 5 + TOTALSHARDS = 6 + STATE = 7 + QUERYARGS = 8 + + FIELDS = { + # The startTime as set on the server, this is when the query has started executing. This could be different depending on the server. + STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'}, + # The endTime as set on the server, this is when the query has stopped executing. This could be different depending on the server. + ENDTIME => {:type => ::Thrift::Types::I64, :name => 'endTime'}, + # The amount cpu time spent executing the given query. + CPUTIME => {:type => ::Thrift::Types::I64, :name => 'cpuTime'}, + # The total amount of time spent executing the query. + USERTIME => {:type => ::Thrift::Types::I64, :name => 'userTime'}, + # The number of shards that this server has completed. + COMPLETESHARDS => {:type => ::Thrift::Types::I32, :name => 'completeShards'}, + # The number of shards that this server has to complete. + TOTALSHARDS => {:type => ::Thrift::Types::I32, :name => 'totalShards'}, + # The state of the query. This could be different depending on the server. + STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => ::Blur::QueryState}, + # The query that is executing. + QUERYARGS => {:type => ::Thrift::Types::STRUCT, :name => 'queryArgs', :class => ::Blur::QueryArgs} + } + + def struct_fields; FIELDS; end + + def validate + unless @state.nil? || ::Blur::QueryState::VALID_VALUES.include?(@state) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!') + end + end + + ::Thrift::Struct.generate_accessors self + end + class TopFieldDocs include ::Thrift::Struct, ::Thrift::Struct_Union SHARDINDEX = 1
