[Groonga-commit] droonga/droonga-engine at f8d565c [master] Shorten method name

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 15:46:45 JST 2015


YUKI Hiroshi	2015-04-21 15:46:45 +0900 (Tue, 21 Apr 2015)

  New Revision: f8d565c50453d90834b43f7d77ee941c2a5bdd5e
  https://github.com/droonga/droonga-engine/commit/f8d565c50453d90834b43f7d77ee941c2a5bdd5e

  Message:
    Shorten method name

  Modified files:
    bin/droonga-engine-join
    lib/droonga/serf.rb

  Modified: bin/droonga-engine-join (+7 -7)
===================================================================
--- bin/droonga-engine-join    2015-04-21 15:35:20 +0900 (fc42256)
+++ bin/droonga-engine-join    2015-04-21 15:46:45 +0900 (35f9e28)
@@ -221,7 +221,7 @@ module Droonga
     def set_source_node_role
       if absorber.source_node_suspendable?
         puts("Changing role of the source node...")
-        source_node_serf.do_and_wait_restart do
+        source_node_serf.ensure_restarted do
           source_node_serf.send_query("change_role",
                                       "node" => source_node.to_s,
                                       "role" => NodeRole::ABSORB_SOURCE)
@@ -232,7 +232,7 @@ module Droonga
 
     def set_joining_node_role
       puts("Changing role of the joining node...")
-      joining_node_serf.do_and_wait_restart do
+      joining_node_serf.ensure_restarted do
         joining_node_serf.send_query("change_role",
                                      "node" => joining_node.to_s,
                                      "role" => NodeRole::ABSORB_DESTINATION)
@@ -243,7 +243,7 @@ module Droonga
     def reset_source_node_role
       if absorber.source_node_suspendable?
         puts("Restoring role of the source node...")
-        source_node_serf.do_and_wait_restart do
+        source_node_serf.ensure_restarted do
           source_node_serf.send_query("change_role",
                                       "node" => source_node.to_s,
                                       "role" => NodeRole::SERVICE_PROVIDER)
@@ -254,7 +254,7 @@ module Droonga
 
     def reset_joining_node_role
       puts("Restoring role of the joining node...")
-      joining_node_serf.do_and_wait_restart do
+      joining_node_serf.ensure_restarted do
         joining_node_serf.send_query("change_role",
                                      "node" => joining_node.to_s,
                                      "role" => NodeRole::SERVICE_PROVIDER)
@@ -264,7 +264,7 @@ module Droonga
 
     def do_join
       puts("Joining new replica to the cluster...")
-      joining_node_serf.do_and_wait_restart do
+      joining_node_serf.ensure_restarted do
         joining_node_serf.send_query("join",
                                      "node"    => joining_node.to_s,
                                      "type"    => "replica",
@@ -313,7 +313,7 @@ module Droonga
 
     def register_to_existing_nodes
       puts("Register new node to existing hosts in the cluster...")
-      source_node_serf.do_and_wait_restart do
+      source_node_serf.ensure_restarted do
         source_node_serf.send_query("add_replicas",
                                     "cluster_id" => source_cluster_id,
                                     "dataset"    => dataset,
@@ -324,7 +324,7 @@ module Droonga
 
     def unregister_from_existing_nodes
       puts("Unregister new node from existing hosts in the cluster...")
-      source_node_serf.do_and_wait_restart do
+      source_node_serf.ensure_restarted do
         source_node_serf.send_query("remove_replicas",
                                     "cluster_id" => source_cluster_id,
                                     "dataset"    => dataset,

  Modified: lib/droonga/serf.rb (+1 -1)
===================================================================
--- lib/droonga/serf.rb    2015-04-21 15:35:20 +0900 (35bf926)
+++ lib/droonga/serf.rb    2015-04-21 15:46:45 +0900 (e9b5d88)
@@ -221,7 +221,7 @@ module Droonga
     CHECK_RESTARTED_INTERVAL = 3
     CHECK_RESTARTED_TIMEOUT = 60 * 5
 
-    def do_and_wait_restart(&block)
+    def ensure_restarted(&block)
       start_time = Time.now
       previous_internal_name = get_tag("internal-name")
       yield # the given operation must restart the service.
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index