Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23707 )

Change subject: KUDU-1457 [8/n] Parameterize tests with ip config
......................................................................


Patch Set 4: Code-Review+1

(8 comments)

Overall looks good to me, just a few nit.

Thank you for improving the IP-mode parameterized tests!

http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/server/webserver-test.cc
File src/kudu/server/webserver-test.cc:

http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/server/webserver-test.cc@108
PS4, Line 108:     mode_ = GetParam();
Is it possible to make 'mode_' a constant member field and move its 
initialization into the constructor's initializers list?


http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/server/webserver-test.cc@962
PS4, Line 962:  i.e., IPv4 wildcard
nit: remove this part since the value of FLAGS_webserver_interface might be 
customized, and nobody dares updating outdated comments when the default value 
changes (if ever).


http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/server/webserver-test.cc@977
PS4, Line 977:   IPMode mode_;
nit: make this a constant member field and initialize it in the constructor of 
the class, making IPMode a parameter of the WebserverAdvertisedAddressesTest's 
constructor


http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/server/webserver-test.cc@1126
PS4, Line 1126:     switch (GetParam()) {
              :       case IPMode::IPV6:
              :         opts.bind_interface = "[::1]";
              :         break;
              :       case IPMode::DUAL:
              :         opts.bind_interface = "[::]";
              :         break;
              :       default:
              :         // Default value of FLAGS_webserver_interface i.e., 
IPv4 wildcard.
              :         break;
              :     }
Please consolidate this with the same code in the 
WebserverTest::use_webserver_interface() method (move into a file-scope 
function and reuse it, etc.).


http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/util/net/net_util.h
File src/kudu/util/net/net_util.h:

http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/util/net/net_util.h@285
PS4, Line 285: ip_config_mode
nit: wouldn't it be more consistent and easier for reader's comprehension to 
refer to the ParseIPModeFlag() function above instead?


http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/util/net/net_util.h@288
PS4, Line 288: GetIPConfigMode
The name of this function is misleading and doesn't follow the code style 
guidelines.  Please rename to IPModeToString()


http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/util/net/net_util.cc
File src/kudu/util/net/net_util.cc:

http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/util/net/net_util.cc@186
PS4, Line 186: string
nit: to avoid needless string copying, either change this to return 'const 
string&', returning a reference to a static string defined in the scope of this 
function, or change the return type to 'const char*'


http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/util/test_util.cc
File src/kudu/util/test_util.cc:

http://gerrit.cloudera.org:8080/#/c/23707/4/src/kudu/util/test_util.cc@762
PS4, Line 762: void PrintTo(IPMode param, std::ostream* os) {
             :   *os << GetIPConfigMode(param);
             : }
nit: in C++, there is more elegant ways of doing this.  Consider making it 
possible to have the code like below:

  IPMode param;
  ...
  ostream os;
  ...
  os << param;
  ...

For that, it's necessary to define the operator like below:

ostream& operator<<(ostream& os, IPMode& mode) {
  os << GetIPConfigMode(param);
  return os;
}



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic72efea2045b12300ccf0e80873c405828c15a30
Gerrit-Change-Number: 23707
Gerrit-PatchSet: 4
Gerrit-Owner: Ashwani Raina <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Ashwani Raina <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Comment-Date: Wed, 28 Jan 2026 19:56:05 +0000
Gerrit-HasComments: Yes

Reply via email to