Class: LogStash::Outputs::OSS::GzipFile
- Inherits:
-
Object
- Object
- LogStash::Outputs::OSS::GzipFile
- Extended by:
- Forwardable
- Defined in:
- lib/logstash/outputs/oss/gzip_file.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#gzip_writer ⇒ Object
readonly
Returns the value of attribute gzip_writer.
Instance Method Summary collapse
- #fsync ⇒ Object
-
#initialize(file) ⇒ GzipFile
constructor
A new instance of GzipFile.
- #path ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(file) ⇒ GzipFile
Returns a new instance of GzipFile.
12 13 14 15 |
# File 'lib/logstash/outputs/oss/gzip_file.rb', line 12 def initialize(file) @file = file @gzip_writer = Zlib::GzipWriter.new(file) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
10 11 12 |
# File 'lib/logstash/outputs/oss/gzip_file.rb', line 10 def file @file end |
#gzip_writer ⇒ Object (readonly)
Returns the value of attribute gzip_writer.
10 11 12 |
# File 'lib/logstash/outputs/oss/gzip_file.rb', line 10 def gzip_writer @gzip_writer end |
Instance Method Details
#fsync ⇒ Object
30 31 32 |
# File 'lib/logstash/outputs/oss/gzip_file.rb', line 30 def fsync @gzip_writer.to_io.fsync end |
#path ⇒ Object
17 18 19 |
# File 'lib/logstash/outputs/oss/gzip_file.rb', line 17 def path @gzip_writer.to_io.path end |
#size ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/logstash/outputs/oss/gzip_file.rb', line 21 def size if @gzip_writer.pos == 0 0 else @gzip_writer.flush @gzip_writer.to_io.size end end |