You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "KeDeng (Code Review)" <ge...@cloudera.org> on 2022/08/11 07:24:05 UTC
[kudu-CR] [tool] Add output format for tabele list cli tool.
KeDeng has uploaded this change for review. ( http://gerrit.cloudera.org:8080/18834
Change subject: [tool] Add output format for tabele list cli tool.
......................................................................
[tool] Add output format for tabele 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 --list_table_output=<table|json|json_compact> <table_name> <master_addresses> [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>]`
Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/tool.proto
M src/kudu/tools/tool_action_table.cc
M src/kudu/tools/tool_test_util.h
4 files changed, 270 insertions(+), 46 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/1
--
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: newchange
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 1
Gerrit-Owner: KeDeng <kd...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#20).
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 'pretty'. 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_format=<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, 304 insertions(+), 60 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/20
--
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: 20
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, 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 (#6).
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 --list_table_output=<table|json|json_compact> <table_name> <master_addresses> [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>]`
Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/tool.proto
M src/kudu/tools/tool_action.h
M src/kudu/tools/tool_action_table.cc
4 files changed, 304 insertions(+), 41 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/6
--
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: 6
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 14:
(7 comments)
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG@10
PS14, Line 10: table
pretty ?
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG@42
PS14, Line 42: :
What's the significance of having this in the field? Is it possible to get rid of this part in the JSON and JSON_COMPACT formats? (sorry: I didn't notice that in prior review rounds).
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@151
PS10, Line 151: "Leave empty to r
> This param works for all the output of 'kudu table list', not only the outp
Ah, indeed. Then maybe let's name this flag 'list_table_format' or 'list_table_output_format'? We do have '--ksck_format' and '--format' flags for other CLI tools already.
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@96
PS14, Line 96: ostream
nit: should this be 'ostringstream' instead?
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@159
PS14, Line 159: std::
nit: below the 'copy' algorithm is used without the 'std::' prefix; maybe add corresponding 'using ...' and get rid of other 'std::' prefixes below?
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@166
PS14, Line 166: std::
nit: if adding 'using std::ostringstream', the std:: prefix might be omitted
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@358
PS14, Line 358: auto mode = iequals(FLAGS_list_table_output, "json") ?
nit: since the validator for --list_table_output might be changed independently, does it make sense to add DCHECK(iequals(FLAGS_list_table_output, "json") || iequals(FLAGS_list_table_output, "json_compact")) here?
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 14
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Sat, 03 Sep 2022 05:16:32 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#17).
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 'pretty'. 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_format=<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",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "131aef39a8624ff5a6c47799e0556b52",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "dbaef222684040f5bec60e5cc36df7d6",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "f09ca0749c2641e988c02e8436e655d3",
"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","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"c4279b3929084c0697e2922d351ab369","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"b2603ff3eaad45dcb7f4906355183ba5","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"88c8e5bcd4f24ae2a8ac87a6ba9d9ec3","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, 299 insertions(+), 60 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/17
--
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: 17
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 8:
(4 comments)
http://gerrit.cloudera.org:8080/#/c/18834/7//COMMIT_MSG
Commit Message:
PS7:
> Can we have a sample run of the command in json format on a table with 2-3
Done
http://gerrit.cloudera.org:8080/#/c/18834/7//COMMIT_MSG@14
PS7, Line 14: `kudu table list <master_addresses> [-tables=<tables>] [-list_tablets] [-show_table_info] [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>] [-lis
> Order of the arguments in incorrect. Please refer below:
Done
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc@251
PS7, Line 251:
> You can use DataTable in tool_action_common.h
Done
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc@312
PS7, Line 312: table_info_pb->set_num_tablets
> This can probably be moved out of the if else blocks.
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 8
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Thu, 18 Aug 2022 12:06:13 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#9).
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, 333 insertions(+), 66 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/9
--
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: 9
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Yingchun Lai has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 9:
(7 comments)
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG@21
PS9, Line 21: 127.14.18.65:18773
nit: would it better to use the default port 7050 in example?
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG@56
PS9, Line 56: "partition_info": "",
Is the command same with 'table' format above except the `-list_table_output` parameter? why 'list_table_output' details is not shown here?
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG@61
PS9, Line 61: 127.24.68.66:32119
nit: would it better to use some thing like 'tserver1:7050' instead? And it'd better to keep consistency with other output in different format, only the format is variant, then reviewers/readers woule be easier to understand your intend.
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc@1694
PS9, Line 1694: ASSERT_NE
why use xxx_NE, would it better to check what it would be, but not what it would not be?
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc@1716
PS9, Line 1716: string ParamsToOutputFormat(const TableListFormat& param_type) {
: string output_format;
: switch (param_type) {
: case TableListFormat::TABLE:
: output_format = "table";
: break;
: case TableListFormat::JSON:
: output_format = "json";
: break;
: case TableListFormat::JSON_COMPACT:
: output_format = "json_compact";
: break;
: default:
: LOG(FATAL) << "unknown TableListFormat";
: }
:
: return output_format;
: }
Why not use ::testing::WithParamInterface<string> directly?
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc@1833
PS9, Line 1833: "\"name\": \"$0\""
How about use 'raw string literal' in C++11 to simplify the code?
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-tool-test.cc@4744
PS9, Line 4744: if (lines[i].find("kudu.table_") == string::npos) {
how about use MatchPattern in gutil/strings/util.h?
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 9
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Mon, 22 Aug 2022 03:26:43 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 10:
(8 comments)
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG@21
PS9, Line 21: ASH (key_hash0) PA
> nit: would it better to use the default port 7050 in example?
Done
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG@56
PS9, Line 56:
> Is the command same with 'table' format above except the `-list_table_outpu
Done
http://gerrit.cloudera.org:8080/#/c/18834/9//COMMIT_MSG@61
PS9, Line 61:
> nit: would it better to use some thing like 'tserver1:7050' instead? And it
Done
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc@1694
PS9, Line 1694:
> why use xxx_NE, would it better to check what it would be, but not what it
Done
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc@1716
PS9, Line 1716: return { "pretty", "json", "json_compact" };
: }
:
: class ListTableCliSimpleParamTest :
: public AdminCliTest,
: public ::testing::WithParamInterface<string> {
: };
:
: INSTANTIATE_TEST_SUITE_P(, ListTableCliSimpleParamTest,
: ::testing::ValuesIn(TableListFormat()));
:
: TEST_P(ListTableCliSimpleParamTest, TestListTables) {
: FLAGS_num_tablet_servers = 1;
: FLAGS_num_replicas = 1;
:
: NO_FATALS(BuildAndStart());
:
:
> Why not use ::testing::WithParamInterface<string> directly?
Done
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-admin-test.cc@1833
PS9, Line 1833:
> How about use 'raw string literal' in C++11 to simplify the code?
We need to embeds the string with specified string. The 'raw string literal'is not convient to use here.
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/9/src/kudu/tools/kudu-tool-test.cc@4744
PS9, Line 4744: }
> how about use MatchPattern in gutil/strings/util.h?
Done
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc@251
PS7, Line 251:
> I meant we can use DataTable to unify the output of table/json/json_compact
The reason for adding the format param is to facilitate the collection of JSON format data. I tried the DataTable, but it didn't work well. So I finally chose the compatible output format.
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 10
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Tue, 23 Aug 2022 09:43:45 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 7:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/18834/7//COMMIT_MSG
Commit Message:
PS7:
Can we have a sample run of the command in json format on a table with 2-3 tablets?
http://gerrit.cloudera.org:8080/#/c/18834/7//COMMIT_MSG@14
PS7, Line 14: `kudu table list --list_table_output=<table|json|json_compact> <table_name> <master_addresses> [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>]`
Order of the arguments in incorrect. Please refer below:
https://kudu.apache.org/docs/command_line_tools_reference.html#table-list
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc@312
PS7, Line 312: table_info_pb->set_name(tname)
This can probably be moved out of the if else blocks.
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 7
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 18 Aug 2022 02:39:41 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for tabele list cli tool.
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for tabele list cli tool.
......................................................................
Patch Set 1:
(8 comments)
Thank you for the patch!
http://gerrit.cloudera.org:8080/#/c/18834/1//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/1//COMMIT_MSG@7
PS1, Line 7: tabele list
'table list'
http://gerrit.cloudera.org:8080/#/c/18834/1//COMMIT_MSG@7
PS1, Line 7: cli
CLI
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/kudu-admin-test.cc@1802
PS1, Line 1802: ASSERT_TRUE(false);
Maybe, use FAIL() instead? Also, print out the information why test fails in such case, something like
FAIL() << "unexpected table list format" << static_cast<uint16_t>(GetParam());
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool.proto
File src/kudu/tools/tool.proto:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool.proto@517
PS1, Line 517: required
Change this into 'optional': we hope to migrate to protobuf3 at some point
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc@262
PS1, Line 262: "table"
Does it make sense to introduce constants for these output types?
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc@272
PS1, Line 272: } else {
: if (FLAGS_list_table_output == "table") {
: cout << tname << endl;
: } else {
: table_info_pb->set_name(tname);
: }
: }
Instead of outputting for the 'table' format here, maybe just accumulate the information into the TablesInfoPB structure here as well and also introduce a function that prints out TablesInfoPB structure. Then use that function in one place, somewhere around line 328 -- 330 where JSON-based data is printed out as well?
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc@329
PS1, Line 329: iequals(FLAGS_list_table_output, "json")
If comparing in a case-insensitive way for the output type here, do the same in every other place (like validation of the input for the flags, etc.).
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_test_util.h
File src/kudu/tools/tool_test_util.h:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_test_util.h@36
PS1, Line 36: enum class TableListFormat {
: table,
: json,
: json_compact,
: };
I'm not sure that's the best place for this definition. Maybe, add that into the tool_action.h file instead?
Also, per code style guide, capital letters should be used for enumerator tags.
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 1
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 12 Aug 2022 01:58:53 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 8: Code-Review+1
(3 comments)
Overall looks good to me, just a few nits.
http://gerrit.cloudera.org:8080/#/c/18834/8/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/8/src/kudu/tools/kudu-tool-test.cc@3287
PS8, Line 3287: lines[2]
Please add an ASSERT on the size of the 'lines' array (to be at least of size 3, so accessing lines[2] isn't to lead to anything unexpected)
http://gerrit.cloudera.org:8080/#/c/18834/8/src/kudu/tools/kudu-tool-test.cc@3287
PS8, Line 3287: string auto_table_name = lines[2].erase(0,lines[2].find_first_not_of(' '));
nit: add a space after comma
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc@262
PS1, Line 262: replica
> We do need to format the output in actual use. In order not to break our us
Yes, you are right: if doing that, it's better to do it in a separate patch to change that for all the tools. That's a good point.
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 8
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Sat, 20 Aug 2022 17:06:39 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 4:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/18834/4/src/kudu/tools/tool_action.h
File src/kudu/tools/tool_action.h:
http://gerrit.cloudera.org:8080/#/c/18834/4/src/kudu/tools/tool_action.h@34
PS4, Line 34: Table,
: Json,
: Json_compact,
Should be in capital letters.
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 4
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 16 Aug 2022 03:36:31 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 19:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG@42
PS14, Line 42:
> Well, my comment was about the " : " string in the JSON output. Is it poss
Sorry to misunderstand you and I have removed the ":" for JSON output format.
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@358
PS14, Line 358: auto mode = iequals(FLAGS_list_table_output_format, "json") ?
> Yep, I know what the pretty-printed JSON output is.
Done
http://gerrit.cloudera.org:8080/#/c/18834/19/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/19/src/kudu/tools/tool_action_table.cc@336
PS19, Line 336: " : "
> My comment on the commit message in PS14 was about adding this " : " string
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 19
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Wed, 07 Sep 2022 02:42:19 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 10:
(18 comments)
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@9
PS10, Line 9: table
> pretty ?
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@10
PS10, Line 10: Default
> nit: default
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@10
PS10, Line 10: Default
> nit: default
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@11
PS10, Line 11: convenient
> nit: conveniently
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@11
PS10, Line 11: more convenient
> nit: more convenient for automatic processing
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@11
PS10, Line 11: the scenario of large-scale cluster
> int: in case of large-scale clusters
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@14
PS10, Line 14: prety
> nit: pretty
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@16
PS10, Line 16: prety
> pretty
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@16
PS10, Line 16: prety
> nit: pretty
Done
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@52
PS10, Line 52: "num_tablets": 12,
> nit: maybe, create a table with less tablets to have more compact example i
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@151
PS10, Line 151: list_table_output
> That's about the output format for tablets, right? Maybe, let's then name
This param works for all the output of 'kudu table list', not only the output for the tablets.
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@155
PS10, Line 155: bool ValidateListTableOutput() {
: if (!iequals(FLAGS_list_table_output, "pretty") && !iequals(FLAGS_list_table_output, "json")
: && !iequals(FLAGS_list_table_output, "json_compact")) {
: LOG(ERROR) << Substitute("--list_table_output should be one of 'json', 'json_compact'"
: " or 'pretty'.");
: return false;
: }
: return true;
: }
:
: GROUP_FLAG_VALIDATOR(list_table_output, ValidateListTableOutput);
> Since this validator involves only a single flag, you don't need to have GR
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@256
PS10, Line 256: if (!table_info.has_name()) {
: continue;
: }
> When is it possible to have no name/id for a table? Would be great to add
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@260
PS10, Line 260: need_linefeed
> nit: is it possible to rely on !output.empty() instead?
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@261
PS10, Line 261: string(
> nit: I guess it's possible to drop conversion to string and rely on std::st
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@265
PS10, Line 265: output += string(" num_tablets:") + std::to_string(table_info.num_tablets()) +
: string(" num_replicas:") + std::to_string(table_info.num_replicas()) +
: string(" live_row_count:") + std::to_string(table_info.live_row_count());
> Instead, is it possible to use strings::Substitute() to build the string to
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@271
PS10, Line 271: if (!tablet_info.has_tablet_id()) {
: continue;
: }
> When is it possible to have a situation when no identifier for a tablet is
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@283
PS10, Line 283: output += string("\n") +
: string(" ") + replica_info.role() +
: string(" ") + replica_info.uuid() +
: string(" ") + replica_info.host_port();
> Instead, is it possible to use strings::Substitute() to build the string to
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 10
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Fri, 26 Aug 2022 03:22:53 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#15).
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 'pretty'. 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_format=<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",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "131aef39a8624ff5a6c47799e0556b52",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "dbaef222684040f5bec60e5cc36df7d6",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "f09ca0749c2641e988c02e8436e655d3",
"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","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"c4279b3929084c0697e2922d351ab369","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"b2603ff3eaad45dcb7f4906355183ba5","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"88c8e5bcd4f24ae2a8ac87a6ba9d9ec3","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, 303 insertions(+), 60 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/15
--
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: 15
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 15:
(7 comments)
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG@10
PS14, Line 10: prett
> pretty ?
Done
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG@42
PS14, Line 42:
> What's the significance of having this in the field? Is it possible to get
Done
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@151
PS10, Line 151: new_table_name, "
> Ah, indeed. Then maybe let's name this flag 'list_table_format' or 'list_t
Done
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@96
PS14, Line 96: map;
> nit: should this be 'ostringstream' instead?
Done
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@159
PS14, Line 159:
> nit: below the 'copy' algorithm is used without the 'std::' prefix; maybe a
Done
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@166
PS14, Line 166: }
> nit: if adding 'using std::ostringstream', the std:: prefix might be omitte
Done
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@358
PS14, Line 358:
> nit: since the validator for --list_table_output might be changed independe
The 'pretty' values of the FLAGS_list_table_output_format means the normal output. The 'JsonWriter::Mode::PRETTY' of the mode means the output format fo the JsonWriter, that is the 'json' value of the FLAGS_list_table_output_format.
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 15
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Mon, 05 Sep 2022 02:31:00 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 2:
(8 comments)
http://gerrit.cloudera.org:8080/#/c/18834/1//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/1//COMMIT_MSG@7
PS1, Line 7: CL
> CLI
Done
http://gerrit.cloudera.org:8080/#/c/18834/1//COMMIT_MSG@7
PS1, Line 7: 'table list
> 'table list'
Done
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/kudu-admin-test.cc@1802
PS1, Line 1802: FAIL() << "unexpect
> Maybe, use FAIL() instead? Also, print out the information why test fails
Done
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool.proto
File src/kudu/tools/tool.proto:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool.proto@517
PS1, Line 517: optional
> Change this into 'optional': we hope to migrate to protobuf3 at some point
Done
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc@262
PS1, Line 262:
> Does it make sense to introduce constants for these output types?
We do need to format the output in actual use. In order not to break our usage habits, constant distinction is introduced. Do you have a better idea?
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc@272
PS1, Line 272:
: }
: output += string("\n");
: }
: return output;
: }
:
> Instead of outputting for the 'table' format here, maybe just accumulate th
Done
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_action_table.cc@329
PS1, Line 329: ol is_voter = ReplicaController::is_vote
> If comparing in a case-insensitive way for the output type here, do the sam
Done
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_test_util.h
File src/kudu/tools/tool_test_util.h:
http://gerrit.cloudera.org:8080/#/c/18834/1/src/kudu/tools/tool_test_util.h@36
PS1, Line 36: // Get full path to the top-level 'kudu' tool binary.
: std::string GetKuduToolAbsolutePath();
:
: // Runs the 'kudu' tool binary with the given arguments.
: //
> I'm not sure that's the best place for this definition. Maybe, add that in
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 2
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 12 Aug 2022 07:50:55 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/18834
to look at the new patch set (#2).
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 --list_table_output=<table|json|json_compact> <table_name> <master_addresses> [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>]`
Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/tool.proto
M src/kudu/tools/tool_action.h
M src/kudu/tools/tool_action_table.cc
4 files changed, 284 insertions(+), 46 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/2
--
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: 2
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 5:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/18834/4/src/kudu/tools/tool_action.h
File src/kudu/tools/tool_action.h:
http://gerrit.cloudera.org:8080/#/c/18834/4/src/kudu/tools/tool_action.h@34
PS4, Line 34: TABLE,
: JSON,
: JSON_COMPACT,
> Should be in capital letters.
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 5
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Tue, 16 Aug 2022 08:44:06 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 8: Code-Review+1
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 8
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Thu, 18 Aug 2022 17:27:55 +0000
Gerrit-HasComments: No
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Yingchun Lai has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 15:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/18834/15/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/15/src/kudu/tools/tool_action_table.cc@168
PS15, Line 168: ostringstream ss;
nit: how about use Substitute?
http://gerrit.cloudera.org:8080/#/c/18834/15/src/kudu/tools/tool_action_table.cc@171
PS15, Line 171: copy(allowed_values.begin(), allowed_values.end(),
: ostream_iterator<string>(ss, " "));
nit: how abour use JoinStrings?
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 15
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Mon, 05 Sep 2022 16:46:18 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#18).
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 'pretty'. 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_format=<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",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "131aef39a8624ff5a6c47799e0556b52",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "dbaef222684040f5bec60e5cc36df7d6",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "f09ca0749c2641e988c02e8436e655d3",
"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","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"c4279b3929084c0697e2922d351ab369","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"b2603ff3eaad45dcb7f4906355183ba5","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"88c8e5bcd4f24ae2a8ac87a6ba9d9ec3","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, 299 insertions(+), 60 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/18
--
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: 18
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 8:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/18834/8/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/8/src/kudu/tools/kudu-tool-test.cc@3287
PS8, Line 3287: lines[2]
> Please add an ASSERT on the size of the 'lines' array (to be at least of si
Done
http://gerrit.cloudera.org:8080/#/c/18834/8/src/kudu/tools/kudu-tool-test.cc@3287
PS8, Line 3287: string auto_table_name = lines[2].erase(0,lines[2].find_first_not_of(' '));
> nit: add a space after comma
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 8
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Mon, 22 Aug 2022 02:03:44 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 21: Code-Review+2
(1 comment)
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG@42
PS14, Line 42: HAS
> Sorry to misunderstand you and I have removed the ":" for JSON output forma
Ah, no problem. Thank you for addressing that!
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 21
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Wed, 07 Sep 2022 20:06:00 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 15:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/18834/15/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/15/src/kudu/tools/tool_action_table.cc@168
PS15, Line 168: ostringstream ss;
> nit: how about use Substitute?
Done
http://gerrit.cloudera.org:8080/#/c/18834/15/src/kudu/tools/tool_action_table.cc@171
PS15, Line 171: copy(allowed_values.begin(), allowed_values.end(),
: ostream_iterator<string>(ss, " "));
> nit: how abour use JoinStrings?
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 15
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Tue, 06 Sep 2022 02:05:59 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/18834
to look at the new patch set (#4).
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 --list_table_output=<table|json|json_compact> <table_name> <master_addresses> [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>]`
Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/tool.proto
M src/kudu/tools/tool_action.h
M src/kudu/tools/tool_action_table.cc
4 files changed, 304 insertions(+), 41 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/4
--
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: 4
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#10).
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=<prety|json|json_compact>]`
The 'prety' format output looks like:
`
TestTableListPartition num_tablets:12 num_replicas:1 live_row_count:0
T a941da9950f74b35b4d1d2bf490e3d9d : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 39ea0bffe8864518852ea9b5699e11be : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 59c615a9b1d5441fba715efa7c92e530 : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 14d89452b77d462aa43f9efc51c1ce83 : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 6ea9a7d031354bb2961d176dc4649379 : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 8199da4da8264911845b134fb6d6d170 : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 26996750c1044ae3a405d0e20d6227e1 : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 1db63f06266049648877a0de23275fc4 : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T ad1691845e844fd8b8d9081602cce643 : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 82ced842a6a74151857f87b57433dbe8 : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 7aa34bf0dc5e4458ac2384f57b9f914d : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
T 45335a6dd8674f6fa8ac771704d44d3f : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3
L 89829fad2ddc43efa8999e6903e42271 tserver1:7050
`
The 'json' format output looks like:
`
{
"tables": [
{
"name": "TestTableListPartition",
"num_tablets": 12,
"num_replicas": 1,
"live_row_count": 0,
"tablet_with_partition": [
{
"tablet_id": "25581379a065423596ea9d6656cdeb83",
"partition_info": " : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "71adb2ea39a040dc829968fc66e3d4f8",
"partition_info": " : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "86286352c6a44a6d94a1ab746407500d",
"partition_info": " : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "4fb6626496c747c3ad969dc866fff868",
"partition_info": " : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "aad40e3c4c474f33a0658bb5a274b685",
"partition_info": " : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "97a80eaabb2a4a1dafc24750b5347e46",
"partition_info": " : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "0b25ee7b0bd54e10936e471f076bf825",
"partition_info": " : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "11b6a694085d42b08c939a71d26ffcba",
"partition_info": " : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "dc465381046f4a5786ec22a1286f4201",
"partition_info": " : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "7a5fb2f478824749a94c4b98a4c2ae6b",
"partition_info": " : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "3b9fa9e5f970426ea86e98a9e7146af0",
"partition_info": " : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "64ff09cf015a469787e4dc127f3b0fc0",
"partition_info": " : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3",
"replica_info": [
{
"role": "L",
"uuid": "876e52a7a8c7415ba81930c113c93fc9",
"host_port": "tserver1:7050"
}
]
}
]
}
]
}
`
The 'json_compact' format output looks like:
`
{"tables":[{"name":"TestTableListPartition","num_tablets":12,"num_replicas":1,"live_row_count":0,"tablet_with_partition":[{"tablet_id":"333a651d12cd45259f12fd23d640d9e8","partition_info":" : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"ec10ffa3464e4df7bd13ed48d66000c9","partition_info":" : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"8261b5e1b94042e891c712ecd3844627","partition_info":" : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"cc1d2573167f4902b4426738075e08dc","partition_info":" : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"8c91039a01084871ae798f3b70940bbb","partition_info":" : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"0b4e05ac779f49419a4a36fdd49478ba","partition_info":" : HASH (key_hash0) PARTITION 0, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"cbbe285e387f4600b2a5bf2f0ee70917","partition_info":" : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 0 <= VALUES < 1","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"7f95631a4ea24d50807cb03aabb17537","partition_info":" : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 0, RANGE (key_range) PARTITION 2 <= VALUES < 3","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"2655b50d212f42408f00483b82050317","partition_info":" : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 0 <= VALUES < 1","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"f45beed89a634c4080ed902fff662e51","partition_info":" : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 1, RANGE (key_range) PARTITION 2 <= VALUES < 3","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"7d817427e48e4f43aa4af4bba47097b6","partition_info":" : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 0 <= VALUES < 1","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","host_port":"tserver1:7050"}]},{"tablet_id":"7154e20794ee436baa3ad5447ce3e73b","partition_info":" : HASH (key_hash0) PARTITION 1, HASH (key_hash1, key_hash2) PARTITION 2, RANGE (key_range) PARTITION 2 <= VALUES < 3","replica_info":[{"role":"L","uuid":"42f21ac1171c4d8b91021a9985006470","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, 301 insertions(+), 61 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/10
--
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: 10
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 7:
(15 comments)
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@9
PS10, Line 9: table
pretty ?
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@10
PS10, Line 10: Default
nit: default
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@11
PS10, Line 11: more convenient
nit: more convenient for automatic processing
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@11
PS10, Line 11: the scenario of large-scale cluster
int: in case of large-scale clusters
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@16
PS10, Line 16: e-Id:
pretty
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@52
PS10, Line 52:
nit: maybe, create a table with less tablets to have more compact example in the commit description -- it might be something like 4 tablets: 2 ranges each hash-partitioned into 2 buckets
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc@251
PS7, Line 251: static string ToTableFormat(const TablesInfoPB& tables_info) {
> The reason for adding the format param is to facilitate the collection of J
I guess DataTable might help, but it requires figuring out some pre-defined structure for each line of the output, IIRC. With the list of tablet replicas it's a bit different -- rows for tablets and replicas have different structure.
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@151
PS10, Line 151: "One of 'json', '
That's about the output format for tablets, right? Maybe, let's then name this '--list_tablets_format', especially given that the output for tablets is toggled on/off by the '--list_tablets' flag?
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@155
PS10, Line 155: if (!iequals(FLAGS_list_table_output, "table") && !iequals(FLAGS_list_table_output, "json")
: && !iequals(FLAGS_list_table_output, "json_compact")) {
: LOG(ERROR) << Substitute("--list_table_output should be one of 'json', 'json_compact'"
: " or 'table'.");
: return false;
: }
: return true;
: }
:
: GROUP_FLAG_VALIDATOR(list_table_output, ValidateListTableOutput);
:
Since this validator involves only a single flag, you don't need to have GROUP_FLAG_VALIDATOR() here, just define standard google flag validator using the DEFINE_validator() macro. You could find examples in tool_action_cluster.cc and other files under the 'tools' sub-directory.
Or the idea was to check the setting for the --list_tablets flag along with the format?
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@256
PS10, Line 256: continue;
: }
: i
When is it possible to have no name/id for a table? Would be great to add a comment to explain.
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@260
PS10, Line 260:
nit: is it possible to rely on !output.empty() instead?
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@261
PS10, Line 261: ble_inf
nit: I guess it's possible to drop conversion to string and rely on std::string's operators?
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@265
PS10, Line 265: string(" live_row_count:") + std::to_string(table_info.live_row_count());
: }
:
Instead, is it possible to use strings::Substitute() to build the string to append to 'output'?
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@271
PS10, Line 271: }
: output += string("\n") + string(" T ") + tablet_info.tablet_id();
: i
When is it possible to have a situation when no identifier for a tablet is present? It would be great to add a comment to clarify.
http://gerrit.cloudera.org:8080/#/c/18834/10/src/kudu/tools/tool_action_table.cc@283
PS10, Line 283: string(" ") + replica_info.uuid() +
: string(" ") + replica_info.host_port();
: }
:
Instead, is it possible to use strings::Substitute() to build the string to append to 'output'?
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 7
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Fri, 26 Aug 2022 00:09:04 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Yingchun Lai has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 11:
(5 comments)
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc@1715
PS11, Line 1715: std::vector<std::string>
nit: "std::" can be omitted.
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc@2272
PS11, Line 2272: auto show_tp = std::get<0>(GetParam()) ? PartitionSchema::HashPartitionInfo::SHOW :
: PartitionSchema::HashPartitionInfo::HIDE;
: auto show_hp = std::get<1>(GetParam()) ? PartitionSchema::HashPartitionInfo::SHOW :
: PartitionSchema::HashPartitionInfo::HIDE;
show_tp and show_hp are bool type.
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc@2349
PS11, Line 2349: Substitute("--show_tablet_partition_info=$0", std::get<0>(GetParam())),
: Substitute("--show_hash_partition_info=$0", std::get<1>(GetParam())),
nit: I think the former style is more simple, why change it ?
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-tool-test.cc@4745
PS11, Line 4745: lines[i].erase(0,lines[i].find_first_not_of(' '));
nit: 'lines[i].erase(0, lines[i].find_first_not_of(' '));'
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/tool_action_table.cc@273
PS11, Line 273: std::to_string(table_info.num_tablets()),
: std::to_string(table_info.num_replicas()),
: std::to_string(table_info.live_row_count())
nit: no need to use `std::to_string`, Substitute will deal with it correctlly?
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 11
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Sat, 27 Aug 2022 08:44:51 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
KeDeng has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 12:
(5 comments)
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc@1715
PS11, Line 1715: vector<string> TableList
> nit: "std::" can be omitted.
Done
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc@2272
PS11, Line 2272: const auto show_tp = std::get<0>(GetParam()) ? PartitionSchema::HashPartitionInfo::SHOW :
: PartitionSchema::HashPartitionInfo::HIDE;
: const auto show_hp = std::get<1>(GetParam()) ? PartitionSchema::HashPartitionInfo::SHOW :
: PartitionSchema::HashPartitionInfo::HIDE;
> show_tp and show_hp are bool type.
Done
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-admin-test.cc@2349
PS11, Line 2349: Substitute("--show_tablet_partition_info=$0", std::get<0>(GetParam())),
: Substitute("--show_hash_partition_info=$0", std::get<1>(GetParam())),
> nit: I think the former style is more simple, why change it ?
You mean '--show_tablet_partition_info', right?
The reason I add 'Substitute' is to fit the 'GetParam()' that make testing easier.
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-tool-test.cc
File src/kudu/tools/kudu-tool-test.cc:
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/kudu-tool-test.cc@4745
PS11, Line 4745: lines[i].erase(0, lines[i].find_first_not_of(' '));
> nit: 'lines[i].erase(0, lines[i].find_first_not_of(' '));'
Done
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/11/src/kudu/tools/tool_action_table.cc@273
PS11, Line 273: table_info.num_tablets(),
: table_info.num_replicas(),
: table_info.live_row_count());
> nit: no need to use `std::to_string`, Substitute will deal with it correctl
Done
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 12
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Mon, 29 Aug 2022 02:53:35 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, 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 (#5).
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 --list_table_output=<table|json|json_compact> <table_name> <master_addresses> [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>]`
Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/tool.proto
M src/kudu/tools/tool_action.h
M src/kudu/tools/tool_action_table.cc
4 files changed, 304 insertions(+), 41 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/5
--
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: 5
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#13).
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/13
--
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: 13
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#14).
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/14
--
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: 14
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Mahesh Reddy has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 10:
(4 comments)
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@10
PS10, Line 10: Default
nit: default
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@11
PS10, Line 11: convenient
nit: conveniently
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@14
PS10, Line 14: prety
nit: pretty
http://gerrit.cloudera.org:8080/#/c/18834/10//COMMIT_MSG@16
PS10, Line 16: prety
nit: pretty
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 10
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Thu, 25 Aug 2022 22:43:34 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#11).
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, 302 insertions(+), 61 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/11
--
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: 11
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, 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 (#7).
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 --list_table_output=<table|json|json_compact> <table_name> <master_addresses> [-negotiation_timeout_ms=<ms>] [-timeout_ms=<ms>]`
Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/tool.proto
M src/kudu/tools/tool_action.h
M src/kudu/tools/tool_action_table.cc
4 files changed, 304 insertions(+), 41 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/7
--
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: 7
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Yingchun Lai has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 7:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc@251
PS7, Line 251: static string ToTableFormat(const TablesInfoPB& tables_info) {
You can use DataTable in tool_action_common.h
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 7
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Thu, 18 Aug 2022 02:59:41 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Yingchun Lai (Code Review)" <ge...@cloudera.org>.
Yingchun Lai has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 9:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/7/src/kudu/tools/tool_action_table.cc@251
PS7, Line 251:
> Done
I meant we can use DataTable to unify the output of table/json/json_compact, and not need another gflag '--list_table_output', of course the default 'table' format output will be different with before, but I thinkl it's acceptable.
@Alexey, how do you think about it?
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 9
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Mon, 22 Aug 2022 03:34:29 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#16).
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 'pretty'. 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_format=<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",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "131aef39a8624ff5a6c47799e0556b52",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "dbaef222684040f5bec60e5cc36df7d6",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "f09ca0749c2641e988c02e8436e655d3",
"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","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"c4279b3929084c0697e2922d351ab369","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"b2603ff3eaad45dcb7f4906355183ba5","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"88c8e5bcd4f24ae2a8ac87a6ba9d9ec3","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, 300 insertions(+), 60 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/16
--
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: 16
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "KeDeng (Code Review)" <ge...@cloudera.org>.
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 (#19).
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 'pretty'. 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_format=<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",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "131aef39a8624ff5a6c47799e0556b52",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "dbaef222684040f5bec60e5cc36df7d6",
"replica_info": [
{
"role": "L",
"uuid": "f103342fc91245b18f098d34b4f422ac",
"host_port": "tserver1:7050"
}
]
},
{
"tablet_id": "f09ca0749c2641e988c02e8436e655d3",
"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","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"c4279b3929084c0697e2922d351ab369","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"b2603ff3eaad45dcb7f4906355183ba5","replica_info":[{"role":"L","uuid":"e714a8155d5649a98a30af3ec3a6f0e5","host_port":"tserver1:7050"}]},{"tablet_id":"88c8e5bcd4f24ae2a8ac87a6ba9d9ec3","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, 299 insertions(+), 60 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/34/18834/19
--
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: 19
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/18834 )
Change subject: [tool] Add output format for 'table list' CLI tool.
......................................................................
Patch Set 19:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/18834/14//COMMIT_MSG@42
PS14, Line 42:
> Done
Well, my comment was about the " : " string in the JSON output. Is it possible to get rid of this part in case of JSON output, but still keep the meaningful information of the 'partition_info' field for JSON output format?
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/14/src/kudu/tools/tool_action_table.cc@358
PS14, Line 358: auto mode = iequals(FLAGS_list_table_output_format, "json") ?
> The 'pretty' values of the FLAGS_list_table_output_format means the normal
Yep, I know what the pretty-printed JSON output is.
I meant adding the DCHECK() to spot an issue if in the future other format(s) added (e.g., CSV) and this piece of the code isn't updated: that's just to enforce the implicit assumptions in the code. If that isn't a concern at this point, that's fine.
http://gerrit.cloudera.org:8080/#/c/18834/19/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:
http://gerrit.cloudera.org:8080/#/c/18834/19/src/kudu/tools/tool_action_table.cc@336
PS19, Line 336: " : "
My comment on the commit message in PS14 was about adding this " : " string in the JSON output. Is it possible to get rid of this part in case of JSON output?
--
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: comment
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 19
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>
Gerrit-Comment-Date: Tue, 06 Sep 2022 19:17:00 +0000
Gerrit-HasComments: Yes
[kudu-CR] [tool] Add output format for 'table list' CLI tool.
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/18834 )
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 'pretty'. 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_format=<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
Reviewed-on: http://gerrit.cloudera.org:8080/18834
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <al...@apache.org>
---
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, 304 insertions(+), 60 deletions(-)
Approvals:
Kudu Jenkins: Verified
Alexey Serbin: Looks good to me, approved
--
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: merged
Gerrit-Change-Id: I3aaec73e18872fc93646e9c0ea675b578b0702f0
Gerrit-Change-Number: 18834
Gerrit-PatchSet: 22
Gerrit-Owner: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: KeDeng <kd...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Reviewer: Yingchun Lai <ac...@gmail.com>