class Fluent::WendelinOutput

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_wendelin.rb, line 48
def configure(conf)
    super

    credentials = {}
    if @user
        credentials['user']     = @user
        credentials['password'] = @password
    end
    @wendelin = WendelinClient.new(@streamtool_uri, credentials, @log,
                                   @ssl_timeout, @open_timeout,
                                   @read_timeout, @keep_alive_timeout)
end
shutdown() click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_wendelin.rb, line 66
def shutdown
    super
    # TODO
end
start() click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_wendelin.rb, line 61
def start
    super
    # TODO
end
write_objects(tag, chunk) click to toggle source

hooked to ObjectBufferedOutput - write out records from a buffer chunk for a tag.

NOTE this is called from a separate thread (see OutputThread and BufferedOutput)

# File lib/fluent/plugin/out_wendelin.rb, line 75
def write_objects(tag, chunk)
    # NOTE if this fail and raises -> it will unroll to BufferedOutput#try_flush
    # which detects errors and retries outputting logs up to retry maxcount
    # times and aborts outputting current logs if all try fail.
    #
    # This way, we don't need to code rescue here.

    # NOTE tag is 1, and chunk stores an event stream, usually [] of
    # (timestamp, record) in msgpack, but it general it could be arbitrary
    # data - we send it as-is.
    data_chunk = chunk.read()

    # for input_stream_ref use tag as-is - it will be processed/translated
    # further on server by Wendelin
    reference = tag

    if @use_keep_alive
      @wendelin.ingest_with_keep_alive(reference, data_chunk)
    else
      @wendelin.ingest(reference, data_chunk)
    end
end