Class: GroongaDelta::LocalReader::PackedSchemaTarget
- Inherits:
-
Object
- Object
- GroongaDelta::LocalReader::PackedSchemaTarget
- Includes:
- Loggable
- Defined in:
- lib/groonga-delta/local-reader.rb
Instance Attribute Summary collapse
-
#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) ⇒ PackedSchemaTarget
constructor
A new instance of PackedSchemaTarget.
- #vacuum(logger) ⇒ Object
Constructor Details
#initialize(path, timestamp) ⇒ PackedSchemaTarget
Returns a new instance of PackedSchemaTarget.
262 263 264 265 266 |
# File 'lib/groonga-delta/local-reader.rb', line 262 def initialize(path, ) @path = path @timestamp = @targets = [] end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
259 260 261 |
# File 'lib/groonga-delta/local-reader.rb', line 259 def path @path end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
261 262 263 |
# File 'lib/groonga-delta/local-reader.rb', line 261 def targets @targets end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
260 261 262 |
# File 'lib/groonga-delta/local-reader.rb', line 260 def @timestamp end |
Instance Method Details
#apply(logger, client, processor) ⇒ Object
268 269 270 271 272 273 274 |
# File 'lib/groonga-delta/local-reader.rb', line 268 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
276 277 278 279 280 281 282 |
# File 'lib/groonga-delta/local-reader.rb', line 276 def vacuum(logger) vacuum_log(logger, @path) do @targets.sort_by(&:timestamp).each do |target| target.vacuum(logger) end end end |