YUKI Hiroshi
null+****@clear*****
Tue Apr 21 16:24:28 JST 2015
YUKI Hiroshi 2015-04-21 16:24:28 +0900 (Tue, 21 Apr 2015) New Revision: ac30ee5b2c57481ca500b4ec904827ed1ae37c57 https://github.com/droonga/droonga-engine/commit/ac30ee5b2c57481ca500b4ec904827ed1ae37c57 Message: Fix indent Modified files: bin/droonga-engine-unjoin Modified: bin/droonga-engine-unjoin (+53 -53) =================================================================== --- bin/droonga-engine-unjoin 2015-04-21 16:22:51 +0900 (060584f) +++ bin/droonga-engine-unjoin 2015-04-21 16:24:28 +0900 (3aab150) @@ -56,75 +56,75 @@ module Droonga node end - def dataset_name - @options[:dataset] - end + def dataset_name + @options[:dataset] + end - def cluster_id - catalog.cluster_id - end + def cluster_id + catalog.cluster_id + end - def catalog - @catalog ||= parse_catalog - end + def catalog + @catalog ||= parse_catalog + end - def parse_catalog - loader = Catalog::Loader.new - loader.parse(raw_catalog) - end + def parse_catalog + loader = Catalog::Loader.new + loader.parse(raw_catalog) + end - def raw_catalog - @raw_catalog ||= fetch_catalog - end + def raw_catalog + @raw_catalog ||= fetch_catalog + end - def fetch_catalog - fetcher = Catalog::Fetcher.new(:host => replica_remove_host, - :port => port, - :tag => tag, - :receiver_host => @options["receiver-host"]) - fetcher.fetch(:dataset => dataset_name) - end + def fetch_catalog + fetcher = Catalog::Fetcher.new(:host => replica_remove_host, + :port => port, + :tag => tag, + :receiver_host => @options["receiver-host"]) + fetcher.fetch(:dataset => dataset_name) + end - def remaining_node - @remaining_node ||= prepare_remaining_node - end + def remaining_node + @remaining_node ||= prepare_remaining_node + end - def remaining_node_serf - @remaining_node_serf ||= Serf.new(remaining_node.to_s, - :verbose => @options[:verbose]) - end + def remaining_node_serf + @remaining_node_serf ||= Serf.new(remaining_node.to_s, + :verbose => @options[:verbose]) + end - def prepare_remaining_node - generator = Catalog::Generator.new - generator.load(raw_catalog) + def prepare_remaining_node + generator = Catalog::Generator.new + generator.load(raw_catalog) - dataset = generator.dataset_for_host(replica_remove_host) - unless dataset - raise "Specified host #{replica_remove_host} is not a member of "+ - "the cluster. You must specify correct host via --replica-remove-host " + - "option." - end + dataset = generator.dataset_for_host(replica_remove_host) + unless dataset + raise "Specified host #{replica_remove_host} is not a member of "+ + "the cluster. You must specify correct host via --replica-remove-host " + + "option." + end - other_hosts = dataset.replicas.hosts + other_hosts = dataset.replicas.hosts - remaining_host = other_hosts.first || replica_remove_host - NodeName.new(:host => remaining_host, - :port => port, - :tag => tag) - end + remaining_host = other_hosts.first || replica_remove_host + NodeName.new(:host => remaining_host, + :port => port, + :tag => tag) + end - def do_unjoin - puts "Unjoining replica from the cluster..." + def do_unjoin + puts "Unjoining replica from the cluster..." - remaining_node_serf.ensure_restarted do - remaining_node_serf.send_query("unjoin", - "cluster_id" => cluster_id, - "dataset" => dataset_name, - "hosts" => [replica_remove_host]) + remaining_node_serf.ensure_restarted do + remaining_node_serf.send_query("unjoin", + "cluster_id" => cluster_id, + "dataset" => dataset_name, + "hosts" => [replica_remove_host]) + end end end end - end end exit(Droonga::Command::Unjoin.new.run) -------------- next part -------------- HTML����������������������������... Download