Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/16201 )
Change subject: KUDU-1422 resize ErrorCollector ...................................................................... Patch Set 2: (2 comments) http://gerrit.cloudera.org:8080/#/c/16201/2/java/kudu-client/src/main/java/org/apache/kudu/client/ErrorCollector.java File java/kudu-client/src/main/java/org/apache/kudu/client/ErrorCollector.java: http://gerrit.cloudera.org:8080/#/c/16201/2/java/kudu-client/src/main/java/org/apache/kudu/client/ErrorCollector.java@34 PS2, Line 34: private volatile int maxCapacity; > All these behave like that given JVM synchronises an object during its cons I don't think we need volatile and synchronized. It's usually one or the other. In this case, because we allow writing the value from any thread, it is synchronized that should be used. Here is a brief overview of both choices: https://jorosjavajams.wordpress.com/volatile-vs-synchronized/#:~:text=Use%20Volatile%20when%20you%20variables,written%20to%20by%20multiple%20threads. http://gerrit.cloudera.org:8080/#/c/16201/2/java/kudu-client/src/main/java/org/apache/kudu/client/ErrorCollector.java@86 PS2, Line 86: * Resize ErrorCollector. If size < maxCapacity && size < errorQueue.size(), the oldest errors will be discarded Line is > 100 characters. -- To view, visit http://gerrit.cloudera.org:8080/16201 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53731f6367aa84d6435b3bf2143e86164c8eaa1e Gerrit-Change-Number: 16201 Gerrit-PatchSet: 2 Gerrit-Owner: Anonymous Coward <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Anonymous Coward <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Grant Henke <[email protected]> Gerrit-Reviewer: Greg Solovyev <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Sun, 19 Jul 2020 15:29:39 +0000 Gerrit-HasComments: Yes
