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



484
485
486
# File 'lib/fluent/plugin/in_s3.rb', line 484

def content_type
  'text/plain'.freeze
end

#extObject



480
481
482
# File 'lib/fluent/plugin/in_s3.rb', line 480

def ext
  'txt'.freeze
end

#extract(io) ⇒ Object



488
489
490
491
492
493
494
495
496
497
# File 'lib/fluent/plugin/in_s3.rb', line 488

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