[Groonga-commit] droonga/droonga-engine at 2cf022a [buffered-forward] Deliver write messages to suitable nodes based on the role of myself

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Dec 18 16:13:38 JST 2014


YUKI Hiroshi	2014-12-18 16:13:38 +0900 (Thu, 18 Dec 2014)

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

  Merged 69350ee: Merge branch 'master' into buffered-forward

  Message:
    Deliver write messages to suitable nodes based on the role of myself

  Modified files:
    lib/droonga/engine_state.rb

  Modified: lib/droonga/engine_state.rb (+13 -2)
===================================================================
--- lib/droonga/engine_state.rb    2014-12-18 16:07:42 +0900 (418a5b5)
+++ lib/droonga/engine_state.rb    2014-12-18 16:13:38 +0900 (4a718e8)
@@ -143,12 +143,14 @@ module Droonga
 
     def same_role_nodes
       case node_status(:role)
+      when NodeStatus::Role::SERVICE_PROVIDER
+        all_nodes & service_provider_nodes
       when NodeStatus::Role::ABSORB_SOURCE
         all_nodes & absorb_source_nodes
       when NodeStatus::Role::ABSORB_DESTINATION
         all_nodes & absorb_destination_nodes
       else
-        all_nodes & service_provider_nodes
+        []
       end
     end
 
@@ -157,7 +159,16 @@ module Droonga
     end
 
     def writable_nodes
-      all_nodes
+      case node_status(:role)
+      when NodeStatus::Role::SERVICE_PROVIDER
+        all_nodes
+      when NodeStatus::Role::ABSORB_SOURCE
+        all_nodes & absorb_source_nodes
+      when NodeStatus::Role::ABSORB_DESTINATION
+        all_nodes & absorb_destination_nodes
+      else
+        []
+      end
     end
 
     def live_nodes_list=(new_nodes_list)
-------------- next part --------------
HTML����������������������������...
다운로드 



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