Skip to content

HBASE-27203 Clean up error-prone findings in hbase-client - #4626

Closed
apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:HBASE-27203
Closed

HBASE-27203 Clean up error-prone findings in hbase-client#4626
apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:HBASE-27203

Conversation

@apurtell

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 19sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall2m 51smaster passed
+1 💚compile0m 20smaster passed
+1 💚shadedjars3m 49sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 19smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 40sthe patch passed
+1 💚compile0m 19sthe patch passed
+1 💚javac0m 19sthe patch passed
+1 💚shadedjars3m 41spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 18shbase-client generated 0 new + 46 unchanged - 9 fixed = 46 total (was 55)
_ Other Tests _
+1 💚unit1m 17shbase-client in the patch passed.
18m 23s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4626
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 8a578f4af13f 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 01b45e2
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/testReport/
Max. process+thread count190 (vs. ulimit of 30000)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 55sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall2m 57smaster passed
+1 💚compile0m 19smaster passed
+1 💚shadedjars4m 51sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 22smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 52sthe patch passed
+1 💚compile0m 21sthe patch passed
+1 💚javac0m 21sthe patch passed
+1 💚shadedjars4m 43spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 17sthe patch passed
_ Other Tests _
+1 💚unit1m 25shbase-client in the patch passed.
20m 26s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4626
Optional Testsjavac javadoc unit shadedjars compile
unameLinux e9b5ade1fbb1 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 01b45e2
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/testReport/
Max. process+thread count164 (vs. ulimit of 30000)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 26sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+1 💚mvninstall3m 8smaster passed
+1 💚compile0m 51smaster passed
+1 💚checkstyle0m 18smaster passed
+1 💚spotless0m 56sbranch has no errors when running spotless:check.
+1 💚spotbugs0m 58smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 41sthe patch passed
+1 💚compile0m 39sthe patch passed
+1 💚javac0m 39shbase-client generated 0 new + 0 unchanged - 123 fixed = 0 total (was 123)
-0 ⚠️checkstyle0m 16shbase-client: The patch generated 1 new + 163 unchanged - 64 fixed = 164 total (was 227)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck13m 14sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotless0m 48spatch has no errors when running spotless:check.
+1 💚spotbugs0m 51sthe patch passed
_ Other Tests _
+1 💚asflicense0m 9sThe patch does not generate ASF License warnings.
32m 18s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4626
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux cbee69a2ab0c 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 01b45e2
Default JavaAdoptOpenJDK-1.8.0_282-b08
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-client.txt
Max. process+thread count64 (vs. ulimit of 30000)
modulesC: hbase-client U: hbase-client
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just skimmed a small piece of code.

For the returns only warning, let me think whether we could implement spotless rule to convert it automatically, so we do not need to mix this stytle change with other more critical fixes.

private final long evictedBlocks;
private final long maxCacheSize;
private final Map<byte[], Throwable> exceptions;
private final IdentityHashMap<byte[], Throwable> exceptions;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will be a bit dangerous if we will return this map to upper layer...

@apurtellapurtellJul 18, 2022

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

The warning here is the one that suggests maps and identity keys should not be mixed... that if the keys use object identity, the map type should be IdentityHashMap. It seems minor, but correct.

storeFileSizeMB += r.getStoreFileSize().get(Size.Unit.MEGABYTE);
memStoreSizeMB += r.getMemStoreSize().get(Size.Unit.MEGABYTE);
storefileIndexSizeKB += r.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE);
uncompressedStoreFileSizeMB = (long) (uncompressedStoreFileSizeMB

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just use += and cast the right operator to long is enough?

@apurtell

Copy link
Copy Markdown
ContributorAuthor

@Apache9 Agreed, let's apply the new spotless rule for the automated fix, and then come back to this PR.

@apurtell
apurtell marked this pull request as draft July 18, 2022 22:39
@apurtell
apurtell deleted the HBASE-27203 branch July 22, 2022 23:53
Sign up for freeto 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

@apurtell@Apache-HBase@Apache9