[Groonga-commit] droonga/droonga-engine at b390114 [master] Use more meaningful name

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 13:27:34 JST 2015


YUKI Hiroshi	2015-04-21 13:27:34 +0900 (Tue, 21 Apr 2015)

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

  Message:
    Use more meaningful name

  Modified files:
    lib/droonga/command/remote.rb
    lib/droonga/dispatcher.rb
    lib/droonga/engine_node.rb
    lib/droonga/node_role.rb
    lib/droonga/serf.rb

  Modified: lib/droonga/command/remote.rb (+1 -1)
===================================================================
--- lib/droonga/command/remote.rb    2015-04-21 13:20:55 +0900 (20f16cc)
+++ lib/droonga/command/remote.rb    2015-04-21 13:27:34 +0900 (fccd384)
@@ -119,7 +119,7 @@ module Droonga
         def process
           log("old role: #{@serf.role}")
           @serf.role = @params["role"]
-          NodeRole.my_role =****@serf*****
+          NodeRole.mine =****@serf*****
           log("new role: #{@serf.role}")
         end
       end

  Modified: lib/droonga/dispatcher.rb (+2 -2)
===================================================================
--- lib/droonga/dispatcher.rb    2015-04-21 13:20:55 +0900 (2fcbafe)
+++ lib/droonga/dispatcher.rb    2015-04-21 13:27:34 +0900 (2336d72)
@@ -233,7 +233,7 @@ module Droonga
             target_nodes =****@clust*****_nodes
             if target_nodes.empty?
               logger.error("there is no node to dispath a write step!",
-                           :my_role   => NodeRole.my_role,
+                           :my_role   => NodeRole.mine,
                            :all_nodes => @cluster.engine_nodes.collect(&:to_json),
                            :step      => step)
             end
@@ -241,7 +241,7 @@ module Droonga
             target_nodes =****@clust*****_nodes
             if target_nodes.empty?
               logger.error("there is no node to dispath a read step!",
-                           :my_role   => NodeRole.my_role,
+                           :my_role   => NodeRole.mine,
                            :all_nodes => @cluster.engine_nodes.collect(&:to_json),
                            :step      => step)
             end

  Modified: lib/droonga/engine_node.rb (+3 -3)
===================================================================
--- lib/droonga/engine_node.rb    2015-04-21 13:20:55 +0900 (a95873f)
+++ lib/droonga/engine_node.rb    2015-04-21 13:27:34 +0900 (38b4297)
@@ -85,7 +85,7 @@ module Droonga
 
     def forwardable?
       return false unless live?
-      role == NodeRole.my_role
+      role == NodeRole.mine
     end
 
     def readable?
@@ -94,7 +94,7 @@ module Droonga
     end
 
     def writable?
-      case NodeRole.my_role
+      case NodeRole.mine
       when NodeRole::SERVICE_PROVIDER
         true
       when NodeRole::ABSORB_SOURCE
@@ -200,7 +200,7 @@ module Droonga
 
     def really_writable?
       return false unless writable?
-      case NodeRole.my_role
+      case NodeRole.mine
       when NodeRole::SERVICE_PROVIDER
         service_provider?
       when NodeRole::ABSORB_SOURCE

  Modified: lib/droonga/node_role.rb (+6 -6)
===================================================================
--- lib/droonga/node_role.rb    2015-04-21 13:20:55 +0900 (b9c0605)
+++ lib/droonga/node_role.rb    2015-04-21 13:27:34 +0900 (29c4a3e)
@@ -30,17 +30,17 @@ module Droonga
         ROLES.include?(role)
       end
 
-      def my_role
-        if @my_role
-          @my_role.to_s
+      def mine
+        if @mine
+          @mine.to_s
         else
           SERVICE_PROVIDER
         end
       end
 
-      def my_role=(new_role)
-        @my_role = new(new_role)
-        @my_role.to_s
+      def mine=(new_role)
+        @mine = new(new_role)
+        @mine.to_s
       end
     end
 

  Modified: lib/droonga/serf.rb (+1 -1)
===================================================================
--- lib/droonga/serf.rb    2015-04-21 13:20:55 +0900 (ab13325)
+++ lib/droonga/serf.rb    2015-04-21 13:27:34 +0900 (41be5a4)
@@ -75,7 +75,7 @@ module Droonga
       set_tag("cluster_id", cluster_id)
       current_role = role
       set_tag("role", current_role)
-      NodeRole.my_role = current_role
+      NodeRole.mine = current_role
     end
 
     def leave
-------------- next part --------------
HTML����������������������������...
다운로드 



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