[Groonga-commit] droonga/droonga-engine at c17fefa [master] Ignore remote commands for other Droonga clusters

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Dec 5 18:09:41 JST 2014


YUKI Hiroshi	2014-12-05 18:09:41 +0900 (Fri, 05 Dec 2014)

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

  Merged 97ba0d9: Merge ../droonga-engine into replicas-in-a-branch

  Message:
    Ignore remote commands for other Droonga clusters

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

  Modified: lib/droonga/command/remote.rb (+13 -0)
===================================================================
--- lib/droonga/command/remote.rb    2014-12-05 18:04:06 +0900 (9012b03)
+++ lib/droonga/command/remote.rb    2014-12-05 18:09:41 +0900 (54ce5b5)
@@ -50,6 +50,7 @@ module Droonga
         end
 
         def should_process?
+          return false unless for_this_cluster?
           for_me? or****@param*****? or not****@param*****?("node")
         end
 
@@ -62,10 +63,22 @@ module Droonga
           node.split(":").first
         end
 
+        def cluster_id
+          @serf.cluster_id
+        end
+
+        def target_cluster
+          @params && @params["cluster_id"]
+        end
+
         def target_node
           @params && @params["node"]
         end
 
+        def for_this_cluster?
+          target_cluster.nil? or target_cluster == cluster_id
+        end
+
         def for_me?
           target_node == @serf_name
         end
-------------- next part --------------
HTML����������������������������...
Download 



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