Adar Dembo has posted comments on this change.

Change subject: Combine redaction flag for log and flags into one.
......................................................................


Patch Set 8:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/6112/8/src/kudu/common/column_predicate-test.cc
File src/kudu/common/column_predicate-test.cc:

Line 1087:   gflags::SetCommandLineOption("redact", "log");
So this reruns the validator? Is that how the log boolean gets reset?

On calls like this we should ASSERT that the result is not an empty string. 
Empty strings are a sign that the function failed.


http://gerrit.cloudera.org:8080/#/c/6112/8/src/kudu/util/flags.cc
File src/kudu/util/flags.cc:

Line 150:   for (iter = enabledRedactTypes.begin(); iter != 
enabledRedactTypes.end(); ++iter) {
You can use an enhanced for loop:

  for (const auto&s : enabledRedactTypes) {
    if (s.compare("LOG") == 0) {
      ...
    }
  }


Line 165:     kudu::should_redact_log = enabled_redact_log;
Why don't we store the result of FLAG redaction in a global variable too? Then 
we don't need ShouldRedact() anymore, and ShouldRedactFlag() becomes much 
simpler.


http://gerrit.cloudera.org:8080/#/c/6112/8/src/kudu/util/flags.h
File src/kudu/util/flags.h:

Line 68: bool ShouldRedactLog();
Why do we still need this? Either logging.h should call this and 
should_redact_log should be hidden in flags.cc, or we don't need this function.


http://gerrit.cloudera.org:8080/#/c/6112/8/src/kudu/util/logging.cc
File src/kudu/util/logging.cc:

Line 80: bool should_redact_log = true;
Does this actually need a default value, since it's always initialized via the 
gflag validator?


http://gerrit.cloudera.org:8080/#/c/6112/8/src/kudu/util/logging.h
File src/kudu/util/logging.h:

Line 86: extern bool should_redact_log;
Nit: we generally prefix global variables with g_.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia49ae439824351df6c87291b0828173c69ab31b0
Gerrit-PatchSet: 8
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Hao Hao <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Hao Hao <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: Yes

Reply via email to