Hello Mahesh Reddy, 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 (#12).
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 'pretty'.
The default format is 'table'. With this patch, we can get the table
info more convenient for automatic processing in case 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=<pretty|json|json_compact>]`
The 'pretty' format output looks like:
`
TestTableListPartition num_tablets:4 num_replicas:1 live_row_count:0
T 390c65375d13434393d7152690e80082 : HASH (key_hash0) PARTITION 0, RANGE
(key_range) PARTITION 0 <= VALUES < 1
L 7b12b3459e2943a981d22aa70b915637 tserver1:7050
T 7cff0635ec7446f883b6b2ed9c4bf7be : HASH (key_hash0) PARTITION 0, RANGE
(key_range) PARTITION 2 <= VALUES < 3
L 7b12b3459e2943a981d22aa70b915637 tserver1:7050
T 45c347f165a945bd9f54f60758bb8953 : HASH (key_hash0) PARTITION 1, RANGE
(key_range) PARTITION 0 <= VALUES < 1
L 7b12b3459e2943a981d22aa70b915637 tserver1:7050
T 3eed6166dcfa4e1d94e4c1ceb3f4f6eb : HASH (key_hash0) PARTITION 1, RANGE
(key_range) PARTITION 2 <= VALUES < 3
L 7b12b3459e2943a981d22aa70b915637 tserver1:7050
`
The 'json' format output looks like:
`
{
"tables": [
{
"name": "TestTableListPartition",
"num_tablets": 4,
"num_replicas": 1,
"live_row_count": 0,
"tablet_with_partition": [
{
"tablet_id": "9db571acf0ca42baac6a70664b787556",
"partition_info": " : HASH (key_hash0) PARTITION 0, RANGE
(key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "131aef39a8624ff5a6c47799e0556b52",
"partition_info": " : HASH (key_hash0) PARTITION 0, RANGE
(key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "dbaef222684040f5bec60e5cc36df7d6",
"partition_info": " : HASH (key_hash0) PARTITION 1, RANGE
(key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "f09ca0749c2641e988c02e8436e655d3",
"partition_info": " : HASH (key_hash0) PARTITION 1, RANGE
(key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
}
]
}
]
}
`
The 'json_compact' format output looks like:
`
{"tables":[{"name":"TestTableListPartition","num_tablets":4,"num_replicas":1,"live_row_count":0,"tablet_with_partition":[{"tablet_id":"5fc45322b2ec4cd0be050ea1814349e6","partition_info":"
: HASH (key_hash0) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES <
1","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"c4279b3929084c0697e2922d351ab369","partition_info":"
: HASH (key_hash0) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES <
3","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"b2603ff3eaad45dcb7f4906355183ba5","partition_info":"
: HASH (key_hash0) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES <
1","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"88c8e5bcd4f24ae2a8ac87a6ba9d9ec3","partition_info":"
: HASH (key_hash0) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES <
3","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]}]}]}
`
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_table.cc
4 files changed, 298 insertions(+), 58 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/12
--
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: 12
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: Mahesh Reddy <[email protected]>
Gerrit-Reviewer: Yingchun Lai <[email protected]>