Kouhei Sutou
null+****@clear*****
Mon Apr 21 15:16:55 JST 2014
Kouhei Sutou 2014-04-21 15:16:55 +0900 (Mon, 21 Apr 2014) New Revision: 8a6b99baa9eb27eb75548f8926348bb51c48010d https://github.com/droonga/droonga-engine/commit/8a6b99baa9eb27eb75548f8926348bb51c48010d Message: Remove unused code Removed files: lib/fluent/plugin/out_droonga.rb Deleted: lib/fluent/plugin/out_droonga.rb (+0 -73) 100644 =================================================================== --- lib/fluent/plugin/out_droonga.rb 2014-04-21 15:10:05 +0900 (e7e94b9) +++ /dev/null @@ -1,73 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2013-2014 Droonga Project -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1 as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -require "droonga/engine" -require "droonga/plugin_loader" - -module Fluent - class DroongaOutput < Output - Plugin.register_output("droonga", self) - - config_param :name, :string, :default => "" - - def start - super - Droonga::PluginLoader.load_all - @engine = Droonga::Engine.new(:name => @name) - @engine.start - end - - def shutdown - @engine.shutdown - super - end - - def emit(tag, es, chain) - es.each do |time, record| - process_event(tag, record) - end - chain.next - end - - private - def process_event(tag, record) - $log.trace("out_droonga: tag: <#{tag}>") - @engine.process(parse_record(tag, record)) - end - - def parse_record(tag, record) - prefix, type, *arguments = tag.split(/\./) - if type.nil? or type.empty? or type == "message" - message = record - else - message = { - "type" => type, - "arguments" => arguments, - "body" => record - } - end - reply_to = message["replyTo"] - if reply_to.is_a? String - message["replyTo"] = { - "type" => "#{message["type"]}.result", - "to" => reply_to - } - end - message - end - end -end -------------- next part -------------- HTML����������������������������...Download