Class: DLogReader::RotaterReader
- Inherits:
-
DistributedLogReader
- Object
- DistributedLogReader
- DLogReader::RotaterReader
- Defined in:
- lib/distributed_logreader/distributed_log_reader/rotater_reader.rb
Instance Attribute Summary collapse
-
#archiver ⇒ Object
Returns the value of attribute archiver.
-
#log_reader ⇒ Object
readonly
Returns the value of attribute log_reader.
-
#selector ⇒ Object
Returns the value of attribute selector.
Attributes inherited from DistributedLogReader
Instance Method Summary collapse
-
#initialize(filename, backupdir, worker, num_threads = 10) ⇒ RotaterReader
constructor
A new instance of RotaterReader.
- #log_file ⇒ Object
- #post_process ⇒ Object
Methods inherited from DistributedLogReader
Constructor Details
#initialize(filename, backupdir, worker, num_threads = 10) ⇒ RotaterReader
Returns a new instance of RotaterReader.
5 6 7 8 9 |
# File 'lib/distributed_logreader/distributed_log_reader/rotater_reader.rb', line 5 def initialize(filename, backupdir, worker, num_threads = 10) super(filename, worker, num_threads) self.selector = RotatingLog.new self.archiver = DateDir.new(backupdir) end |
Instance Attribute Details
#archiver ⇒ Object
Returns the value of attribute archiver.
3 4 5 |
# File 'lib/distributed_logreader/distributed_log_reader/rotater_reader.rb', line 3 def archiver @archiver end |
#log_reader ⇒ Object (readonly)
Returns the value of attribute log_reader.
4 5 6 |
# File 'lib/distributed_logreader/distributed_log_reader/rotater_reader.rb', line 4 def log_reader @log_reader end |
#selector ⇒ Object
Returns the value of attribute selector.
3 4 5 |
# File 'lib/distributed_logreader/distributed_log_reader/rotater_reader.rb', line 3 def selector @selector end |
Instance Method Details
#log_file ⇒ Object
11 12 13 14 15 |
# File 'lib/distributed_logreader/distributed_log_reader/rotater_reader.rb', line 11 def log_file @log_file ||= begin selector.file_to_process(filename) end end |
#post_process ⇒ Object
17 18 19 |
# File 'lib/distributed_logreader/distributed_log_reader/rotater_reader.rb', line 17 def post_process self.archiver.archive(log_file) end |