-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Enrich MetastoreContext with ClientTags #22766
Conversation
...tastore/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java
Outdated
Show resolved
Hide resolved
...tastore/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/com/facebook/presto/hive/HiveQueryRunner.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergQueryRunner.java
Outdated
Show resolved
Hide resolved
@@ -48,6 +51,11 @@ public Optional<String> getClientInfo() | |||
return clientInfo; | |||
} | |||
|
|||
public Set<String> getClientTags() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exposes potentially mutable internal state. Might be risky in a security context.
@@ -126,6 +132,11 @@ public Optional<String> getClientInfo() | |||
return clientInfo; | |||
} | |||
|
|||
public Set<String> getClientTags() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On first review I didn't find a test for this new public method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a getter method. I haven't noticed other similar methods being tested either. In my opinion, testing this would be unnecessary repetition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not repetition. It's verification, and a prevention of regression.
I know our existing tests are lacking. That shouldn't stop us from doing better going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, unit tests are there to test the behaviour of code, in a meaningful way, and getters/setters are only a means to an end. Writing unit tests for a getter method is proving to be a diversion for me.
Can we add specific in the commit title what we are enriching with ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, lets resolve the existing comments.
cfa77f5
to
4345b8d
Compare
4345b8d
to
c4a4134
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Description
This PR enriches the metastore context with the client tags and corresponding constructor change
Motivation and Context
For Meta Internal, we want to enable certain features for metastore based on client tags. Hence, we introduce the client tags inside the metastore context
Impact
Metastore context will have another attribute
clientTags
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.