[Groonga-commit] droonga/droonga-engine at 8a0a0e3 [master] Add method to get dead nodes

Zurück zum Archiv-Index

YUKI Hiroshi null+****@clear*****
Thu Jun 26 19:40:02 JST 2014


YUKI Hiroshi	2014-06-26 19:40:02 +0900 (Thu, 26 Jun 2014)

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

  Message:
    Add method to get dead nodes

  Modified files:
    lib/droonga/engine_state.rb

  Modified: lib/droonga/engine_state.rb (+11 -1)
===================================================================
--- lib/droonga/engine_state.rb    2014-06-26 19:39:35 +0900 (ec12a44)
+++ lib/droonga/engine_state.rb    2014-06-26 19:40:02 +0900 (f4e8964)
@@ -33,7 +33,7 @@ module Droonga
     attr_reader :replier
     attr_accessor :on_finish
     attr_accessor :catalog
-    attr_accessor :live_nodes
+    attr_accessor :dead_nodes
     def initialize(loop, name, internal_name)
       @loop = loop
       @name = name
@@ -110,6 +110,16 @@ module Droonga
       @live_nodes || @catalog.all_nodes
     end
 
+    def live_nodes=(nodes)
+      @live_nodes = nodes
+      @dead_nodes = all_nodes - @live_nodes
+      @live_nodes
+    end
+
+    def dead_nodes
+      @dead_nodes || []
+    end
+
     private
     def log_tag
       "engine_state"
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index