[Groonga-commit] droonga/droonga-engine at 3dabc74 [master] Isolate EngineNode from NodeMetadata

アーカイブの一覧に戻る

YUKI Hiroshi null+****@clear*****
Tue Apr 21 12:07:05 JST 2015


YUKI Hiroshi	2015-04-21 12:07:05 +0900 (Tue, 21 Apr 2015)

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

  Message:
    Isolate EngineNode from NodeMetadata

  Modified files:
    lib/droonga/engine_node.rb

  Modified: lib/droonga/engine_node.rb (+4 -9)
===================================================================
--- lib/droonga/engine_node.rb    2015-04-21 12:06:31 +0900 (a8881d0)
+++ lib/droonga/engine_node.rb    2015-04-21 12:07:05 +0900 (3063bdb)
@@ -18,7 +18,7 @@ require "time"
 require "droonga/loggable"
 require "droonga/forward_buffer"
 require "droonga/fluent_message_sender"
-require "droonga/node_metadata"
+require "droonga/node_role"
 
 module Droonga
   class EngineNode
@@ -31,7 +31,6 @@ module Droonga
       logger.trace("initialize: start")
 
       @state = state
-      @sender_node_metadata = params[:metadata]
 
       @buffer = ForwardBuffer.new(name)
       boundary_timestamp = accept_messages_newer_than_timestamp
@@ -86,7 +85,7 @@ module Droonga
 
     def forwardable?
       return false unless live?
-      role == sender_role
+      role == NodeRole.my_role
     end
 
     def readable?
@@ -95,7 +94,7 @@ module Droonga
     end
 
     def writable?
-      case sender_role
+      case NodeRole.my_role
       when NodeMetadata::Role::SERVICE_PROVIDER
         true
       when NodeMetadata::Role::ABSORB_SOURCE
@@ -201,7 +200,7 @@ module Droonga
 
     def really_writable?
       return false unless writable?
-      case sender_role
+      case NodeRole.my_role
       when NodeMetadata::Role::SERVICE_PROVIDER
         service_provider?
       when NodeMetadata::Role::ABSORB_SOURCE
@@ -211,10 +210,6 @@ module Droonga
       end
     end
 
-    def sender_role
-      @sender_node_metadata.role
-    end
-
     def read_message?(message)
       steps = message["body"]["steps"]
       return false unless steps
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る