Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/16400 )
Change subject: KUDU-3012: Add a Log Throttler ...................................................................... Patch Set 2: (5 comments) http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduSession.java File java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduSession.java: http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduSession.java@550 PS2, Line 550: ThrottlerLogUtil throttleLog = new ThrottlerLogUtil(LOG); If we instantiate a new ThrottlerLogUtil every time apply() is called, won't it never throttle anything? http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/main/java/org/apache/kudu/util/ThrottlerLogUtil.java File java/kudu-client/src/main/java/org/apache/kudu/util/ThrottlerLogUtil.java: http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/main/java/org/apache/kudu/util/ThrottlerLogUtil.java@29 PS2, Line 29: TODO: nit: can you suffix this with your id, same below, e.g. // TODO(awong): foo bar http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/main/java/org/apache/kudu/util/ThrottlerLogUtil.java@29 PS2, Line 29: If functionality is ever expanded, use ConcurrentHashMap to store multiple messages and : * the last time it was logged, only one instance of ThrottlerLogUtil will be needed per class then, : * use integer as key rather than string for performance costs nit: this can probably be broken into a couple sentences, given you are describing two distinct ideas: hashing based on messages to allow the usage of a single ThrottlerLogUtil instance for multiple call-sites, and hashing integers instead of message for the sake of reducing hashing cost. http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/test/java/org/apache/kudu/util/TestLogThrottler.java File java/kudu-client/src/test/java/org/apache/kudu/util/TestLogThrottler.java: http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/test/java/org/apache/kudu/util/TestLogThrottler.java@46 PS2, Line 46: : nit: what is the point of this colon? http://gerrit.cloudera.org:8080/#/c/16400/2/java/kudu-client/src/test/java/org/apache/kudu/util/TestLogThrottler.java@56 PS2, Line 56: nit: this seems like too many spaces. Same below. -- To view, visit http://gerrit.cloudera.org:8080/16400 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia2089b6fc905a5b54d664b7200060cabb965f40f Gerrit-Change-Number: 16400 Gerrit-PatchSet: 2 Gerrit-Owner: Mahesh Reddy <mre...@cloudera.com> Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com> Gerrit-Reviewer: Bankim Bhavsar <ban...@cloudera.com> Gerrit-Reviewer: Grant Henke <granthe...@apache.org> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mahesh Reddy <mre...@cloudera.com> Gerrit-Comment-Date: Thu, 03 Sep 2020 04:49:12 +0000 Gerrit-HasComments: Yes