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

Painless: Move and Rename Several Methods in the lookup package #32105

Merged
merged 11 commits into from
Jul 16, 2018

Conversation

jdconrad
Copy link
Contributor

Mechanical change. Moves several shared static methods into a new PainlessLookupUtility class. These are used by both PainlessLookupBuilder and PainlessLookup along with several of the node classes for conversion between type names and types and java classes to painless classes.

@jdconrad jdconrad added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v7.0.0 >refactoring v6.4.0 labels Jul 16, 2018
@jdconrad jdconrad requested a review from rjernst July 16, 2018 18:40
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM


public final class PainlessLookupUtility {

// The following terminology is used for variable names throughout the lookup package:
Copy link
Member

Choose a reason for hiding this comment

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

Please move this to a javadoc on the class, and add a general description as to why this class exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

// Under ambiguous circumstances most variable names are prefixed with asm, java, or painless.
// If the variable name is the same for asm, java, and painless, no prefix is used.

public static Class<?> javaObjectTypeToPainlessDefType(Class<?> javaType) {
Copy link
Member

@rjernst rjernst Jul 16, 2018

Choose a reason for hiding this comment

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

a brief one liner would be nice on most of these methods, especially since at a glance, you would think this would always return def.class, but an explanation of the array case necessary would be nice. These could be in a followup since I know they are just moving here and were undocumented in their previous location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, once I'm done with the functional changes I'll go back and ensure everything is documented.

@jdconrad
Copy link
Contributor Author

@rjernst Thanks for the review! Will commit once CI completes.

@jdconrad
Copy link
Contributor Author

@elasticmachine test this please

@jdconrad jdconrad mentioned this pull request Jul 16, 2018
23 tasks
@jdconrad jdconrad merged commit 15740d6 into elastic:master Jul 16, 2018
martijnvg added a commit that referenced this pull request Jul 17, 2018
* es/6.x:
  Scripting: Remove dead code from painless module (#32064) (#32104)
  Painless: Move and Rename Several Methods in the lookup package (#32105)
  Bypass highlight query terms extraction on empty fields (#32090)
  Core: Backport java time date formatters (#31997)
  Switch non-x-pack to new style requests (#32106)
  SQL: allow LEFT and RIGHT as function names (#32066)
  Painless: Separate PainlessLookup into PainlessLookup and PainlessLookupBuilder (#32054)
  [test] turn on host io cache for opensuse (#32053)
  DOCS: put LIMIT 10 to the SQL query (#32065)
martijnvg added a commit that referenced this pull request Jul 17, 2018
* es/master:
  Add Index UUID to `/_stats` Response (#31871)
  Painless: Move and Rename Several Methods in the lookup package (#32105)
  Bypass highlight query terms extraction on empty fields (#32090)
  Switch non-x-pack to new style requests (#32106)
  [Rollup] Add new capabilities endpoint for concrete rollup indices (#30401)
  Revert "[test] disable packaging tests for suse boxes"
  SQL: allow LEFT and RIGHT as function names (#32066)
  DOCS: put LIMIT 10 to the SQL query (#32065)
  [test] turn on host io cache for opensuse (#32053)
  Tweaked Elasticsearch Service links for SEO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring v6.4.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants