Commit Graph

3081 Commits

Author SHA1 Message Date
Uwe Schindler 9731d5d314 painless: Rename the dynamic call site factory to DefBootstrap and make the inner class very short (PIC = Polymorphic Inline Cache) 2016-05-13 19:58:05 +02:00
Lee Hinman 9bcdafedda Allow only a single extension for a scripting engine
Previously multiple extensions could be provided, however, this can lead
to confusion with on-disk scripts (ie, "foo.js" and "foo.javascript")
having different content. Only a single extension is now supported.

The only language currently supporting multiple extensions was the
Javascript engine ("js" and "javascript"). It now only supports the
`.js` extension.

Relates to #10598
2016-05-13 09:54:31 -06:00
Lee Hinman d5b75491dc Merge remote-tracking branch 'dakrone/remove-script-sandbox' 2016-05-13 09:50:39 -06:00
Nik Everett 0a300320cd [test] Set logging to 11 on reindex test
It has failures we can't explain and we need logs to be able to do
anything useful with the failures:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+g1gc/359/consoleFull
2016-05-13 11:48:01 -04:00
Lee Hinman efff3918d8 Remove support for mulitple languages per scripting engine 2016-05-13 09:24:31 -06:00
Lee Hinman a4060f7436 Remove vestiges of script engine sandboxing
This removes all the mentions of the sandbox from the script engine
services and permissions model. This means that the following settings
are no longer supported:

```yaml
script.inline: sandbox
script.stored: sandbox
```

Instead, only a `true` or `false` value can be specified.

Since this would otherwise break the default-allow parameter for
languages like expressions, painless, and mustache, all script engines
have been updated to have individual settings, for instance:

```yaml
script.engine.groovy.inline: true
```

Would enable all inline scripts for groovy. (they can still be
overridden on a per-operation basis).

Expressions, Painless, and Mustache all default to `true` for inline,
file, and stored scripts to preserve the old scripting behavior.

Resolves #17114
2016-05-13 09:24:31 -06:00
Adrien Grand 638da06c1d Add back support for `ip` range aggregations. #17859
This commit adds support for range aggregations on `ip` fields. However it will
only work on 5.x indices.

Closes #17700
2016-05-13 17:22:01 +02:00
Robert Muir 520697eb14 Merge pull request #18323 from uschindler/dynamiccallsite_cleanup
painless: cleanup of DynamicCallSite
2016-05-13 11:19:27 -04:00
Uwe Schindler a1d0fb5008 painless: cleanup of DynamicCallSite to have all implementation encapsulated in inner class, outer class only has bootstrap method 2016-05-13 15:50:55 +02:00
Daniel Mitterdorfer ddbfda2c68 Exclude specific transport actions from request size limit check
We add support to explicitly exclude specific transport actions
from the request size limit check.

We also exclude the following request types currently:

*MasterPingRequest
* PingRequest
2016-05-13 14:21:24 +02:00
Jack Conradson 2e25837deb Made line number available in painless nodes for debugging. 2016-05-12 10:32:06 -07:00
Jack Conradson 28164ccf2e Decouple the ANTLR AST from Painless.
Closes #18286
2016-05-12 00:46:48 -07:00
Robert Muir 113e239e0f Merge pull request #18288 from rmuir/painless_debug
painless: add debugging tool to tests
2016-05-12 01:16:32 -04:00
Jack Conradson 8871fddba7 Merge pull request #18282 from jdconrad/longs
Long priority over Float
2016-05-11 21:08:28 -07:00
Robert Muir 930a215b5c add debugger 2016-05-11 23:56:19 -04:00
Robert Muir 25dd64250b painless: remove input, support params instead 2016-05-11 21:32:10 -04:00
Robert Muir c5532d3df0 add a rest test for this that seems to work, fix the documentation. thanks @s1monw 2016-05-11 16:07:08 -04:00
Robert Muir 6b4e47bf96 this makes aggregations per-document _value fast (bypass hash put, hash get, etc) for painless.
but i have no clue how to test it, it seems this feature never worked via REST?

Should we drop the feature instead?
2016-05-11 15:39:00 -04:00
Jack Conradson 20af482dd7 Removed extra branches. Only check for long first where we already know the
second type.
2016-05-11 10:22:40 -07:00
Jack Conradson 2764b47d22 Give long priority over float in Def math calcs. Promotion of types
still works correclty.
2016-05-11 09:32:30 -07:00
Robert Muir d790c76636 painless: _score as double, not float 2016-05-11 11:19:18 -04:00
Tanguy Leroux 6d288dec11 Clean up tests in Reindex module 2016-05-11 09:54:52 +02:00
Robert Muir 7689a1af28 Add 'ctx' keyword to painless. 2016-05-11 02:31:19 -04:00
Jack Conradson d8b373cac6 Fixed an issue related to bracket shortcuts. 2016-05-10 23:11:13 -07:00
Robert Muir 632bb4c720 add reserved word tests for 'doc', too 2016-05-11 00:17:19 -04:00
Robert Muir 389ef462c4 special access to doc 2016-05-10 23:43:57 -04:00
Robert Muir abb015bcb9 add tests for reserved words. ban stores against _score 2016-05-10 22:55:06 -04:00
Robert Muir a63285aaf9 painless: retrieve _score directly from Scorer 2016-05-10 20:53:08 -04:00
Robert Muir 1d80542199 Merge pull request #18247 from rmuir/needsScore
painless: implement needsScore() correctly.
2016-05-10 19:21:09 -04:00
Robert Muir ddc2c1f682 Merge pull request #18234 from rmuir/more_indy_type_data
painless: use better typing for dynamic method calls
2016-05-10 19:17:13 -04:00
Robert Muir 1c2d3b10ef some cleanups suggested by @uschindler and break some long lines 2016-05-10 12:31:02 -04:00
Robert Muir eb1b2cf111 add test and cleanup 2016-05-10 11:34:33 -04:00
Robert Muir 7a47d33a9b Merge branch 'master' into needsScore 2016-05-10 11:23:50 -04:00
Robert Muir 546aed8390 hack 2016-05-10 11:23:24 -04:00
Uwe Schindler 243c9e77fa painless: Add synthetic length property as alias to Lists, so they can really be used like arrays 2016-05-10 15:01:49 +02:00
Uwe Schindler 2e613f49b3 painless: Array load/store and length with invokedynamic 2016-05-10 12:41:27 +02:00
Robert Muir 3aeb66885b painless: use better typing for dynamic method calls 2016-05-10 05:44:16 -04:00
Robert Muir ba2fe156e8 Switch over dynamic method calls, loads and stores to invokedynamic.
Remove performance hack for accessing a document's fields, its not needed.
Add support for accessing is-getter methods like List.isEmpty() as .empty

