[Groonga-commit] groonga/groonga at 4a72a50 [master] sharding: don't check cover type in enumerator

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Feb 9 22:55:48 JST 2015


Kouhei Sutou	2015-02-09 22:55:48 +0900 (Mon, 09 Feb 2015)

  New Revision: 4a72a509f48f01d111899f392c63ff6bcecd7f99
  https://github.com/groonga/groonga/commit/4a72a509f48f01d111899f392c63ff6bcecd7f99

  Message:
    sharding: don't check cover type in enumerator

  Modified files:
    plugins/sharding/logical_count.rb
    plugins/sharding/logical_enumerator.rb

  Modified: plugins/sharding/logical_count.rb (+6 -3)
===================================================================
--- plugins/sharding/logical_count.rb    2015-02-09 22:55:11 +0900 (1d87260)
+++ plugins/sharding/logical_count.rb    2015-02-09 22:55:48 +0900 (ef993b4)
@@ -17,10 +17,10 @@ module Groonga
         filter = input[:filter]
 
         total = 0
-        enumerator.each do |table, shard_key, shard_range, cover_type|
+        enumerator.each do |table, shard_key, shard_range|
           total += count_n_records(table, filter,
                                    shard_key, shard_range,
-                                   enumerator.target_range, cover_type)
+                                   enumerator.target_range)
         end
         writer.write(total)
       end
@@ -28,7 +28,10 @@ module Groonga
       private
       def count_n_records(table, filter,
                           shard_key, shard_range,
-                          target_range, cover_type)
+                          target_range)
+        cover_type = target_range.cover_type(shard_range)
+        return 0 if cover_type == :none
+
         if cover_type == :all
           if filter.nil?
             return table.size

  Modified: plugins/sharding/logical_enumerator.rb (+1 -4)
===================================================================
--- plugins/sharding/logical_enumerator.rb    2015-02-09 22:55:11 +0900 (aa9a614)
+++ plugins/sharding/logical_enumerator.rb    2015-02-09 22:55:48 +0900 (bcb5ad4)
@@ -28,10 +28,7 @@ module Groonga
             raise InvalidArgument, message
           end
 
-          cover_type = @target_range.cover_type(shard_range)
-          next if cover_type == :none
-
-          yield(table, shard_key, shard_range, cover_type)
+          yield(table, shard_key, shard_range)
         end
       end
 
-------------- next part --------------
HTML����������������������������...
Download 



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