Attila Bukor has posted comments on this change. ( http://gerrit.cloudera.org:8080/15206 )
Change subject: KUDU-2972 Add Ranger client ...................................................................... Patch Set 9: (9 comments) http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client-test.cc File src/kudu/ranger/ranger_client-test.cc: http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client-test.cc@161 PS8, Line 161: ASSERT_EQ(2, columns.size()); > Use ContainsKey() from gutil/map-util.h Can't, it only works on collections that have a find method. Unfortunately vector doesn't have a find method, we need to pass the vectors begin & and pointers to std::find(). Changed it on the unordered_set above though. http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.h File src/kudu/ranger/ranger_client.h: http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.h@46 PS8, Line 46: virtual Status Start() WARN_UNUSED_RESULT; : > Should also mention that this returns an error if the table name doesn't co changed the behavior to not return errors in that case http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.h@70 PS8, Line 70: Status SendRequest(RangerRequestListPB* req, RangerResponseL > Could you add a TODO to make this a unique_ptr or a member variable when we Done http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.cc File src/kudu/ranger/ranger_client.cc: http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.cc@48 PS8, Line 48: > warning: pass by value and use std::move [modernize-pass-by-value] Done http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.cc@112 PS8, Line 112: string db; > warning: loop variable is copied but only used as const reference; consider Done http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.cc@153 PS8, Line 153: return Status::InvalidArgument("Empty set of tables"); > Should use const auto& here Done http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.cc@154 PS8, Line 154: > nit: prefer emplace_back() instead of push_back(), here and elsewhere. Done http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.cc@158 PS8, Line 158: req_list.set_user(user_name); > This means that if there are any tables at all that don't conform to the Ra good point, maybe it's better to just skip authorizing them, rewrote it. http://gerrit.cloudera.org:8080/#/c/15206/8/src/kudu/ranger/ranger_client.cc@171 PS8, Line 171: > We should probably validate that responses_size() == orig_table_names.size( good idea, do you have a preference which one it should be? -- To view, visit http://gerrit.cloudera.org:8080/15206 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2e1ec19ed3aeb4d82ad38fe1fb655f57021c1a4 Gerrit-Change-Number: 15206 Gerrit-PatchSet: 9 Gerrit-Owner: Attila Bukor <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Tue, 25 Feb 2020 17:44:40 +0000 Gerrit-HasComments: Yes
