Class: LogStash::Outputs::S3::TemporaryFileFactory::IOWrappedGzip
- Inherits:
-
Object
- Object
- LogStash::Outputs::S3::TemporaryFileFactory::IOWrappedGzip
- Extended by:
- Forwardable
- Defined in:
- lib/logstash/outputs/s3/temporary_file_factory.rb
Instance Attribute Summary collapse
-
#file_io ⇒ Object
readonly
Returns the value of attribute file_io.
-
#gzip_writer ⇒ Object
readonly
Returns the value of attribute gzip_writer.
Instance Method Summary collapse
- #fsync ⇒ Object
-
#initialize(file_io) ⇒ IOWrappedGzip
constructor
A new instance of IOWrappedGzip.
- #path ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(file_io) ⇒ IOWrappedGzip
Returns a new instance of IOWrappedGzip.
98 99 100 101 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 98 def initialize(file_io) @file_io = file_io @gzip_writer = Zlib::GzipWriter.new(file_io) end |
Instance Attribute Details
#file_io ⇒ Object (readonly)
Returns the value of attribute file_io.
96 97 98 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 96 def file_io @file_io end |
#gzip_writer ⇒ Object (readonly)
Returns the value of attribute gzip_writer.
96 97 98 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 96 def gzip_writer @gzip_writer end |
Instance Method Details
#fsync ⇒ Object
119 120 121 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 119 def fsync @gzip_writer.to_io.fsync end |
#path ⇒ Object
103 104 105 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 103 def path @gzip_writer.to_io.path end |
#size ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 107 def size # to get the current file size if @gzip_writer.pos == 0 # Ensure a zero file size is returned when nothing has # yet been written to the gzip file. 0 else @gzip_writer.flush @gzip_writer.to_io.size end end |