[Groonga-commit] droonga/droonga-engine at 71636a3 [buffered-forward] Return all nodes correctly from version1 catalog

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Jan 22 16:59:29 JST 2015


YUKI Hiroshi	2015-01-22 16:59:29 +0900 (Thu, 22 Jan 2015)

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

  Message:
    Return all nodes correctly from version1 catalog

  Modified files:
    lib/droonga/catalog/version1.rb

  Modified: lib/droonga/catalog/version1.rb (+13 -1)
===================================================================
--- lib/droonga/catalog/version1.rb    2015-01-16 20:29:38 +0900 (4b11909)
+++ lib/droonga/catalog/version1.rb    2015-01-22 16:59:29 +0900 (ee9d497)
@@ -439,7 +439,7 @@ module Droonga
         end
 
         def all_nodes
-          self["ring"].keys
+          @all_nodes ||= collect_all_nodes
         end
 
         def sliced?
@@ -449,6 +449,18 @@ module Droonga
           end
           return false
         end
+
+        private
+        def collect_all_nodes
+          nodes = []
+          self["ring"].each do |ring_key, part|
+            part["partitions"].collect do |partition|
+              partition =~ /\A([^:]+:[0-9]+\/[^\.]+)/
+              nodes << $1
+            end
+          end
+          nodes.sort.uniq
+        end
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
Download 



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