-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-27203 Clean up error-prone findings in hbase-client #4644
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Left some comments.
Thanks @apurtell for the hard work!
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
Outdated
Show resolved
Hide resolved
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java
Outdated
Show resolved
Hide resolved
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java
Outdated
Show resolved
Hide resolved
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java
Show resolved
Hide resolved
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java
Show resolved
Hide resolved
...java/org/apache/hadoop/hbase/security/provider/AbstractSaslClientAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
@@ -192,8 +187,7 @@ public void testSetStartRowAndSetStopRow() { | |||
scan.withStartRow(new byte[HConstants.MAX_ROW_LENGTH + 1]); | |||
fail("should've thrown exception"); | |||
} catch (IllegalArgumentException iae) { | |||
} catch (Exception e) { | |||
fail("expected IllegalArgumentException to be thrown"); | |||
// Expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could file another issue to change these tests to use assertThrows. Anyway, the current modifications make the code better, can open a follow on issue for changing to assertThrows.
@@ -115,6 +116,7 @@ public long heapSize() { | |||
} | |||
|
|||
@Test | |||
@SuppressWarnings("ArrayAsKeyOfSetOrMap") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a test, let's just use TreeMap with Bytes.BYTES_COMPARATOR instead of HashMap to remove the warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I went back and undid my changes related to ArrayAsKeyOfSetOrMap while revising the patch but see that I left this one in place.
@@ -277,6 +279,7 @@ public void testSubmittedSizeChecker() { | |||
} | |||
|
|||
@Test | |||
@SuppressWarnings("ArrayAsKeyOfSetOrMap") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestSimpleRequestController.java
Show resolved
Hide resolved
Rebase. Address review feedback. More javadoc cleanups. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a minor nits, can change or not, not a big deal.
+1, thanks @apurtell for the hard work!
@@ -62,7 +65,8 @@ public boolean matches(String stringQop) { | |||
|
|||
/** Splitting fully qualified Kerberos name into parts */ | |||
public static String[] splitKerberosName(String fullName) { | |||
return fullName.split("[/@]"); | |||
List<String> result = Splitter.onPattern("[/@]").splitToList(fullName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Splitter.onPattern("[/@]").splitToStream(fullName).toArray(String[]::new);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You indicated a preference for using a stream to do toArray on the hbase-backup review, will apply the pattern to all such places, no problem
No description provided.