YUKI Hiroshi
null+****@clear*****
Sun Nov 30 17:45:18 JST 2014
YUKI Hiroshi 2014-11-30 17:45:18 +0900 (Sun, 30 Nov 2014) New Revision: 9a3cbaf5dadee18b6de6398fc3dc8c746821a692 https://github.com/droonga/droonga-engine/commit/9a3cbaf5dadee18b6de6398fc3dc8c746821a692 Message: Define Unjoin command as a sub class of ModifyReplicasBase Modified files: lib/droonga/command/remote.rb Modified: lib/droonga/command/remote.rb (+22 -22) =================================================================== --- lib/droonga/command/remote.rb 2014-11-30 10:49:38 +0900 (cf7569b) +++ lib/droonga/command/remote.rb 2014-11-30 17:45:18 +0900 (9012b03) @@ -238,28 +238,6 @@ module Droonga end end - class Unjoin < Base - def process - return if dataset.nil? or hosts.nil? - - log("unjoining replicas: #{hosts.join(",")}") - - CatalogModifier.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 - end - - private - def unjoining_node? - hosts.include?(host) - end - end - class AbsorbData < Base attr_writer :dataset_name, :port, :tag @@ -383,6 +361,28 @@ module Droonga end end + class Unjoin < ModifyReplicasBase + def process + return if dataset.nil? or hosts.nil? + + log("unjoining replicas: #{hosts.join(",")}") + + CatalogModifier.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 + end + + private + def unjoining_node? + hosts.include?(host) + end + end + class UpdateLiveNodes < Base def process path = Path.live_nodes -------------- next part -------------- HTML����������������������������...Download