Class: LogStash::Outputs::LogstashAzureBlobOutput::TemporaryFileFactory::IOWrappedGzip
- Inherits:
-
Object
- Object
- LogStash::Outputs::LogstashAzureBlobOutput::TemporaryFileFactory::IOWrappedGzip
- Extended by:
- Forwardable
- Defined in:
- lib/logstash/outputs/blob/temporary_file_factory.rb
Overview
clas for the encoding
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
gets the fsync.
-
#initialize(file_io) ⇒ IOWrappedGzip
constructor
initialize the class for encoding.
-
#path ⇒ Object
gets the path.
-
#size ⇒ Object
gets the file size.
Constructor Details
#initialize(file_io) ⇒ IOWrappedGzip
initialize the class for encoding
104 105 106 107 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 104 def initialize(file_io) @file_io = file_io @gzip_writer = Zlib::GzipWriter.open(file_io) end |
Instance Attribute Details
#file_io ⇒ Object (readonly)
Returns the value of attribute file_io.
101 102 103 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 101 def file_io @file_io end |
#gzip_writer ⇒ Object (readonly)
Returns the value of attribute gzip_writer.
101 102 103 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 101 def gzip_writer @gzip_writer end |
Instance Method Details
#fsync ⇒ Object
gets the fsync
128 129 130 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 128 def fsync @gzip_writer.to_io.fsync end |
#path ⇒ Object
gets the path
110 111 112 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 110 def path @gzip_writer.to_io.path end |
#size ⇒ Object
gets the file size
115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 115 def size # to get the current file size if @gzip_writer.pos.zero? # 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 |