Skip to content

Add 'ctx' keyword to painless.#18264

Merged
rmuir merged 1 commit intoelastic:masterfrom
rmuir:painless_ctx
May 11, 2016
Merged

Add 'ctx' keyword to painless.#18264
rmuir merged 1 commit intoelastic:masterfrom
rmuir:painless_ctx

Conversation

@rmuir
Copy link
Copy Markdown
Contributor

@rmuir rmuir commented May 11, 2016

This is used by ExecutableScripts (e.g. update scripts) and currently must be accessed as input.ctx which makes it different in painless from other scripting engines.

It has a known type Map<String,Object>, which is better than nothing: we get performance benefits from the additional typing.

If ctx is ever accessed in the script, we do a single hashmap get into a read-only local variable.

@jdconrad
Copy link
Copy Markdown
Contributor

LGTM!

@rmuir rmuir merged commit fe05ee8 into elastic:master May 11, 2016
@jdconrad jdconrad mentioned this pull request May 12, 2016
18 tasks
@clintongormley clintongormley added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Plugin Lang Painless labels Feb 14, 2018
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 >enhancement v5.0.0-alpha3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants