Class: Droonga::Serf::RemoteCommand::SetReplicas

Inherits:
ModifyReplicasBase show all
Defined in:
lib/droonga/serf/remote_command.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#initialize, #log, #should_process?

Constructor Details

This class inherits a constructor from Droonga::Serf::RemoteCommand::Base

Instance Method Details

#processObject



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/droonga/serf/remote_command.rb', line 262

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

  log("new replicas: #{hosts.join(",")}")

  log("joining to the cluster")
  @serf.join(*hosts)

  log("setting replicas to the cluster")
  Catalog::Modifier.new(catalog).modify do |modifier, file|
    modifier.datasets[dataset].replicas.hosts = hosts
    @service_installation.ensure_correct_file_permission(file)
  end
  log("done")
end