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

Rename QueryIdCachingProxyHandler to Constants.java #504

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RiyaJohn
Copy link

@RiyaJohn RiyaJohn commented Oct 2, 2024

Description

Fixes #480

Release notes

  • (x) This is not user-visible or is docs only, and no release notes are required.

Copy link

cla-bot bot commented Oct 2, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Riya John.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@willmostly
Copy link
Contributor

Thanks for the submission @RiyaJohn, this looks like it can be merged once cla-bot is happy. My only question is if we want to add a utils subpackage or put this class in an existing one. @oneonestar , @Chaho12 , @vishalya any opinion?

@ebyhr ebyhr changed the title #480 Rename QueryIdCachingProxyHandler to Constants.java Rename QueryIdCachingProxyHandler to Constants.java Oct 2, 2024
package io.trino.gateway.ha.handler;
package io.trino.gateway.ha.util;

public class Constants {
Copy link
Member

Choose a reason for hiding this comment

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

Put { on a separate line and you could add final.

Copy link
Member

Choose a reason for hiding this comment

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

The name is too general. Please rename to TrinoHttpUtil or something.

Copy link
Member

Choose a reason for hiding this comment

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

I like the part where it has Trino because this class is meant for Trino http spec.

* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Copy link
Member

Choose a reason for hiding this comment

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

Please don't remove license header.

@@ -26,6 +13,4 @@ public class QueryIdCachingProxyHandler
public static final String OAUTH_PATH = "/oauth2";
public static final String AUTHORIZATION = "Authorization";
public static final String USER_HEADER = "X-Trino-User";

private QueryIdCachingProxyHandler() {}
Copy link
Member

@ebyhr ebyhr Oct 2, 2024

Choose a reason for hiding this comment

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

Please don't remove a constructor.

Copy link
Author

Choose a reason for hiding this comment

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

you mean we have to retain QueryIdCachingProxyHandler class file with this constructor?

Copy link
Member

Choose a reason for hiding this comment

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

No, I meant keeping a private constructor.

Copy link
Member

@Chaho12 Chaho12 left a comment

Choose a reason for hiding this comment

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

LGTM if we rename the class name.
I think we should have it as a separate class because this is Trino http spec, not gateway.

package io.trino.gateway.ha.handler;
package io.trino.gateway.ha.util;

public class Constants {
Copy link
Member

Choose a reason for hiding this comment

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

I like the part where it has Trino because this class is meant for Trino http spec.

Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Having a generic util package and a generic Constants class is an antipattern .. it will just end up as a big undefined class with no focus and spread into the codebase all over as a dependency. Please keep it focussed like in the original issues from @ebyhr

Copy link

cla-bot bot commented Oct 9, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Riya John.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Copy link

cla-bot bot commented Oct 10, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Riya John.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@RiyaJohn
Copy link
Author

@ebyhr I think I have addressed the review comments, please take a look at it. And I need help with this cla-signing. I have an email configured and I can see it in the git config, so not sure what is missing

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

Successfully merging this pull request may close these issues.

Rename QueryIdCachingProxyHandler class
5 participants