Commit Graph

3258 Commits

Author SHA1 Message Date
Uwe Schindler c08b45a277 More cleanup 2016-06-11 21:20:39 +02:00
Robert Muir 65352face2 fix too long line 2016-06-11 15:04:49 -04:00
Robert Muir 592042601f def case working 2016-06-11 15:02:43 -04:00
Uwe Schindler 876f0a613e Unfuck the MethodWriter nesting. All MethodWriters should only live separately from each other, no nesting 2016-06-11 21:00:06 +02:00
Robert Muir e2f999b025 make this static final 2016-06-11 14:33:48 -04:00
Robert Muir 8d5a70200f write refs for functions 2016-06-11 14:29:15 -04:00
Robert Muir ab457be9d8 remove unnecessary semicolon and return 2016-06-11 13:48:04 -04:00
Robert Muir 0bfb166eeb merge master 2016-06-11 13:23:17 -04:00
Nik Everett 4a265d0279 Painless: Add } as a delimiter. Kindof.
Add `}` is statement delimiter but only in places where it is
otherwise a valid part of the syntax, specificall the end of a block.
We do this by matching but not consuming it. Antlr 4 doesn't have
syntax for this so we have to kind of hack it together by actually
matching the `}` and then seeking backwards in the token stream to
"unmatch" it. This looks reasonably efficient. Not perfect, but way
better than the alternatives.

I tried and rejected a few options:
1. Actually consuming the `}` and piping a boolean all through the
grammar from the last statement in a block to the delimiter. This
ended up being a rather large change and made the grammar way more
complicated.
2. Adding a semantic predicate to delimiter that just does the
lookahead. This doesn't work out well because it doesn't work (I
never figured out why) and because it generates an *amazing*
`adaptivePredict` which makes a super huge DFA. It looks super
inefficient.

Closes #18821
2016-06-11 12:51:25 -04:00
Jack Conradson e293000d8d Merge branch 'master' into stubby 2016-06-10 16:22:17 -07:00
Jack Conradson bd94c62adf Added a stub node for lambda expressions. 2016-06-10 16:18:36 -07:00
Nik Everett 387155559e Make TimeValue Writeable instead of Streamable
Writeable is better for immutable objects like TimeValue.

Switch to writeZLong which takes up less space than the original
writeLong in the majority of cases. Since we expect negative
TimeValues we shouldn't use
writeVLong.
2016-06-10 18:24:16 -04:00
Robert Muir 16d17351f7 don't use loadLocal, add new node to package-info 2016-06-10 17:37:57 -04:00
Robert Muir 9e0a70c4b2 Merge branch 'master' into capturingReferences 2016-06-10 17:10:56 -04:00
Jack Conradson f98be6fa06 Add functions to Painless.
Closes #18810
2016-06-10 13:59:59 -07:00
Robert Muir edb0fd3b88 painless: add capturing method references 2016-06-10 14:24:58 -04:00
Jason Tedor 6d8692576e Mark field in ReindexSameIndexTests as final
This commit restores a final modifier on the field
AutoCreateIndex#AUTO_CREATE_INDEX that was inadvertently removed in
a25b8ee1bf.
2016-06-10 10:20:45 -04:00
Adrien Grand 44c653f5a8 Upgrade to lucene-6.1.0-snapshot-3a57bea. 2016-06-10 16:18:12 +02:00
Jason Tedor a25b8ee1bf Make random UUIDs reproducible in tests
Today we use a random source of UUIDs for assigning allocation IDs,
cluster IDs, etc. Yet, the source of randomness for this is not
reproducible in tests. Since allocation IDs end up as keys in hash maps,
this means allocation decisions and not reproducible in tests and this
leads to non-reproducible test failures. This commit modifies the
behavior of random UUIDs so that they are reproducible under tests. The
behavior for production code is not changed, we still use a true source
of secure randomness but under tests we just use a reproducible source
of non-secure randomness.

It is important to note that there is a test,
UUIDTests#testThreadedRandomUUID that relies on the UUIDs being truly
random. Thus, we have to modify the setup for this test to use a true
source of randomness. Thus, this is one test that will never be
reproducible but it is intentionally so.

Relates #18808
2016-06-10 10:18:06 -04:00
Robert Muir 6202b63ba7 Merge pull request #18789 from rmuir/java9_localdate_you_just_had_to_do_this_didnt_you
painless: exempt LocalDate from bridge method checks on java 9
2016-06-08 17:38:28 -04:00
Robert Muir 9826b64e1f Exempt LocalDate from bridge method checks on java 9
The painless whitelist has a lot of self-checking, in this case, it checks
for missing covariant overrides. It fails on java 9, because LocalDate.getEra()
now returns IsoEra instead of Era: https://bugs.openjdk.java.net/browse/JDK-8072746

To our checker, it thinks we were lazy with whitelisting :)

This means painless works on java 9 again
2016-06-08 15:47:09 -04:00
Nik Everett bd1af34506 [reindex] Extract runnable to inner class
Makes it more readable
2016-06-08 14:00:15 -04:00
Nik Everett 2437313e4e Remove extra logging
The test shouldn't be failing any more.
2016-06-08 13:52:43 -04:00
Nik Everett 5b94c4a25b Fix a race condition in reindex's rethrottle
If you rethrottled the request while is was performing a scroll
request then it wouldn't properly pick up the rethrottle for that
batch. This was causing test failure and might cause issues for
users. The work around is simple though: just issue the rethrottle
again with a slightly faster throttle than the first time.

Caught by:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+multijob-os-compatibility/os=centos/525/console
2016-06-08 13:52:43 -04:00
Nik Everett 4b21157906 Remove setRefresh
It has been replaced with `setRefreshPolicy` which has support for
waiting until refresh with `setRefreshPolicy(WAIT_FOR)`.

Related to #1063
2016-06-08 13:50:59 -04:00
Jack Conradson be168f528b Merge pull request #18771 from jdconrad/methods
Add Method to Get New MethodWriters
2016-06-07 11:47:29 -07:00
Jack Conradson f9b45107c4 Added method to allow creation of new methods on-the-fly. 2016-06-07 11:24:33 -07:00
Robert Muir 90f2aab9a9 Merge pull request #18748 from rmuir/painless_method_references
painless: method reference support
2016-06-07 14:22:49 -04:00
Robert Muir f23e8c3722 more cleanups 2016-06-07 12:42:19 -04:00
Robert Muir 89224dbc3c switch FunctionRef over to methodhandles 2016-06-07 11:56:44 -04:00
Martijn van Groningen f611f1c99e ingest: Move processors from core to ingest-common module.
Folded grok processor into ingest-common module.

The rest tests have been moved to ingest-common module as well, because these tests don't run in the rest-api-spec module but in the distribution:integ-test-zip module
and adding a test plugin there felt just wrong to me. I think this is ok. I left a tiny ingest rest test behind in that tests with an empty pipeline.

Removed messy tests, these tests were already covered in the rest tests

Added ingest test plugin in test infra so that each module testing integration with ingest doesn't need write its own plugin

Moved reindex ingest tests to qa module

Closes #18490
2016-06-07 17:32:52 +02:00
Robert Muir 32965f043a convert FunctionRef/Def usage to methodhandles. 2016-06-07 10:23:49 -04:00
Robert Muir 3108c399f0 use painless types in FunctionRef 2016-06-07 09:49:54 -04:00
Robert Muir 39550354a7 compute functional interface stuff in Definition 2016-06-07 09:41:03 -04:00
Uwe Schindler 3238868cc4 Make checkstyle happy (add Lookup import, line length) 2016-06-07 13:06:23 +02:00
Uwe Schindler cac111ff73 Don't hide LambdaConversionException and behave like real javac compiled code when a conversion fails. This works anyways, because fallback is allowed to throw any Throwable 2016-06-07 13:00:36 +02:00
Uwe Schindler 6913be2ec2 Pass through the lookup given by invokedynamic to the LambdaMetaFactory. Without it real lambdas won't work, as their implementations are private to script class 2016-06-07 12:32:59 +02:00
Robert Muir 950b093fc7 Merge branch 'master' into painless_method_references 2016-06-06 22:39:28 -04:00
Jason Tedor da74323141 Register thread pool settings
This commit refactors the handling of thread pool settings so that the
individual settings can be registered rather than registering the top
level group. With this refactoring, individual plugins must now register
their own settings for custom thread pools that they need, but a
dedicated API is provided for this in the thread pool module. This
commit also renames the prefix on the thread pool settings from
"threadpool" to "thread_pool". This enables a hard break on the settings
so that:
 - some of the settings can be given more sensible names (e.g., the max
   number of threads in a scaling thread pool is now named "max" instead
   of "size")
 - change the soft limit on the number of threads in the bulk and
   indexing thread pools to a hard limit
 - the settings names for custom plugins for thread pools can be
   prefixed (e.g., "xpack.watcher.thread_pool.size")
 - remove dynamic thread pool settings

Relates #18674
2016-06-06 22:09:12 -04:00
Jack Conradson b3804c47f7 Cleaned up SEach node. 2016-06-06 18:21:08 -07:00
Robert Muir 231268c89d remove outdated TODO 2016-06-06 21:04:59 -04:00
Jack Conradson 6dace47c1f Reverted S-node design change. 2016-06-06 17:59:39 -07:00
Robert Muir 8db9a971e5 enable test 2016-06-06 20:30:42 -04:00
Robert Muir 2852e82ab9 add def iteration over arrays 2016-06-06 20:07:32 -04:00
Robert Muir d331f8768e implement dynamic case for iterables 2016-06-06 19:41:37 -04:00
Jack Conradson aeaf39f36d Added a for each stub node for a target type of def. 2016-06-06 16:07:12 -07:00
Jack Conradson a088d367f7 More comments. 2016-06-06 15:58:56 -07:00
Jack Conradson f897342296 Updated package info documentation. 2016-06-06 15:34:51 -07:00
Jack Conradson 9a78f6955b Added foreach for array types. 2016-06-06 15:25:09 -07:00
Robert Muir 23d7cdd043 ban slow methods in MethodHandle 2016-06-06 17:58:00 -04:00