Skip to content

HIVE-29429: Support multiple parent classes in HMSHander#6377

Open
dengzhhu653 wants to merge 6 commits intoapache:masterfrom
dengzhhu653:HIVE-29429
Open

HIVE-29429: Support multiple parent classes in HMSHander#6377
dengzhhu653 wants to merge 6 commits intoapache:masterfrom
dengzhhu653:HIVE-29429

Conversation

@dengzhhu653
Copy link
Member

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Hive Metastore server handler implementation by splitting HMSHandler responsibilities into a layered handler class hierarchy (base/deprecated/transaction/privilege), enabling broader reuse and reducing single-class coupling.

Changes:

  • Introduces new handler superclasses (BaseHandler, DeprecatedHandler, TransactionHandler, PrivilegeHandler) and makes HMSHandler extend the new chain.
  • Moves commonly used partition-name parsing helper getPartValsFromName from HMSHandler into MetaStoreServerUtils, updating call sites/imports accordingly.
  • Centralizes thread-local IP address access on BaseHandler and adjusts related code/tests; relaxes visibility on a few members needed across packages (MetaStoreInit.getConnectionURL, TransactionalValidationListener constructor).

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/IpAddressListener.java Updates test to use BaseHandler thread-local IP helpers.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java Adds getPartValsFromName utility and supporting imports.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/BaseHandler.java New shared handler base containing common HMS handler plumbing (init, listeners, metrics, IP thread-local, etc.).
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DeprecatedHandler.java New layer to isolate deprecated Thrift APIs.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/TransactionHandler.java New layer for txn/locking and related listener notifications.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/PrivilegeHandler.java New layer for role/privilege APIs.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/SetAggrStatsHandler.java Switches static import of getPartValsFromName to MetaStoreServerUtils.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/AppendPartitionHandler.java Switches static import of getPartValsFromName to MetaStoreServerUtils.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java Switches static import of getPartValsFromName to MetaStoreServerUtils.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlUpdatePart.java Switches static import of getPartValsFromName to MetaStoreServerUtils.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/TransactionalValidationListener.java Makes constructor public for cross-package instantiation from new handler base.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/TSetIpAddressProcessor.java Updates to set thread-local IP via BaseHandler.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java Uses getMethod instead of getDeclaredMethod to find inherited public init().
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreInit.java Makes getConnectionURL public for cross-package access.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandlerContext.java Stores the handler as BaseHandler in thread-local context (for shutdown notifications).
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java Refactors HMSHandler to extend PrivilegeHandler and delegates shared logic to new handler layers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dengzhhu653 dengzhhu653 requested a review from Copilot March 20, 2026 01:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants