-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add buffered output plugins for tests #847
Add buffered output plugins for tests #847
Conversation
8611be7
to
906853e
Compare
require 'fluent/output' | ||
|
||
module Fluent | ||
class BufferedStdoutOutput < BufferedOutput |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really subclass of BufferedOutput
? not ObjectBufferedOutput
?
There seems no format
method to be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment.
I think that inheriting ObjectBufferedOutput
is not enough for this plugin because ObjectBufferedOutput
does not implement format
itself.
It seems to need to implement format
in this plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking:
- There's no need to implement
format
method if the plugin is a subclass ofObjectBufferedOutput
ObjectBufferedOutput
plugins do NOT callformat
in itsemit
, and write msgpack binaries into buffer directly- https://github.com/fluent/fluentd/blob/master/lib/fluent/output.rb#L414
- its chunks can be iterated using
chunk.msgpack_each
inwrite_objects
, just likeout_forward
is doing - https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/out_forward.rb#L197
- It's needed to implement
format
method if a plugin is a subclass ofBufferedOutput
- BufferedOutput plugins write return values of
format
into chunks - Return values of
format
method MUST be msgpack binaries if you want to domsgpack_each
for chunks
- BufferedOutput plugins write return values of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see.
Sorry for my misunderstanding.... 🙇
I use ObjectBufferedOutput
instead of BufferedOutput
.
dafc1a6
to
0375a36
Compare
@formatter.configure(conf) | ||
end | ||
|
||
def emit(tag, es, chain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Along with ObjectBufferedOutput
way, it should be def write_objects(tag, chunk)
.
There's no need to handle chain
in write_object
.
4b51c89
to
b0f6217
Compare
@cosmo0920 Can you leave this pull-request as is for a while? |
Yup, I would like to leave as is for now. |
I'm sorry but I implemented |
* "run" thread stops if any output plugin raises errors * in_dummy should continue to emit records to reproduce errors without regarding any existing errors
* buffered_stdout: show records in log console w/ buffering * buffered_null: show errors only brought by buffer plugins These plugins are useful to develop 3rd party buffer plugins, so should be included in fluent/plugin/ directory.
b0f6217
to
e3f0ce0
Compare
Hmm, a build on AppVeyor failed, but there are no details. |
Thank you! |
Revised: #518.
And I've added tests for added buffered output plugins for testing.
Remaining Tasks