Class: LogStash::Outputs::Qingstor::TemporaryFileFactory::IOWrappedGzip
- Inherits:
-
Object
- Object
- LogStash::Outputs::Qingstor::TemporaryFileFactory::IOWrappedGzip
- Extended by:
- Forwardable
- Defined in:
- lib/logstash/outputs/qingstor/temporary_file_factory.rb
Instance Attribute Summary collapse
-
#file_io ⇒ Object
Returns the value of attribute file_io.
-
#gzip_writer ⇒ Object
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
92 93 94 95 |
# File 'lib/logstash/outputs/qingstor/temporary_file_factory.rb', line 92 def initialize(file_io) @file_io = file_io @gzip_writer = Zlib::GzipWriter.open(file_io) end |
Instance Attribute Details
#file_io ⇒ Object
Returns the value of attribute file_io.
90 91 92 |
# File 'lib/logstash/outputs/qingstor/temporary_file_factory.rb', line 90 def file_io @file_io end |
#gzip_writer ⇒ Object
Returns the value of attribute gzip_writer.
90 91 92 |
# File 'lib/logstash/outputs/qingstor/temporary_file_factory.rb', line 90 def gzip_writer @gzip_writer end |
Instance Method Details
#fsync ⇒ Object
110 111 112 |
# File 'lib/logstash/outputs/qingstor/temporary_file_factory.rb', line 110 def fsync @gzip_writer.to_io.fsync end |
#path ⇒ Object
97 98 99 |
# File 'lib/logstash/outputs/qingstor/temporary_file_factory.rb', line 97 def path @gzip_writer.to_io.path end |
#size ⇒ Object
101 102 103 104 105 106 107 108 |
# File 'lib/logstash/outputs/qingstor/temporary_file_factory.rb', line 101 def size if @gzip_writer.pos == 0 0 else @gzip_writer.flush @gzip_writer.to_io.size end end |