[Groonga-commit] droonga/droonga-engine at 096abec [master] Manage role of myself via NodeRole.my_role globally

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 12:06:31 JST 2015


YUKI Hiroshi	2015-04-21 12:06:31 +0900 (Tue, 21 Apr 2015)

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

  Message:
    Manage role of myself via NodeRole.my_role globally

  Modified files:
    lib/droonga/command/remote.rb
    lib/droonga/serf.rb

  Modified: lib/droonga/command/remote.rb (+2 -1)
===================================================================
--- lib/droonga/command/remote.rb    2015-04-21 12:01:15 +0900 (dba5a35)
+++ lib/droonga/command/remote.rb    2015-04-21 12:06:31 +0900 (20f16cc)
@@ -18,7 +18,7 @@ require "json"
 require "droonga/path"
 require "droonga/serf"
 require "droonga/node_name"
-require "droonga/node_metadata"
+require "droonga/node_role"
 require "droonga/catalog/generator"
 require "droonga/catalog/modifier"
 require "droonga/catalog/fetcher"
@@ -119,6 +119,7 @@ module Droonga
         def process
           log("old role: #{@serf.role}")
           @serf.role = @params["role"]
+          NodeRole.my_role =****@serf*****
           log("new role: #{@serf.role}")
         end
       end

  Modified: lib/droonga/serf.rb (+2 -0)
===================================================================
--- lib/droonga/serf.rb    2015-04-21 12:01:15 +0900 (882c01d)
+++ lib/droonga/serf.rb    2015-04-21 12:06:31 +0900 (1b35c08)
@@ -67,6 +67,7 @@ module Droonga
         set_tag("type", "engine")
         set_tag("role", role)
         set_tag("cluster_id", cluster_id)
+        NodeRole.my_role = role
       end
       agent.start
       logger.trace("run_agent: done")
@@ -199,6 +200,7 @@ module Droonga
       role = NodeRole.new(new_role)
       set_tag("role", role.to_s)
       # after that you must run update_cluster_state to update the cluster information cache
+      role.to_s
     end
 
     def last_processed_message_timestamp
-------------- next part --------------
HTML����������������������������...
다운로드 



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