Skip to content
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

Merged
merged 1 commit into from
May 17, 2024

Conversation

konjac-h
Copy link
Contributor

@konjac-h konjac-h commented May 16, 2024

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

  • Unit Test (In facebook internal PR)
  • Verifier Test

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

elharo
elharo previously requested changes May 16, 2024
presto-main/pom.xml Outdated Show resolved Hide resolved
@@ -48,6 +51,11 @@ public Optional<String> getClientInfo()
return clientInfo;
}

public Set<String> getClientTags()
Copy link
Contributor

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()
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@jainxrohit
Copy link
Contributor

Can we add specific in the commit title what we are enriching with ?

jainxrohit
jainxrohit previously approved these changes May 16, 2024
Copy link
Contributor

@jainxrohit jainxrohit left a 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.

@konjac-h konjac-h force-pushed the enrich-metastore-context branch 2 times, most recently from cfa77f5 to 4345b8d Compare May 16, 2024 17:48
@konjac-h konjac-h changed the title Enrich MetastoreContext Enrich MetastoreContext with ClientTags May 16, 2024
@konjac-h konjac-h requested a review from elharo May 16, 2024 18:15
Copy link
Contributor

@jainxrohit jainxrohit left a 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.

@jainxrohit jainxrohit merged commit 08eed5a into prestodb:master May 17, 2024
56 checks passed
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.

None yet

4 participants