Hello Alexey Serbin, Yingchun Lai, Kudu Jenkins, Abhishek Chennaka,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/18834

to look at the new patch set (#8).

Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................

[tool] Add output format for 'table list' CLI tool.

The output format could be one of 'json', 'json_compact' or 'table'.
The Default format is 'table'. With this patch, we can get the table
info more convenient in the scenario of large-scale cluster.

The command with 'list_table_output' looks like:
 `kudu table list <master_addresses> [-tables=<tables>] [-list_tablets] 
[-show_table_info] [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>] 
[-list_table_output=<table|json|json_compact>]`

The 'table' format output looks like:
`
-----------------------------------------------------------------------------------------------------------------------------------------------------------
 TestTable
   T 4b5f47e160a443d5b344a324d94429c3 : HASH (key_hash0) PARTITION 0, HASH 
(key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 6766b61302f9493faf48c253a68b531b : HASH (key_hash0) PARTITION 0, HASH 
(key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T cfb6f4fe77d243419bb1c81e2145336c : HASH (key_hash0) PARTITION 0, HASH 
(key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 3677ea555a214c749bd802a943aaa493 : HASH (key_hash0) PARTITION 0, HASH 
(key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 17aa7cfb921b46f98e13025cf452c4f1 : HASH (key_hash0) PARTITION 0, HASH 
(key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T b55c7a98491e461e9b0a800887988dd9 : HASH (key_hash0) PARTITION 0, HASH 
(key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 0c93cebb7bee49d1a44c522470805fc9 : HASH (key_hash0) PARTITION 1, HASH 
(key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T bc4cbc1165ea4c65b8c382cec8efcd0c : HASH (key_hash0) PARTITION 1, HASH 
(key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 6a46a99db27047928f6c485cb3c9de53 : HASH (key_hash0) PARTITION 1, HASH 
(key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 2c9ca395d43b426f8e4e129989acec69 : HASH (key_hash0) PARTITION 1, HASH 
(key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 2a2540dffaa64422a3bb92b7c793a592 : HASH (key_hash0) PARTITION 1, HASH 
(key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773
   T 42a86c905bb24686a2c130b013ab2bc5 : HASH (key_hash0) PARTITION 1, HASH 
(key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3
     L 61d02b992b4e4d318a410689d9614b98 127.14.18.65:18773

`

The 'json' format output looks like:
`
{
    "tables": [
        {
            "name": "TestTable",
            "tablet_with_partition": [
                {
                    "tablet_id": "518462c001684ca98d11c3caf186f7d2",
                    "partition_info": "",
                    "replica_info": [
                        {
                            "role": "L",
                            "uuid": "c1898f18c4dd436c8e900202398e4f9d",
                            "host_port": "127.24.68.66:32119"
                        },
                        {
                            "role": "V",
                            "uuid": "3ab8bab958064f58b90fa8d0b944d9af",
                            "host_port": "127.24.68.67:12399"
                        },
                        {
                            "role": "V",
                            "uuid": "48b8f017083449b89177208dd884d022",
                            "host_port": "127.24.68.65:10221"
                        }
                    ]
                }
            ]
        },
        {
            "name": "TestAnotherTable",
            "tablet_with_partition": [
                {
                    "tablet_id": "8b445163fc8e40f790068ea04c5b727f",
                    "partition_info": "",
                    "replica_info": [
                        {
                            "role": "V",
                            "uuid": "48b8f017083449b89177208dd884d022",
                            "host_port": "127.24.68.65:10221"
                        },
                        {
                            "role": "V",
                            "uuid": "c1898f18c4dd436c8e900202398e4f9d",
                            "host_port": "127.24.68.66:32119"
                        },
                        {
                            "role": "L",
                            "uuid": "3ab8bab958064f58b90fa8d0b944d9af",
                            "host_port": "127.24.68.67:12399"
                        }
                    ]
                }
            ]
        }
    ]
}
`

The 'json_compact' format output looks like:
`
{"tables":[{"name":"TestTable","tablet_with_partition":[{"tablet_id":"220cd30063694d8c9ea81fc66cd14616","partition_info":"","replica_info":[{"role":"V","uuid":"9f7bf435151549a395712d69249727dd","host_port":"127.25.50.66:14535"},{"role":"L","uuid":"eacdfc013a5645269b8cde3d20157d49","host_port":"127.25.50.67:29951"},{"role":"V","uuid":"c2b1bd35b29449bcb6f4ffed6b911866","host_port":"127.25.50.65:13147"}]}]},{"name":"TestAnotherTable","tablet_with_partition":[{"tablet_id":"1837431ea5b741f49f8b6be7e1b63099","partition_info":"","replica_info":[{"role":"V","uuid":"9f7bf435151549a395712d69249727dd","host_port":"127.25.50.66:14535"},{"role":"L","uuid":"c2b1bd35b29449bcb6f4ffed6b911866","host_port":"127.25.50.65:13147"},{"role":"V","uuid":"eacdfc013a5645269b8cde3d20157d49","host_port":"127.25.50.67:29951"}]}]}]}
`

Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool.proto
M src/kudu/tools/tool_action.h
M src/kudu/tools/tool_action_table.cc
5 files changed, 332 insertions(+), 66 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/8
--
To view, visit http://gerrit.cloudera.org:8080/18834
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 8
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <[email protected]>

Reply via email to