Skip to content

Conversation

@mnpoonia
Copy link
Contributor

@mnpoonia mnpoonia commented Dec 24, 2025

No description provided.

@Apache-HBase

This comment has been minimized.

@Umeshkumar9414
Copy link
Contributor

Need to run mvn spotless:apply

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Copy link
Contributor

@Umeshkumar9414 Umeshkumar9414 left a comment

Choose a reason for hiding this comment

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

LGTM

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 47s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗 mvndep 0m 38s Maven dependency ordering for branch
+1 💚 mvninstall 4m 58s master passed
+1 💚 compile 5m 18s master passed
+1 💚 checkstyle 1m 30s master passed
+1 💚 spotbugs 3m 11s master passed
+1 💚 spotless 1m 11s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 3m 51s the patch passed
+1 💚 compile 5m 1s the patch passed
+1 💚 javac 5m 1s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 25s the patch passed
+1 💚 spotbugs 3m 24s the patch passed
+1 💚 hadoopcheck 17m 42s Patch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚 spotless 0m 55s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
60m 22s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7575
JIRA Issue HBASE-29706
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 87a1764ea28a 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 3a1ebef
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 84 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/3/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 44s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 42s Maven dependency ordering for branch
+1 💚 mvninstall 5m 0s master passed
+1 💚 compile 1m 47s master passed
+1 💚 javadoc 1m 0s master passed
+1 💚 shadedjars 7m 2s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 4m 7s the patch passed
+1 💚 compile 1m 42s the patch passed
+1 💚 javac 1m 42s the patch passed
+1 💚 javadoc 0m 59s the patch passed
+1 💚 shadedjars 6m 53s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 2m 4s hbase-client in the patch passed.
+1 💚 unit 225m 10s hbase-server in the patch passed.
263m 40s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/3/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7575
JIRA Issue HBASE-29706
Optional Tests javac javadoc unit compile shadedjars
uname Linux 02bda1973165 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 3a1ebef
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/3/testReport/
Max. process+thread count 4068 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/3/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@mnpoonia
Copy link
Contributor Author

@apurtell @virajjasani please review when you get some free cycle.

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.

The title of the PR is different with the title of the jira...

Could someone explain more about what do we actually fix here?

Thanks.

) {
return false;
}
return new TreeMap<>(getProperties()).equals(new TreeMap<>(other.getProperties()));
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 use equals directly here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed and improved it.


@Override
public int hashCode() {
return Objects.hash(className, jarPath, priority, new TreeMap<>(properties));
Copy link
Contributor

Choose a reason for hiding this comment

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

Better use Objects.hash to calculate hashCode for fields other than properties, and then use stream.sorted to iterator over properties and calculate hashCode on the fly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Almost what you suggested.

if (
this.unmodifiedTableDescriptor.getCoprocessorDescriptors().hashCode()
!= this.modifiedTableDescriptor.getCoprocessorDescriptors().hashCode()
!new HashSet<>(this.unmodifiedTableDescriptor.getCoprocessorDescriptors())
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not on the critial read/write path so maybe this is acceptable, but a better way, is to first check size, and then, create a HashSet for one of the descriptors, and then iterator over the other one, and check whethere the HashSet contains it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@mnpoonia mnpoonia changed the title HBASE-29706: Make CoprocessorDescriptorImpl.equals() and hashCode() r… HBASE-29706: Alter table with reopen false should pass if coprocessors havenot changed Dec 29, 2025
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 20s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for branch
+1 💚 mvninstall 2m 45s master passed
+1 💚 compile 3m 11s master passed
+1 💚 checkstyle 0m 59s master passed
+1 💚 spotbugs 1m 46s master passed
+1 💚 spotless 0m 40s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 2m 16s the patch passed
+1 💚 compile 3m 13s the patch passed
+1 💚 javac 3m 13s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 59s the patch passed
+1 💚 spotbugs 1m 55s the patch passed
+1 💚 hadoopcheck 8m 30s Patch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚 spotless 0m 34s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 14s The patch does not generate ASF License warnings.
34m 13s
Subsystem Report/Notes
Docker ClientAPI=1.48 ServerAPI=1.48 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7575
JIRA Issue HBASE-29706
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux a82d5bea3329 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / d66e3ac
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 85 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/4/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Override
public int hashCode() {
int result = Objects.hash(className, jarPath, priority);
List<Map.Entry<String, String>> entries = new ArrayList<>(properties.entrySet());
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, checked the code, properties is already a TreeMap... So we do not need to sort here, just iterate over it is enough...

To make it safe, we can change the declaration of properties from Map to SortedMap or NavigableMap.

Copy link
Contributor Author

@mnpoonia mnpoonia Dec 29, 2025

Choose a reason for hiding this comment

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

Consdering this change is not in hot path should we still change the treemap to map(Navigable or sortable)?
This might become a cleanup exercise where treemap specific functionality is used elsewhere. I mean i am happy to change it but doesn't make sense to do it in this jira atleast.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you want it within same jira.

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 it is related. We want to make sure the hash code calculation is stable, so here we want to sort the entries before calculating. Since we already use TreeMap in CoprocessorDescriptorBuilder, we can make sure that the Map in CoprocessorDescriptor is a TreeMap, which is sorted, so we do not need to sort it again.

To prevent later developers break the assumption, i.e, changing the TreeMap to HashMap in CoprocessorDescriptorBuilder without any compilation errors, we'd better change the declaration in CoprocessorDescriptor to SortedMap or NavigableMap, so the constructor will not accept a HashMap any more. And we could also add some comments to explain that we must use SortedMap here as we need it for a stable hash code calculation.

Thanks.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 20s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for branch
+1 💚 mvninstall 2m 48s master passed
+1 💚 compile 1m 2s master passed
+1 💚 javadoc 0m 35s master passed
+1 💚 shadedjars 4m 34s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 2m 15s the patch passed
+1 💚 compile 1m 2s the patch passed
+1 💚 javac 1m 2s the patch passed
+1 💚 javadoc 0m 34s the patch passed
+1 💚 shadedjars 4m 30s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 1m 12s hbase-client in the patch passed.
+1 💚 unit 209m 54s hbase-server in the patch passed.
234m 6s
Subsystem Report/Notes
Docker ClientAPI=1.48 ServerAPI=1.48 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7575
JIRA Issue HBASE-29706
Optional Tests javac javadoc unit compile shadedjars
uname Linux 9a93d7abde05 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / d66e3ac
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/4/testReport/
Max. process+thread count 5612 (vs. ulimit of 30000)
modules C: hbase-client hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7575/4/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

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.

4 participants