Skip to content

HBASE-27201 Clean up error-prone findings in hbase-backup - #4622

Closed
apurtell wants to merge 2 commits into
apache:masterfrom
apurtell:HBASE-27201
Closed

HBASE-27201 Clean up error-prone findings in hbase-backup#4622
apurtell wants to merge 2 commits into
apache:masterfrom
apurtell:HBASE-27201

Conversation

@apurtell

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 39sDocker 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 43smaster passed
+1 💚compile0m 15smaster passed
+1 💚shadedjars3m 48sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 13smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 28sthe patch passed
+1 💚compile0m 15sthe patch passed
+1 💚javac0m 15sthe patch passed
+1 💚shadedjars3m 47spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 11sthe patch passed
_ Other Tests _
-1 ❌unit12m 18shbase-backup in the patch failed.
27m 39s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4622
Optional Testsjavac javadoc unit shadedjars compile
unameLinux f8d43734863b 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 01b45e2
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-backup.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/testReport/
Max. process+thread count2981 (vs. ulimit of 30000)
modulesC: hbase-backup U: hbase-backup
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/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 🆗reexec2m 16sDocker 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 32smaster passed
+1 💚compile0m 15smaster passed
+1 💚shadedjars3m 52sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 13smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 22sthe patch passed
+1 💚compile0m 16sthe patch passed
+1 💚javac0m 16sthe patch passed
+1 💚shadedjars3m 50spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 11sthe patch passed
_ Other Tests _
-1 ❌unit13m 3shbase-backup in the patch failed.
29m 49s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4622
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 20db13b7bf08 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
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-backup.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/testReport/
Max. process+thread count2993 (vs. ulimit of 30000)
modulesC: hbase-backup U: hbase-backup
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/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 34sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo 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 2smaster passed
+1 💚compile0m 31smaster passed
+1 💚checkstyle0m 12smaster passed
+1 💚spotless0m 55sbranch has no errors when running spotless:check.
+1 💚spotbugs0m 39smaster passed
_ Patch Compile Tests _
+1 💚mvninstall3m 8sthe patch passed
+1 💚compile0m 31sthe patch passed
+1 💚javac0m 31shbase-backup generated 0 new + 0 unchanged - 52 fixed = 0 total (was 52)
+1 💚checkstyle0m 11sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck15m 5sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotless1m 0spatch has no errors when running spotless:check.
-1 ❌spotbugs0m 48shbase-backup generated 6 new + 0 unchanged - 0 fixed = 6 total (was 0)
_ Other Tests _
+1 💚asflicense0m 15sThe patch does not generate ASF License warnings.
33m 36s
ReasonTests
FindBugsmodule:hbase-backup
Impossible downcast of toArray() result to org.apache.hadoop.hbase.TableName[] in org.apache.hadoop.hbase.backup.impl.BackupCommands$BackupSetCommand.processSetAdd(String[]) At BackupCommands.java:to org.apache.hadoop.hbase.TableName[] in org.apache.hadoop.hbase.backup.impl.BackupCommands$BackupSetCommand.processSetAdd(String[]) At BackupCommands.java:[line 1093]
Impossible downcast of toArray() result to String[] in org.apache.hadoop.hbase.backup.impl.BackupSystemTable.getRegionNameFromOrigBulkLoadRow(String) At BackupSystemTable.java:to String[] in org.apache.hadoop.hbase.backup.impl.BackupSystemTable.getRegionNameFromOrigBulkLoadRow(String) At BackupSystemTable.java:[line 1751]
Impossible downcast of toArray() result to String[] in org.apache.hadoop.hbase.backup.impl.BackupSystemTable.getTableNameFromOrigBulkLoadRow(String) At BackupSystemTable.java:to String[] in org.apache.hadoop.hbase.backup.impl.BackupSystemTable.getTableNameFromOrigBulkLoadRow(String) At BackupSystemTable.java:[line 1745]
Impossible downcast of toArray() result to String[] in org.apache.hadoop.hbase.backup.util.BackupUtils.findMostRecentBackupId(String[]) At BackupUtils.java:to String[] in org.apache.hadoop.hbase.backup.util.BackupUtils.findMostRecentBackupId(String[]) At BackupUtils.java:[line 741]
Impossible downcast of toArray() result to String[] in org.apache.hadoop.hbase.backup.util.BackupUtils.parseTableNames(String) At BackupUtils.java:to String[] in org.apache.hadoop.hbase.backup.util.BackupUtils.parseTableNames(String) At BackupUtils.java:[line 287]
Impossible downcast of toArray() result to String[] in org.apache.hadoop.hbase.backup.util.BackupUtils$1.getTimestamp(String) At BackupUtils.java:to String[] in org.apache.hadoop.hbase.backup.util.BackupUtils$1.getTimestamp(String) At BackupUtils.java:[line 601]
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4622
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux 5627ce41fd98 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
spotbugshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/1/artifact/yetus-general-check/output/new-spotbugs-hbase-backup.html
Max. process+thread count64 (vs. ulimit of 30000)
modulesC: hbase-backup U: hbase-backup
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/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.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 39sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall2m 23smaster passed
+1 💚compile0m 15smaster passed
+1 💚shadedjars3m 48sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 11smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 31sthe patch passed
+1 💚compile0m 15sthe patch passed
+1 💚javac0m 15sthe patch passed
+1 💚shadedjars3m 47spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 11sthe patch passed
_ Other Tests _
+1 💚unit9m 40shbase-backup in the patch passed.
24m 42s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4622
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 7cd41c68ca82 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 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-4622/2/testReport/
Max. process+thread count2997 (vs. ulimit of 30000)
modulesC: hbase-backup U: hbase-backup
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/2/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 41sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo 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 💚mvninstall2m 30smaster passed
+1 💚compile0m 23smaster passed
+1 💚checkstyle0m 8smaster passed
+1 💚spotless0m 41sbranch has no errors when running spotless:check.
+1 💚spotbugs0m 26smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 6sthe patch passed
+1 💚compile0m 22sthe patch passed
+1 💚javac0m 22shbase-backup generated 0 new + 0 unchanged - 52 fixed = 0 total (was 52)
+1 💚checkstyle0m 7sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck11m 50sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotless0m 39spatch has no errors when running spotless:check.
+1 💚spotbugs0m 29sthe patch passed
_ Other Tests _
+1 💚asflicense0m 9sThe patch does not generate ASF License warnings.
25m 50s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4622
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux 0654daf31d55 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
Max. process+thread count69 (vs. ulimit of 30000)
modulesC: hbase-backup U: hbase-backup
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/2/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.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 9sDocker 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 28smaster passed
+1 💚compile0m 16smaster passed
+1 💚shadedjars3m 44sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 14smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 17sthe patch passed
+1 💚compile0m 16sthe patch passed
+1 💚javac0m 16sthe patch passed
+1 💚shadedjars3m 42spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 13sthe patch passed
_ Other Tests _
+1 💚unit10m 45shbase-backup in the patch passed.
26m 10s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4622
Optional Testsjavac javadoc unit shadedjars compile
unameLinux c14508a31575 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
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/2/testReport/
Max. process+thread count2919 (vs. ulimit of 30000)
modulesC: hbase-backup U: hbase-backup
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4622/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

