[Groonga-commit] long-long-float/droonga-engine at 0649f46 [master] Use Address for getting the default host, port and tag

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Aug 28 12:27:12 JST 2014


Kouhei Sutou	2014-08-28 12:27:12 +0900 (Thu, 28 Aug 2014)

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

  Merged 5be18f3: Merge branch 'master' of github.com:droonga/droonga-engine
  Merged 15fc80d: Merge branch 'master' of github.com:droonga/droonga-engine

  Message:
    Use Address for getting the default host, port and tag

  Modified files:
    lib/droonga/catalog_fetcher.rb
    lib/droonga/catalog_generator.rb
    lib/droonga/command/droonga_engine.rb

  Modified: lib/droonga/catalog_fetcher.rb (+5 -3)
===================================================================
--- lib/droonga/catalog_fetcher.rb    2014-08-28 12:20:27 +0900 (56d9f7f)
+++ lib/droonga/catalog_fetcher.rb    2014-08-28 12:27:12 +0900 (1909611)
@@ -13,9 +13,11 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-require "droonga/catalog_generator"
 require "droonga/client"
 
+require "droonga/address"
+require "droonga/catalog_generator"
+
 module Droonga
   class CatalogFetcher
     def initialize(client_options)
@@ -37,8 +39,8 @@ module Droonga
     def default_options
       {
         :host          => "127.0.0.1",
-        :port          => CatalogGenerator::DEFAULT_PORT,
-        :tag           => CatalogGenerator::DEFAULT_TAG,
+        :port          => Address::DEFAULT_PORT,
+        :tag           => Address::DEFAULT_TAG,
         :protocol      => :droonga,
         :timeout       => 1,
         :receiver_host => "127.0.0.1",

  Modified: lib/droonga/catalog_generator.rb (+4 -3)
===================================================================
--- lib/droonga/catalog_generator.rb    2014-08-28 12:20:27 +0900 (5533ae7)
+++ lib/droonga/catalog_generator.rb    2014-08-28 12:27:12 +0900 (f239d11)
@@ -15,17 +15,18 @@
 
 require "time"
 
+require "droonga/address"
 require "droonga/catalog/dataset"
 
 module Droonga
   class CatalogGenerator
     DEFAULT_DATASET = "Default"
-    DEFAULT_HOSTS = ["127.0.0.1"]
+    DEFAULT_HOSTS = [Address::DEFAULT_HOST]
     DEFAULT_N_WORKERS = 4
     DEFAULT_N_SLICES = 1
     DEFAULT_PLUGINS = ["groonga", "search", "crud", "dump", "system", "catalog"]
-    DEFAULT_PORT = 10031
-    DEFAULT_TAG = "droonga"
+    DEFAULT_PORT = Address::DEFAULT_PORT
+    DEFAULT_TAG = Address::DEFAULT_TAG
 
     attr_reader :datasets
 

  Modified: lib/droonga/command/droonga_engine.rb (+4 -6)
===================================================================
--- lib/droonga/command/droonga_engine.rb    2014-08-28 12:20:27 +0900 (6d9afaa)
+++ lib/droonga/command/droonga_engine.rb    2014-08-28 12:27:12 +0900 (9e8971c)
@@ -22,6 +22,7 @@ require "coolio"
 require "sigdump"
 
 require "droonga/path"
+require "droonga/address"
 require "droonga/serf"
 require "droonga/file_observer"
 require "droonga/process_supervisor"
@@ -108,15 +109,12 @@ module Droonga
       end
 
       class Configuration
-        DEFAULT_HOST = Socket.gethostname
-        DEFAULT_PORT = 10031
-
         attr_reader :host, :port, :tag, :log_file, :pid_file_path
         attr_reader :ready_notify_fd
         def initialize
-          @host = DEFAULT_HOST
-          @port = DEFAULT_PORT
-          @tag = "droonga"
+          @host = Address::DEFAULT_HOST
+          @port = Address::DEFAULT_PORT
+          @tag = Address::DEFAULT_TAG
           @log_file = nil
           @daemon = false
           @pid_file_path = nil
-------------- next part --------------
HTML����������������������������...
Télécharger 



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