Class: Fluent::Plugin::S3Input::TextExtractor

Inherits:
Extractor
  • Object
show all
Defined in:
lib/fluent/plugin/in_s3.rb

Direct Known Subclasses

JsonExtractor

Constant Summary

Constants inherited from Extractor

Extractor::BYTES_TO_READ

Instance Attribute Summary

Attributes inherited from Extractor

#log

Instance Method Summary collapse

Methods inherited from Extractor

#configure, #initialize

Constructor Details

This class inherits a constructor from Fluent::Plugin::S3Input::Extractor

Instance Method Details

#content_typeObject



531
532
533
# File 'lib/fluent/plugin/in_s3.rb', line 531

def content_type
  'text/plain'.freeze
end

#extObject



527
528
529
# File 'lib/fluent/plugin/in_s3.rb', line 527

def ext
  'txt'.freeze
end

#extract(io) ⇒ Object



535
536
537
538
539
540
541
542
543
544
# File 'lib/fluent/plugin/in_s3.rb', line 535

def extract(io)
  out = ''
  while (chunk = io.read(BYTES_TO_READ))
    out << chunk
    if out.bytesize > @decompression_size_limit
      raise SizeLimitError, "Extracted data exceeds limit of #{@decompression_size_limit} bytes"
    end
  end
  out
end