class Fluent::BufferChunk

Attributes

key[R]

Public Class Methods

new(key) click to toggle source
Calls superclass method
# File lib/fluent/buffer.rb, line 78
def initialize(key)
  super()
  @key = key
end

Public Instance Methods

<<(data) click to toggle source
# File lib/fluent/buffer.rb, line 85
def <<(data)
  raise NotImplementedError, "Implement this method in child class"
end
close() click to toggle source
# File lib/fluent/buffer.rb, line 97
def close
  raise NotImplementedError, "Implement this method in child class"
end
empty?() click to toggle source
# File lib/fluent/buffer.rb, line 93
def empty?
  size == 0
end
msgpack_each(&block) click to toggle source
# File lib/fluent/buffer.rb, line 119
def msgpack_each(&block)
  open {|io|
    u = Fluent::Engine.msgpack_factory.unpacker(io)
    begin
      u.each(&block)
    rescue EOFError
    end
  }
end
open() click to toggle source
# File lib/fluent/buffer.rb, line 109
def open
  raise NotImplementedError, "Implement this method in child class"
end
purge() click to toggle source
# File lib/fluent/buffer.rb, line 101
def purge
  raise NotImplementedError, "Implement this method in child class"
end
read() click to toggle source
# File lib/fluent/buffer.rb, line 105
def read
  raise NotImplementedError, "Implement this method in child class"
end
size() click to toggle source
# File lib/fluent/buffer.rb, line 89
def size
  raise NotImplementedError, "Implement this method in child class"
end
write_to(io) click to toggle source
# File lib/fluent/buffer.rb, line 113
def write_to(io)
  open {|i|
    FileUtils.copy_stream(i, io)
  }
end