module Fluent::Plugin::FileWithHeaderOutput::SymlinkBufferMixin
Public Instance Methods
generate_chunk(metadata)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_file_with_header.rb, line 90 def generate_chunk(metadata) chunk = super # "symlink" feature is to link from symlink_path to the latest file chunk. Records with latest # timekey will be appended into that file chunk. On the other side, resumed file chunks might NOT # have timekey, especially in the cases that resumed file chunks are generated by Fluentd v0.12. # These chunks will be enqueued immediately, and will be flushed soon. if chunk.metadata == @latest_metadata sym_path = @_output_plugin_for_symlink.extract_placeholders(@_symlink_path, chunk) FileUtils.mkdir_p(File.dirname(sym_path), mode: @_output_plugin_for_symlink.dir_perm) FileUtils.ln_sf(chunk.path, sym_path) end chunk end
metadata(timekey: nil, tag: nil, variables: nil)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_file_with_header.rb, line 71 def metadata(timekey: nil, tag: nil, variables: nil) metadata = super @latest_metadata ||= new_metadata(timekey: 0) if metadata.timekey && (metadata.timekey >= @latest_metadata.timekey) @latest_metadata = metadata end metadata end
output_plugin_for_symlink=(output_plugin)
click to toggle source
# File lib/fluent/plugin/out_file_with_header.rb, line 82 def output_plugin_for_symlink=(output_plugin) @_output_plugin_for_symlink = output_plugin end
symlink_path=(path)
click to toggle source
# File lib/fluent/plugin/out_file_with_header.rb, line 86 def symlink_path=(path) @_symlink_path = path end