[Groonga-commit] droonga/droonga-engine at 53b4945 [master] Detect the emptyness of the destination node correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Apr 17 17:59:52 JST 2015


YUKI Hiroshi	2015-04-17 17:59:52 +0900 (Fri, 17 Apr 2015)

  New Revision: 53b4945a413a3243beb7bae4afe96d2fda6e72f9
  https://github.com/droonga/droonga-engine/commit/53b4945a413a3243beb7bae4afe96d2fda6e72f9

  Message:
    Detect the emptyness of the destination node correctly

  Modified files:
    lib/droonga/data_absorber_client.rb

  Modified: lib/droonga/data_absorber_client.rb (+8 -23)
===================================================================
--- lib/droonga/data_absorber_client.rb    2015-04-17 17:55:06 +0900 (02ee256)
+++ lib/droonga/data_absorber_client.rb    2015-04-17 17:59:52 +0900 (b869c97)
@@ -127,7 +127,7 @@ module Droonga
     end
 
     def empty_destination?
-      source_table_names.empty?
+      table_names_in_destination_node.empty?
     end
 
     private
@@ -158,32 +158,17 @@ module Droonga
       }.merge(@client_options)
     end
 
-    def create_destination_client
-      Droonga::Client.new(destination_client_options)
+    def create_destination_client(options={})
+      Droonga::Client.new(destination_client_options.merge(options))
     end
 
-    def source_client_options
-      {
-        :host          => @source_host,
-        :port          => @source_port,
-        :tag           => @source_tag,
-        :dataset       => @source_dataset,
-        :protocol      => :droonga,
-        :receiver_host => @receiver_host,
-        :receiver_port => @receiver_port,
-      }
-    end
-
-    def create_source_client
-      Droonga::Client.new(source_client_options)
-    end
-
-    def source_table_names
-      @source_table_names ||= get_source_table_names
+    def table_names_in_destination_node
+      @table_names_in_destination_node ||= get_table_names_in_destination_node
     end
 
-    def get_source_table_names
-      client = create_source_client
+    def get_table_names_in_destination_node
+      client = create_destination_client(:backend => :thread,
+                                         :loop => nil)
       response = client.request("dataset" => @source_dataset,
                                 "type"    => "table_list")
 
-------------- next part --------------
HTML����������������������������...
Download 



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