[Groonga-commit] droonga/droonga-engine at 3c09b84 [master] Add "--verbose" option for Serf-based IPC commands

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Mar 24 16:04:11 JST 2015


YUKI Hiroshi	2015-03-24 16:04:11 +0900 (Tue, 24 Mar 2015)

  New Revision: 3c09b8469c3e55ec2c7aadbd19992de48dddc4ee
  https://github.com/droonga/droonga-engine/commit/3c09b8469c3e55ec2c7aadbd19992de48dddc4ee

  Message:
    Add "--verbose" option for Serf-based IPC commands

  Modified files:
    bin/droonga-engine-absorb-data
    bin/droonga-engine-join
    bin/droonga-engine-set-role
    bin/droonga-engine-unjoin

  Modified: bin/droonga-engine-absorb-data (+10 -1)
===================================================================
--- bin/droonga-engine-absorb-data    2015-03-24 16:03:49 +0900 (f015155)
+++ bin/droonga-engine-absorb-data    2015-03-24 16:04:11 +0900 (6a81e1d)
@@ -63,6 +63,7 @@ class AbsorbDataCommand
     options.remote  = true
     options.receiver_host = Socket.gethostname
     options.messages_per_second = Droonga::DataAbsorber::DEFAULT_MESSAGES_PER_SECOND
+    options.verbose = false
     parser = OptionParser.new
     parser.version = Droonga::Engine::VERSION
 
@@ -111,6 +112,14 @@ class AbsorbDataCommand
       options.messages_per_second = n
     end
 
+    parser.separator("")
+    parser.separator("Miscellaneous:")
+    parser.on("--[no-]verbose",
+              "Output details for internal operations.",
+              "(#{options.verbose})") do |verbose|
+      options.verbose = verbose
+    end
+
     parser.parse!(ARGV)
     @options = options
   end
@@ -133,7 +142,7 @@ class AbsorbDataCommand
   end
 
   def run_remote_command(target, command, options)
-    serf = Droonga::Serf.new(target)
+    serf = Droonga::Serf.new(target, :verbose => @options.verbose)
     serf.send_query(command, options)
   end
 

  Modified: bin/droonga-engine-join (+5 -1)
===================================================================
--- bin/droonga-engine-join    2015-03-24 16:03:49 +0900 (a856735)
+++ bin/droonga-engine-join    2015-03-24 16:04:11 +0900 (2684363)
@@ -83,6 +83,10 @@ class JoinCommand
                   "'#{Droonga::Client::RateLimiter::NO_LIMIT}' means no limit.",
                 :as => Integer,
                 :default => Droonga::DataAbsorber::DEFAULT_MESSAGES_PER_SECOND)
+
+      option.separator("Miscellaneous:")
+      option.on(:verbose, "Output details for internal operations.",
+                :default => false)
     end
     @options = options
   rescue Slop::MissingOptionError => error
@@ -124,7 +128,7 @@ class JoinCommand
   end
 
   def run_remote_command(target, command, options)
-    serf = Droonga::Serf.new(target)
+    serf = Droonga::Serf.new(target, :verbose => @options[:verbose])
     serf.send_query(command, options)
   end
 

  Modified: bin/droonga-engine-set-role (+5 -1)
===================================================================
--- bin/droonga-engine-set-role    2015-03-24 16:03:49 +0900 (6a92b68)
+++ bin/droonga-engine-set-role    2015-03-24 16:04:11 +0900 (30c0066)
@@ -55,6 +55,10 @@ class SetRoleCommand
       option.on(:tag=,
                 "Tag name of the soruce cluster to be connected.",
                 :default => Droonga::CatalogGenerator::DEFAULT_TAG)
+
+      option.separator("Miscellaneous:")
+      option.on(:verbose, "Output details for internal operations.",
+                :default => false)
     end
     @options = options
   rescue Slop::MissingOptionError => error
@@ -67,7 +71,7 @@ class SetRoleCommand
   end
 
   def run_remote_command(target, command, options)
-    serf = Droonga::Serf.new(target)
+    serf = Droonga::Serf.new(target, :verbose => @options[:verbose])
     serf.send_query(command, options)
   end
 

  Modified: bin/droonga-engine-unjoin (+5 -1)
===================================================================
--- bin/droonga-engine-unjoin    2015-03-24 16:03:49 +0900 (6ae7df2)
+++ bin/droonga-engine-unjoin    2015-03-24 16:04:11 +0900 (3520283)
@@ -59,6 +59,10 @@ class UnjoinCommand
       option.on(:tag=,
                 "Tag name of the soruce cluster to be connected.",
                 :default => Droonga::CatalogGenerator::DEFAULT_TAG)
+
+      option.separator("Miscellaneous:")
+      option.on(:verbose, "Output details for internal operations.",
+                :default => false)
     end
     @options = options
   rescue Slop::MissingOptionError => error
@@ -133,7 +137,7 @@ class UnjoinCommand
   end
 
   def run_remote_command(target, command, options)
-    serf = Droonga::Serf.new(target)
+    serf = Droonga::Serf.new(target, :verbose => @options[:verbose])
     serf.send_query(command, options)
   end
 
-------------- next part --------------
HTML����������������������������...
Download 



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