Class: GroongaDelta::LocalReader::SchemaTarget

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) ⇒ SchemaTarget

Returns a new instance of SchemaTarget.



238
239
240
241
# File 'lib/groonga-delta/local-reader.rb', line 238

def initialize(path, timestamp)
  @path = path
  @timestamp = timestamp
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



236
237
238
# File 'lib/groonga-delta/local-reader.rb', line 236

def path
  @path
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



237
238
239
# File 'lib/groonga-delta/local-reader.rb', line 237

def timestamp
  @timestamp
end

Instance Method Details

#apply(logger, client, processor) ⇒ Object



243
244
245
246
247
# File 'lib/groonga-delta/local-reader.rb', line 243

def apply(logger, client, processor)
  apply_log(logger, @path) do
    processor.load(@path)
  end
end

#vacuum(logger) ⇒ Object



249
250
251
252
253
# File 'lib/groonga-delta/local-reader.rb', line 249

def vacuum(logger)
  vacuum_log(logger, @path) do
    FileUtils.rm(@path)
  end
end