ndimiduk commented on a change in pull request #1286: HBASE-23977 : Resolve
flakes present in TestSlowLogRecorder
URL: https://github.com/apache/hbase/pull/1286#discussion_r395328571
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/slowlog/TestSlowLogRecorder.java
##########
@@ -93,12 +91,14 @@ private static Configuration applySlowLogRecorderConf(int
eventSize) {
* @param i index of ringbuffer logs
* @param j data value that was put on index i
* @param slowLogPayloads list of payload retrieved from {@link
SlowLogRecorder}
+ * @return if actual values are as per expectations
*/
- private void confirmPayloadParams(int i, int j, List<SlowLogPayload>
slowLogPayloads) {
+ private boolean confirmPayloadParams(int i, int j, List<SlowLogPayload>
slowLogPayloads) {
- Assert.assertEquals(slowLogPayloads.get(i).getClientAddress(), "client_" +
j);
- Assert.assertEquals(slowLogPayloads.get(i).getUserName(), "userName_" + j);
- Assert.assertEquals(slowLogPayloads.get(i).getServerClass(), "class_" + j);
+ boolean isClientExpected =
slowLogPayloads.get(i).getClientAddress().equals("client_" + j);
Review comment:
It's a style consideration... not a strong concern. I find it easier to read
if you did something like
```java
return doThingA()
&& doThingB()
&& doThingC();
```
because in this case, there's no chance for any of them to be accidentally
forgotten. Not as important here where there's only 3, but down below you do
quite a few, so that's where I think it helps.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services