Skip to content
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

Merged
merged 3 commits into from
Jul 26, 2022

Conversation

apurtell
Copy link
Contributor

No description provided.

@apurtell apurtell requested review from Apache9 and virajjasani July 23, 2022 01:37
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 13s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 28s master passed
+1 💚 compile 0m 18s master passed
+1 💚 shadedjars 3m 45s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 17s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 19s the patch passed
+1 💚 compile 0m 18s the patch passed
+1 💚 javac 0m 18s the patch passed
+1 💚 shadedjars 3m 43s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 16s the patch passed
_ Other Tests _
+1 💚 unit 1m 13s hbase-client in the patch passed.
17m 8s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #4644
Optional Tests javac javadoc unit shadedjars compile
uname Linux 08671c6059b5 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 31fc97e
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/testReport/
Max. process+thread count 159 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 40s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 59s master passed
+1 💚 compile 0m 17s master passed
+1 💚 shadedjars 4m 5s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 20s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 33s the patch passed
+1 💚 compile 0m 17s the patch passed
+1 💚 javac 0m 17s the patch passed
+1 💚 shadedjars 3m 54s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 14s hbase-client generated 0 new + 44 unchanged - 11 fixed = 44 total (was 55)
_ Other Tests _
+1 💚 unit 1m 21s hbase-client in the patch passed.
17m 56s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #4644
Optional Tests javac javadoc unit shadedjars compile
uname Linux 10f5b0b4bad4 5.4.0-1043-aws #45~18.04.1-Ubuntu SMP Fri Apr 9 23:32:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 31fc97e
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/testReport/
Max. process+thread count 189 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 1s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 2m 23s master passed
+1 💚 compile 0m 35s master passed
+1 💚 checkstyle 0m 14s master passed
+1 💚 spotless 0m 42s branch has no errors when running spotless:check.
+1 💚 spotbugs 0m 36s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 8s the patch passed
+1 💚 compile 0m 33s the patch passed
-0 ⚠️ javac 0m 33s hbase-client generated 29 new + 5 unchanged - 118 fixed = 34 total (was 123)
+1 💚 checkstyle 0m 12s hbase-client: The patch generated 0 new + 128 unchanged - 75 fixed = 128 total (was 203)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 11m 30s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotless 0m 40s patch has no errors when running spotless:check.
+1 💚 spotbugs 0m 40s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 8s The patch does not generate ASF License warnings.
27m 24s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #4644
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux ffd6408f3fe7 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 31fc97e
Default Java AdoptOpenJDK-1.8.0_282-b08
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/artifact/yetus-general-check/output/diff-compile-javac-hbase-client.txt
Max. process+thread count 64 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/1/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@Apache9 Apache9 left a 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!

@@ -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
Copy link
Contributor

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")
Copy link
Contributor

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?

Copy link
Contributor Author

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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@apurtell
Copy link
Contributor Author

Rebase. Address review feedback. More javadoc cleanups.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 40s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 21s master passed
+1 💚 compile 0m 15s master passed
+1 💚 shadedjars 3m 54s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 15s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 9s the patch passed
+1 💚 compile 0m 15s the patch passed
+1 💚 javac 0m 15s the patch passed
+1 💚 shadedjars 3m 56s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 13s the patch passed
_ Other Tests _
+1 💚 unit 1m 7s hbase-client in the patch passed.
16m 1s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #4644
Optional Tests javac javadoc unit shadedjars compile
uname Linux 2567c5da8765 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e10c15d
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/testReport/
Max. process+thread count 161 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 49s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 31s master passed
+1 💚 compile 0m 17s master passed
+1 💚 shadedjars 3m 53s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 14s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 31s the patch passed
+1 💚 compile 0m 18s the patch passed
+1 💚 javac 0m 18s the patch passed
+1 💚 shadedjars 3m 58s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 15s hbase-client generated 0 new + 44 unchanged - 11 fixed = 44 total (was 55)
_ Other Tests _
+1 💚 unit 1m 23s hbase-client in the patch passed.
17m 12s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #4644
Optional Tests javac javadoc unit shadedjars compile
uname Linux 78536caeb06c 5.4.0-1043-aws #45~18.04.1-Ubuntu SMP Fri Apr 9 23:32:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e10c15d
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/testReport/
Max. process+thread count 195 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 19s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 2m 46s master passed
+1 💚 compile 0m 47s master passed
+1 💚 checkstyle 0m 18s master passed
+1 💚 spotless 0m 54s branch has no errors when running spotless:check.
+1 💚 spotbugs 0m 49s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 47s the patch passed
+1 💚 compile 0m 42s the patch passed
-0 ⚠️ javac 0m 42s hbase-client generated 31 new + 5 unchanged - 118 fixed = 36 total (was 123)
+1 💚 checkstyle 0m 16s hbase-client: The patch generated 0 new + 128 unchanged - 75 fixed = 128 total (was 203)
+1 💚 whitespace 0m 1s The patch has no whitespace issues.
+1 💚 hadoopcheck 13m 7s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotless 0m 50s patch has no errors when running spotless:check.
+1 💚 spotbugs 0m 47s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 10s The patch does not generate ASF License warnings.
31m 14s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #4644
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux 7c74a989c870 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e10c15d
Default Java AdoptOpenJDK-1.8.0_282-b08
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/artifact/yetus-general-check/output/diff-compile-javac-hbase-client.txt
Max. process+thread count 64 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4644/2/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@Apache9 Apache9 left a 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);
Copy link
Contributor

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);

Copy link
Contributor Author

@apurtell apurtell Jul 26, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants