Skip to content

Commit

Permalink
Rename "system.object-count" to "system.object.count".
Browse files Browse the repository at this point in the history
Because we possibly add more "system.object.*" commands.
  • Loading branch information
piroor committed Apr 22, 2015
1 parent 5c10bc9 commit dba647e
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/text/news.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* `dump` command: forwarded messages are now have their own `date` field.
* `Collectors::RecursiveSum` is introduced.
* `system.status` command: now the reporter node and its internal name is reported as a part of response body.
* `system.object-count` command is now available. It is used by command line utilities internally.
* `system.object.count` command is now available. It is used by command line utilities internally.
* `system.absorb-data` command is now available. It is used by command line utilities internally.
* Command line utilities:
* `droonga-engine-join` and `droonga-engine-absorb-data` commands work more surely.
Expand Down
2 changes: 1 addition & 1 deletion lib/droonga/plugins/system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ module System
end

require "droonga/plugins/system/status"
require "droonga/plugins/system/object_count"
require "droonga/plugins/system/object"
require "droonga/plugins/system/absorb_data"
2 changes: 1 addition & 1 deletion lib/droonga/plugins/system/absorb_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def on_finish

def count_total_n_objects(&block)
count_message = {
"type" => "system.object-count",
"type" => "system.object.count",
"dataset" => current_dataset,
"body" => {
"output" => ["total"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
module Droonga
module Plugins
module System
class ObjectCountHandler < Droonga::Handler
module Object
extend Plugin
register("system.object")

class CountHandler < Droonga::Handler
include DatabaseScanner

def handle(message)
Expand All @@ -44,10 +48,11 @@ def handle(message)
end

define_single_step do |step|
step.name = "system.object-count"
step.handler = ObjectCountHandler
step.name = "system.object.count"
step.handler = CountHandler
step.collector = Collectors::RecursiveSum
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"inReplyTo": "request-id",
"statusCode": 200,
"type": "system.object-count.result",
"type": "system.object.count.result",
"body": {
"tables": 0,
"columns": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "system.object-count",
"type": "system.object.count",
"dataset": "Default",
"body": {
"output": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"inReplyTo": "request-id",
"statusCode": 200,
"type": "system.object-count.result",
"type": "system.object.count.result",
"body": {
"tables": 2,
"columns": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
#@enable-logging
{
"type": "system.object-count",
"type": "system.object.count",
"dataset": "Default",
"body": {
"output": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"inReplyTo": "request-id",
"statusCode": 200,
"type": "system.object-count.result",
"type": "system.object.count.result",
"body": {
"tables": 2,
"columns": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#@require-catalog-version 2
{
"type": "system.object-count",
"type": "system.object.count",
"dataset": "Default",
"body": {
"output": [
Expand Down

0 comments on commit dba647e

Please sign in to comment.