[Groonga-commit] droonga/droonga-engine at 4efbfee [master] Calculate cluster id by catalog

Back to archive index

YUKI Hiroshi null+****@clear*****
Sun Nov 30 04:17:48 JST 2014


YUKI Hiroshi	2014-11-30 04:17:48 +0900 (Sun, 30 Nov 2014)

  New Revision: 4efbfee726220c69761df35502edbd7e694a514b
  https://github.com/droonga/droonga-engine/commit/4efbfee726220c69761df35502edbd7e694a514b

  Message:
    Calculate cluster id by catalog

  Modified files:
    lib/droonga/catalog/base.rb
    lib/droonga/serf.rb

  Modified: lib/droonga/catalog/base.rb (+6 -0)
===================================================================
--- lib/droonga/catalog/base.rb    2014-11-30 04:13:32 +0900 (a3fdc63)
+++ lib/droonga/catalog/base.rb    2014-11-30 04:17:48 +0900 (ebb7d18)
@@ -16,6 +16,7 @@
 require "digest/sha1"
 require "zlib"
 require "time"
+require "digest"
 require "droonga/error_messages"
 require "droonga/catalog/errors"
 
@@ -37,6 +38,11 @@ module Droonga
         datasets[name]
       end
 
+      def cluster_id
+        raw_id = all_nodes.sort.join(",")
+        Digest::SHA1.hexdigest(raw_id)
+      end
+
       private
       def migrate_database_location(current_db_path, device, name)
         return if current_db_path.exist?

  Modified: lib/droonga/serf.rb (+1 -2)
===================================================================
--- lib/droonga/serf.rb    2014-11-30 04:13:32 +0900 (944d446)
+++ lib/droonga/serf.rb    2014-11-30 04:17:48 +0900 (e34867a)
@@ -154,8 +154,7 @@ module Droonga
     def cluster_id
       loader = CatalogLoader.new(Path.catalog.to_s)
       catalog = loader.load
-      raw_id = catalog.all_nodes.sort.join(",")
-      Digest::SHA1.hexdigest(raw_id)
+      catalog.cluster_id
     end
 
     private
-------------- next part --------------
HTML����������������������������...
下載 



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