You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Yao Xu (Code Review)" <ge...@cloudera.org> on 2019/06/14 13:22:17 UTC

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Yao Xu has uploaded this change for review. ( http://gerrit.cloudera.org:8080/13649


Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................

[tools] Add get/set extra-configs for CLI tools

Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_table.cc
3 files changed, 88 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/49/13649/1
-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 1
Gerrit-Owner: Yao Xu <oc...@gmail.com>

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Yao Xu (Code Review)" <ge...@cloudera.org>.
Yao Xu has posted comments on this change. ( http://gerrit.cloudera.org:8080/13649 )

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/13649/3/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:

http://gerrit.cloudera.org:8080/#/c/13649/3/src/kudu/tools/tool_action_table.cc@455
PS3, Line 455:     }
             :   } else {
             :     for (const auto& config_name : config_names) {
             :       const string* config_value = FindOrNull(table->extra_configs(), config_name);
             :       if (config_value) {
             :      
> Should we instead iterate over the extra configs and to an
 > unordered_set lookup? I think as written, if --config_names
 > contains duplicates, we'll print duplicates.
 > 
 > Might be worth a test too.

Thank you for pointing this out. I think it's better to use set here than unordered_set. This is because we expect the result to be alphabetical.



-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 4
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>
Gerrit-Comment-Date: Thu, 20 Jun 2019 03:47:29 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has removed a vote on this change.

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................


Removed -Verified by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 5
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/13649 )

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................

[tools] Add get/set extra-configs for CLI tools

Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Reviewed-on: http://gerrit.cloudera.org:8080/13649
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Tested-by: Kudu Jenkins
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_table.cc
3 files changed, 158 insertions(+), 0 deletions(-)

Approvals:
  Andrew Wong: Looks good to me, approved
  Kudu Jenkins: Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 6
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Yao Xu (Code Review)" <ge...@cloudera.org>.
Yao Xu has posted comments on this change. ( http://gerrit.cloudera.org:8080/13649 )

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................


Patch Set 3:

(5 comments)

Thanks for comments. I added some tests and changed the names of some variables. :)

http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:

http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/kudu-admin-test.cc@2259
PS2, Line 2259:   // Gets extra-configs when no extra config set.
              :   {
              :     string stdout, stderr;
              :     Status s = RunKuduTool({
              :       "table",
              :       "get_extra_configs",
              :       master_address,
              :       kTableId
              :     }, &stdout, &stderr);
              :     ASSERT_TRUE(s.ok()) << ToolRunInfo(s, stdout, stderr);
              :     ASSERT_EQ(stdout, " Configuration | Value\n"
              :                       "---------------+-------\n");
              :   }
              : 
              :   // Sets "kudu.table.history_max_age_sec" to 3600.
              :   {
              :     ASSERT_TOOL_OK(
              :       "table",
> Could you also test the behavior when:
Done


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:

http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@86
PS2, Line 86: config_names, "",
            :               "Comma-separated list of configurations to display. "
            :               "An empty value displays all conf
> nit: "tag" is a little vague since we don't use it anywhere currently. How 
Done


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@449
PS2, Line 449: Con
> nit: How about "Configuration" and "Value"?
Done


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@566
PS2, Line 566: value
> nit: lower case
Done


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@573
PS2, Line 573: 
> nit: We're not altering the table here. Perhaps:
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 3
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>
Gerrit-Comment-Date: Wed, 19 Jun 2019 08:14:56 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Yao Xu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Andrew Wong, 

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

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

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

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................

[tools] Add get/set extra-configs for CLI tools

Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_table.cc
3 files changed, 158 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/49/13649/4
-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 4
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/13649 )

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................


Patch Set 2:

(5 comments)

Overall looks good! A few nits and some testing suggestions.

http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/kudu-admin-test.cc
File src/kudu/tools/kudu-admin-test.cc:

http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/kudu-admin-test.cc@2259
PS2, Line 2259:   ASSERT_TOOL_OK(
              :     "table",
              :     "set_extra_config",
              :     master_address,
              :     kTableId,
              :     "kudu.table.history_max_age_sec",
              :     "3600"
              :   );
              : 
              :   string stdout, stderr;
              :   Status s = RunKuduTool({
              :     "table",
              :     "get_extra_configs",
              :     master_address,
              :     kTableId
              :   }, &stdout, &stderr);
              :   ASSERT_TRUE(s.ok()) << ToolRunInfo(s, stdout, stderr);
              :   ASSERT_STR_CONTAINS(stdout, "kudu.table.history_max_age_sec | 3600");
Could you also test the behavior when:
- no extra config is set
- when requesting a config that doesn't exist, e.g. "foobar"


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:

http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@86
PS2, Line 86: extra_config_tags, "",
            :               "Comma-separated list of tags used to restrict which extra-configs are returned. "
            :               "An empty value matches all tags"
nit: "tag" is a little vague since we don't use it anywhere currently. How about calling this 'config_names'?

and something along the lines of:

"Comma-separated list of configurations to display. An empty value displays all configs."


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@449
PS2, Line 449: key
nit: How about "Configuration" and "Value"?


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@566
PS2, Line 566: Value
nit: lower case


http://gerrit.cloudera.org:8080/#/c/13649/2/src/kudu/tools/tool_action_table.cc@573
PS2, Line 573: Name of the table to alter
nit: We're not altering the table here. Perhaps:

"Name of the table for which to get extra configurations."



-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 2
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 19 Jun 2019 03:35:51 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Yao Xu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Andrew Wong, 

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

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

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

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................

[tools] Add get/set extra-configs for CLI tools

Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_table.cc
3 files changed, 140 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/49/13649/3
-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 3
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Yao Xu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Andrew Wong, 

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

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

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

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................

[tools] Add get/set extra-configs for CLI tools

Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_table.cc
3 files changed, 158 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/49/13649/5
-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 5
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/13649 )

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................


Patch Set 3:

(1 comment)

Thanks for making the change! One more thing I missed last time.

http://gerrit.cloudera.org:8080/#/c/13649/3/src/kudu/tools/tool_action_table.cc
File src/kudu/tools/tool_action_table.cc:

http://gerrit.cloudera.org:8080/#/c/13649/3/src/kudu/tools/tool_action_table.cc@455
PS3, Line 455:     for (const auto& config_name : config_names) {
             :       const string* config_value = FindOrNull(table->extra_configs(), config_name);
             :       if (config_value) {
             :         data_table.AddRow({ config_name, *config_value });
             :       }
             :     }
Should we instead iterate over the extra configs and to an unordered_set lookup? I think as written, if --config_names contains duplicates, we'll print duplicates.

Might be worth a test too.



-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 3
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>
Gerrit-Comment-Date: Wed, 19 Jun 2019 17:06:31 +0000
Gerrit-HasComments: Yes

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/13649 )

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................


Patch Set 5: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 5
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yao Xu <oc...@gmail.com>
Gerrit-Comment-Date: Thu, 20 Jun 2019 07:22:32 +0000
Gerrit-HasComments: No

[kudu-CR] [tools] Add get/set extra-configs for CLI tools

Posted by "Yao Xu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, 

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

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

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

Change subject: [tools] Add get/set extra-configs for CLI tools
......................................................................

[tools] Add get/set extra-configs for CLI tools

Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
---
M src/kudu/tools/kudu-admin-test.cc
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_table.cc
3 files changed, 90 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/49/13649/2
-- 
To view, visit http://gerrit.cloudera.org:8080/13649
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I90c790bbfe41a59f621157ff6b3f11d2b8f916e7
Gerrit-Change-Number: 13649
Gerrit-PatchSet: 2
Gerrit-Owner: Yao Xu <oc...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)