YUKI Hiroshi
null+****@clear*****
Fri Jan 24 13:22:02 JST 2014
YUKI Hiroshi 2014-01-24 13:22:02 +0900 (Fri, 24 Jan 2014) New Revision: 041ae67884ce423217c730478b1d92f23c864615 https://github.com/droonga/fluent-plugin-droonga/commit/041ae67884ce423217c730478b1d92f23c864615 Message: Return a hash instead of a raw Groonga result by Groonga compatible commands. Because raw results are hard to be handled by reducer/gatherer/collector. Modified files: lib/droonga/plugin/handler/groonga.rb Modified: lib/droonga/plugin/handler/groonga.rb (+10 -3) =================================================================== --- lib/droonga/plugin/handler/groonga.rb 2014-01-24 13:21:35 +0900 (89f4485) +++ lib/droonga/plugin/handler/groonga.rb 2014-01-24 13:22:02 +0900 (959bcd0) @@ -26,21 +26,21 @@ module Droonga command :table_create def table_create(message, messenger) command = TableCreate.new(@context) - outputs = command.execute(message.request) + outputs = format_outputs(command.execute(message.request)) messenger.emit(outputs) end command :table_remove def table_remove(message, messenger) command = TableRemove.new(@context) - outputs = command.execute(message.request) + outputs = format_outputs(command.execute(message.request)) messenger.emit(outputs) end command :column_create def column_create(message, messenger) command = ColumnCreate.new(@context) - outputs = command.execute(message.request) + outputs = format_outputs(command.execute(message.request)) messenger.emit(outputs) end @@ -48,6 +48,13 @@ module Droonga return true end + private + def format_outputs(result) + { + "result" => result, + } + end + module Status SUCCESS = 0 INVALID_ARGUMENT = -22 -------------- next part -------------- HTML����������������������������...Download