Class: GroongaDelta::LocalReader::PackedTableTarget

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



327
328
329
# File 'lib/groonga-delta/local-reader.rb', line 327

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



325
326
327
# File 'lib/groonga-delta/local-reader.rb', line 325

def path
  @path
end

#targetsObject (readonly)

Returns the value of attribute targets.



328
329
330
# File 'lib/groonga-delta/local-reader.rb', line 328

def targets
  @targets
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



326
327
328
# File 'lib/groonga-delta/local-reader.rb', line 326

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