[Groonga-commit] long-long-float/droonga-engine at c1ae05a [master] Use instanciated @serf instead of class methods of Serf

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Aug 29 10:24:36 JST 2014


YUKI Hiroshi	2014-08-29 10:24:36 +0900 (Fri, 29 Aug 2014)

  New Revision: c1ae05a0d62088b8bc2deb303bc7139fd8da065d
  https://github.com/long-long-float/droonga-engine/commit/c1ae05a0d62088b8bc2deb303bc7139fd8da065d

  Message:
    Use instanciated @serf instead of class methods of Serf

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

  Modified: lib/droonga/command/remote.rb (+5 -4)
===================================================================
--- lib/droonga/command/remote.rb    2014-08-28 21:48:24 +0900 (0d355c8)
+++ lib/droonga/command/remote.rb    2014-08-29 10:24:36 +0900 (679a3eb)
@@ -36,6 +36,7 @@ module Droonga
           @response  = {
             "log" => []
           }
+          @serf = Serf.new(nil, @serf_name)
         end
 
         def process
@@ -171,7 +172,7 @@ module Droonga
             modifier.datasets[dataset_name].replicas.hosts.uniq!
           end
 
-          Serf.join(@serf_name, *other_hosts)
+          @serf.join(*other_hosts)
         end
 
         def replica_hosts(catalog=nil)
@@ -295,7 +296,7 @@ module Droonga
             modifier.datasets[dataset].replicas.hosts = hosts
           end
 
-          Serf.join(@serf_name, *hosts)
+          @serf.join(*hosts)
           #XXX Now we should restart serf agent to remove unjoined nodes from the list of members...
         end
       end
@@ -314,7 +315,7 @@ module Droonga
             modifier.datasets[dataset].replicas.hosts.uniq!
           end
 
-          Serf.join(@serf_name, *added_hosts)
+          @serf.join(*added_hosts)
         end
       end
 
@@ -342,7 +343,7 @@ module Droonga
 
         private
         def live_nodes
-          Serf.live_nodes(@serf_name)
+          @serf.live_nodes
         end
       end
     end

  Modified: lib/droonga/serf.rb (+0 -8)
===================================================================
--- lib/droonga/serf.rb    2014-08-28 21:48:24 +0900 (4f666fb)
+++ lib/droonga/serf.rb    2014-08-29 10:24:36 +0900 (e1b6c81)
@@ -48,14 +48,6 @@ module Droonga
       def send_query(name, query, payload)
         new(nil, name).send_query(query, payload)
       end
-
-      def join(name, *hosts)
-        new(nil, name).join(*hosts)
-      end
-
-      def live_nodes(name)
-        new(nil, name).live_nodes
-      end
     end
 
     include Loggable
-------------- next part --------------
HTML����������������������������...
Download 



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