Class: Droonga::Serf::RemoteCommand::Unjoin

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



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/droonga/serf/remote_command.rb', line 316

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

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

  log("unjoining from the cluster")
  Catalog::Modifier.new(catalog).modify do |modifier, file|
    if unjoining_node?
      modifier.datasets[dataset].replicas.hosts = hosts
    else
      modifier.datasets[dataset].replicas.hosts -= hosts
    end
    @service_installation.ensure_correct_file_permission(file)
  end
  log("done")
end