Class: LogStash::Outputs::LogstashAzureBlobOutput::TemporaryFileFactory
- Inherits:
-
Object
- Object
- LogStash::Outputs::LogstashAzureBlobOutput::TemporaryFileFactory
- Defined in:
- lib/logstash/outputs/blob/temporary_file_factory.rb
Overview
a sub class of LogstashAzureBlobOutput
creates the temporary files to write and later upload
Defined Under Namespace
Classes: IOWrappedGzip
Constant Summary collapse
- FILE_MODE =
'a'.freeze
- GZIP_ENCODING =
'gzip'.freeze
- GZIP_EXTENSION =
'txt.gz'.freeze
- TXT_EXTENSION =
'txt'.freeze
- STRFTIME =
'%Y-%m-%dT%H.%M'.freeze
Instance Attribute Summary collapse
-
#counter ⇒ Object
Returns the value of attribute counter.
-
#current ⇒ Object
Returns the value of attribute current.
-
#encoding ⇒ Object
Returns the value of attribute encoding.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#temporary_directory ⇒ Object
Returns the value of attribute temporary_directory.
Instance Method Summary collapse
-
#initialize(prefix, tags, encoding, temporary_directory) ⇒ TemporaryFileFactory
constructor
initialize the class.
-
#rotate! ⇒ Object
do the rotation.
Constructor Details
#initialize(prefix, tags, encoding, temporary_directory) ⇒ TemporaryFileFactory
initialize the class
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 22 def initialize(prefix, , encoding, temporary_directory) @counter = 0 @prefix = prefix @tags = @encoding = encoding @temporary_directory = temporary_directory @lock = Mutex.new rotate! end |
Instance Attribute Details
#counter ⇒ Object
Returns the value of attribute counter.
19 20 21 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 19 def counter @counter end |
#current ⇒ Object
Returns the value of attribute current.
19 20 21 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 19 def current @current end |
#encoding ⇒ Object
Returns the value of attribute encoding.
19 20 21 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 19 def encoding @encoding end |
#prefix ⇒ Object
Returns the value of attribute prefix.
19 20 21 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 19 def prefix @prefix end |
#tags ⇒ Object
Returns the value of attribute tags.
19 20 21 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 19 def @tags end |
#temporary_directory ⇒ Object
Returns the value of attribute temporary_directory.
19 20 21 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 19 def temporary_directory @temporary_directory end |
Instance Method Details
#rotate! ⇒ Object
do the rotation
35 36 37 38 39 40 41 |
# File 'lib/logstash/outputs/blob/temporary_file_factory.rb', line 35 def rotate! @lock.synchronize do @current = new_file increment_counter @current end end |