Class: GroongaDelta::LocalDelta
- Inherits:
-
Object
- Object
- GroongaDelta::LocalDelta
- Defined in:
- lib/groonga-delta/local-delta.rb
Defined Under Namespace
Classes: CommandProcessor
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(config, status) ⇒ LocalDelta
constructor
A new instance of LocalDelta.
Constructor Details
#initialize(config, status) ⇒ LocalDelta
Returns a new instance of LocalDelta.
22 23 24 25 26 27 |
# File 'lib/groonga-delta/local-delta.rb', line 22 def initialize(config, status) @config = config @status = status @logger = @config.logger @delta_dir = @config.local.delta_dir end |
Instance Method Details
#apply ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/groonga-delta/local-delta.rb', line 29 def apply reader = LocalReader.new(@logger, @delta_dir) start_time = read_current_status(reader) current_time = Time.now.utc = { url: @config.groonga.url, read_timeout: @config.groonga.read_timeout, backend: :synchronous, } Groonga::Client.open() do |client| processor = CommandProcessor.new(@config, client, target_commands: [], target_tables: [], target_columns: []) reader.each(start_time, current_time) do |target| target.apply(@logger, client, processor) @status.update("start_time" => [ target..to_i, target..nsec, ]) end end end |