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.
101 102 103 104 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 101 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.
99 100 101 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 99 def file_io @file_io end |
#gzip_writer ⇒ Object (readonly)
Returns the value of attribute gzip_writer.
99 100 101 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 99 def gzip_writer @gzip_writer end |
Instance Method Details
#fsync ⇒ Object
122 123 124 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 122 def fsync @gzip_writer.to_io.fsync end |
#path ⇒ Object
106 107 108 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 106 def path @gzip_writer.to_io.path end |
#size ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/logstash/outputs/s3/temporary_file_factory.rb', line 110 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 |