Class: GroongaDelta::LocalReader::PackedTableTarget
- Inherits:
-
Object
- Object
- GroongaDelta::LocalReader::PackedTableTarget
- Includes:
- Loggable
- Defined in:
- lib/groonga-delta/local-reader.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #apply(logger, client, processor) ⇒ Object
-
#initialize(path, timestamp, name) ⇒ PackedTableTarget
constructor
A new instance of PackedTableTarget.
- #vacuum(logger) ⇒ Object
Constructor Details
#initialize(path, timestamp, name) ⇒ PackedTableTarget
Returns a new instance of PackedTableTarget.
329 330 331 332 333 334 |
# File 'lib/groonga-delta/local-reader.rb', line 329 def initialize(path, , name) @path = path @timestamp = @name = name @targets = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
327 328 329 |
# File 'lib/groonga-delta/local-reader.rb', line 327 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
325 326 327 |
# File 'lib/groonga-delta/local-reader.rb', line 325 def path @path end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
328 329 330 |
# File 'lib/groonga-delta/local-reader.rb', line 328 def targets @targets end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
326 327 328 |
# File 'lib/groonga-delta/local-reader.rb', line 326 def @timestamp end |
Instance Method Details
#apply(logger, client, processor) ⇒ Object
336 337 338 339 340 341 342 |
# File 'lib/groonga-delta/local-reader.rb', line 336 def apply(logger, client, processor) apply_log(logger, @path) do @targets.sort_by(&:timestamp).each do |target| target.apply(logger, client, processor) end end end |
#vacuum(logger) ⇒ Object
344 345 346 347 348 349 350 |
# File 'lib/groonga-delta/local-reader.rb', line 344 def vacuum(logger) vacuum_log(logger, @path) do @targets.sort_by(&:timestamp).each do |target| target.vacuum(logger) end end end |