Closes #18201
2016-05-09 21:44:32 -04:00
Tanguy Leroux 8c52e8814b Remove ReindexResponse in favor of BulkIndexByScrollResponse 2016-05-09 17:03:16 +02:00
Chris Earle 5be79ed02c Add Failure Details to every NodesResponse
Most of the current implementations of BaseNodesResponse (plural Nodes) ignore FailedNodeExceptions.

- This adds a helper function to do the grouping to TransportNodesAction
- Requires a non-null array of FailedNodeExceptions within the BaseNodesResponse constructor
- Reads/writes the array to output
- Also adds StreamInput and StreamOutput methods for generically reading and writing arrays
2016-05-06 14:59:43 -04:00
Adrien Grand 7d8708716e QueryBuilder does not need generics. #18133
QueryBuilder has generics, but those are never used: all call sites use
`QueryBuilder<?>`. Only `AbstractQueryBuilder` needs generics so that the base
class can contain a default implementation for setters that returns `this`.
2016-05-06 08:38:20 +02:00
Robert Muir e3ce6c9048 Painless: add fielddata accessors (.value/.values/.distance()/etc)
This gives better coverage and consistency with the scripting APIs, by
whitelisting the primary search scripting API classes and using them instead
of only Map and List methods.

For example, accessing fields can now be done with `.value` instead of `.0`
because `getValue()` is whitelisted. For now, access to a document's fields in
this way (loads) are fast-pathed in the code, to avoid dynamic overhead.

Access to geo fields and geo distance functions is now supported.

TODO: date support (e.g. whitelist ReadableDateTime methods as a start)
TODO: improve docs (like expressions and groovy have for document's fields)
TODO: remove fast-path hack

Closes #18169

Squashed commit of the following:

commit ec9f24b2424891a7429bb4c0a03f9868cba0a213
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 17:59:37 2016 -0400

    cutover to <Def> instead of <Object> here

commit 9edb1550438acd209733bc36f0d2e0aecf190ecb
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 17:03:02 2016 -0400

    add fast-path for docvalues field loads

commit f8e38c0932fccc0cfa217516130ad61522e59fe5
Author: Robert Muir <rmuir@apache.org>
Date:   Thu May 5 16:47:31 2016 -0400

    Painless: add fielddata accessors (.value/.values/.distance()/etc)
2016-05-05 18:38:41 -04:00
Jack Conradson 2cae575f53 Added single-quoted strings.
Closes #18150
2016-05-05 09:26:02 -07:00
Robert Muir 59c135b58d make internal Def methods private and add basic javadocs 2016-05-05 03:47:56 -04:00
Robert Muir 928e2b904d painless: optimize/simplify dynamic field and method access 2016-05-05 03:42:14 -04:00
Jason Tedor 784c9e5fb9 Introduce node handshake
This commit introduces a handshake when initiating a light
connection. During this handshake, node information, cluster name, and
version are received from the target node of the connection. This
information can be used to immediately validate that the target node is
a member of the same cluster, and used to set the version on the
stream. This will allow us to extend APIs that are used during initial
cluster recovery without a major version change.

Relates #15971
2016-05-04 20:06:47 -04:00
Nik Everett 230697c202 [reindex] Switch throttle to Float.POSITIVE_INFITINTY/"unlimited"
All other values are errors.

Add java test for throttling. We had a REST test but it only ran against
one node so it didn't catch serialization errors.

Add Simple round trip test for rethrottle request
2016-05-04 16:14:32 -04:00
Christoph Büscher ca21aa0cb5 Make reset() in QueryShardContext private
The query shard reset() method resets some internal state in the
query shard context, like clearing query names, the filter flag
or named queries. The problem with this method being public is
that it currently (miss?) used for modifying an existing context
for recursive invocatiob, but the contexts that have been reseted
that way cannot be properly set back to their previous state.

This PR is a step towards removing reset() entirely by first making
it only be used internally in QueryShardContext. In places where
reset() was used we can either create new QueryShardContexts or
modify the existing context because it is discarded afterwards anyway.
2016-05-03 18:56:16 +02:00
Robert Muir fff82db681 Add tests/doc for boolean fields with expressions 2016-05-02 18:13:03 -04:00
Robert Muir 693c1f6671 Support geo_point fields in lucene expressions.
Closes #18096
2016-05-02 17:49:21 -04:00