Class: Droonga::Command::Remote::AddReplicas

Inherits:
ModifyReplicasBase show all
Defined in:
lib/droonga/command/remote.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#initialize, #should_process?

Constructor Details

This class inherits a constructor from Droonga::Command::Remote::Base

Instance Method Details

#processObject



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/droonga/command/remote.rb', line 334

def process
  return if dataset.nil? or hosts.nil?

  added_hosts = hosts - [host]
  log("adding replicas: #{added_hosts.join(",")}")
  return if added_hosts.empty?

  CatalogModifier.modify do |modifier, file|
    modifier.datasets[dataset].replicas.hosts += added_hosts
    modifier.datasets[dataset].replicas.hosts.uniq!
    @service_installation.ensure_correct_file_permission(file)
  end

  @serf.join(*added_hosts)
end