return null;
}
return new String(val).split(",");
return new String(val, StandardCharsets.UTF_8).split(",");

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 introduce another error prone warning? Use guava's Splitter.on

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.

It does not.

return null;
}
return new String(val).split(",");
return new String(val, StandardCharsets.UTF_8).split(",");

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.

Ditto.

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.

It does not produce a warning, because stringsplitter warnings are suppressed.

return scan;
}

@SuppressWarnings("StringSplitter")

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.

Since we have shaded guava, I think it is OK for use to make use of guava's Splitter.

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.

There's nothing wrong with string.split in these applications and when I used Splitter it caused more trouble than it was worth.

return parts[1];
}

@SuppressWarnings("StringSplitter")

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.

Ditto.

return logFiles;
}

@SuppressWarnings("StringSplitter")

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.

DItto.

return ts1 < ts2 ? 1 : -1;
}

@SuppressWarnings("StringSplitter")

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.

Ditto.

return BulkLoadHFiles.create(conf);
}

@SuppressWarnings("StringSplitter")

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.

Ditto.

@apurtell

apurtell commented Jul 18, 2022

Copy link
Copy Markdown
ContributorAuthor

@Apache9 It is fine to handle the string split warnings some other way, but I thought I would take this approach. I had a bit of trouble actually using Splitter. I'm sure I could figure it out but there are other things that seem more important. string#split works in these cases and is good enough IMHO. Is this ok?

Or, we could just leave these in place and also not add the @SuppressWarnings("StringSplitter"), that is fine with me too. In other words, no change for the string#split cases.

@apurtell

apurtell commented Jul 18, 2022

Copy link
Copy Markdown
ContributorAuthor

Lets apply the new spotless rule for the automated fix for many of the javadoc issues, and then come back to this PR.

@apurtell
apurtell marked this pull request as draft July 18, 2022 22:54
@Apache9

Copy link
Copy Markdown
Contributor

@Apache9 It is fine to handle the string split warnings some other way, but I thought I would take this approach. I had a bit of trouble actually using Splitter. I'm sure I could figure it out but there are other things that seem more important. string#split works in these cases and is good enough IMHO. Is this ok?

Or, we could just leave these in place and also not add the @SuppressWarnings("StringSplitter"), that is fine with me too. In other words, no change for the string#split cases.

Usually there is no harm to use String.split, as long as it has been like this for a long time in our code base, so I'm OK with leaving it as is or adding a SuppressWarnings.
Out of interest, what is the problem when using Splitter? It is just a Splitter.on().splitToList().

Thanks.

@apurtell
apurtell deleted the HBASE-27201 branch July 22, 2022 23:51
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