Class: GroongaDelta::LocalReader::PackedSchemaTarget

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/groonga-delta/local-reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, timestamp)
  @path = path
  @timestamp = timestamp
  @targets = []
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



259
260
261
# File 'lib/groonga-delta/local-reader.rb', line 259

def path
  @path
end

#targetsObject (readonly)

Returns the value of attribute targets.



261
262
263
# File 'lib/groonga-delta/local-reader.rb', line 261

def targets
  @targets
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



260
261
262
# File 'lib/groonga-delta/local-reader.rb', line 260

def timestamp
  @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