Commit Graph

23098 Commits

Author SHA1 Message Date
Simon Willnauer 7df5d05c62 Simplify SubFetchPhase interface (#18881)
This interface used to have dedicated methods to prevent calling execute
methods. These methods are unnecessary as the checks can simply be
done inside the execute methods itself. This simplifies the interface
as well as its usage.
2016-06-15 15:49:11 +02:00
Robert Muir b71f42a627 split MIC from PIC 2016-06-15 09:07:11 -04:00
Nik Everett e09b6d7ba1 Test: Remove and untrue assertion
Task status might change between list and get.
2016-06-15 09:02:36 -04:00
David Pilato 63223928dc Merge branch 'master' into pr/update-aws-sdk 2016-06-15 14:48:41 +02:00
Daniel Mitterdorfer f32b700472 Exclude admin / diagnostic requests from HTTP request limiting
With this commit we exclude certain HTTP requests that are needed to inspect the cluster
from HTTP request limiting to ensure these commands are processed even in critical
memory conditions.

Relates #17951, relates #18145, closes #18833
2016-06-15 14:29:46 +02:00
javanna ace3a7b146 Merge branch 'master' into feature/http_client 2016-06-15 11:44:46 +02:00
javanna 7c8013f9fd Build: remove explicit targetCompatibility from forbiddenapis config
targetCompatibility set to the project is enough.
2016-06-15 11:43:48 +02:00
Martijn van Groningen a2ad5c0282 docs: fix typo
Closes #18877
2016-06-15 10:56:46 +02:00
Simon Willnauer 0f87afe2bf [TEST] Fix Highlighters assertion - not guice injected anymore 2016-06-15 09:26:34 +02:00
Simon Willnauer 429dd3a876 Simplify FetchSubPhase registration and detach it from Guice (#18862)
this commit removes FetchSubPhrase registration by class to registration
by instance. No Guice binding needed anymore.
2016-06-15 09:13:02 +02:00
Ryan Ernst 1ecf14cee0 Add test for plugin install heuristic 2016-06-14 23:42:49 -07:00
Ryan Ernst 6db323164e Plugins: Emit nicer error message when trying to install unknown plugin
When installing plugins, we first try the elastic download service for
official plugins, then try maven coordinates, and finally try the
argument as a url. This can lead to confusing error messages about
unknown protocols when eg an official plugin name is mispelled. This
change adds a heuristic for determining if the argument in the final
case is in fact a url that we should try, and gives a simplified error
message in the case it is definitely not a url.

closes #17226
2016-06-14 23:42:34 -07:00
Robert Muir 2b1ebc55a9 remove null guards from +, if not needed.
improve DefBootstrapTests
2016-06-14 23:52:21 -04:00
Ryan Ernst fa77d4d885 Test: make secure mock setup work with ibm jdk 2016-06-14 18:46:43 -07:00
Jason Tedor e96722d91c Add search preference to prefer multiple nodes
The search preference _prefer_node allows specifying a single node to
prefer when routing a request. This functionality can be enhanced by
permitting multiple nodes to be preferred. This commit replaces the
search preference _prefer_node with the search preference _prefer_nodes
which supplants the former by specifying a single node and otherwise
adds functionality.

Relates #18872
2016-06-14 21:34:24 -04:00
Robert Muir 5e4b2f2815 clean up compound assignment tests, fix shift bug 2016-06-14 20:40:16 -04:00
Robert Muir cd4f4594d6 fix perf bug with xor promotion 2016-06-14 19:19:50 -04:00
Nik Everett d0e4485d42 Move NamingConventionsCheck into buildSrc
This will let things that don't depend on :test:framework like the
client use it.

Also skip initializing the classes we check because we don't care
about their initialization behavior because we're not executing them.
This makes the naming conventions check pretty close to instant
from a "human eye" perspective.
2016-06-14 18:30:34 -04:00
Jack Conradson f132a8f1c8 Merge pull request #18871 from jdconrad/cast
Fix Casting Bug
2016-06-14 14:45:26 -07:00
Martijn van Groningen 14d6b04944 test: don't return 0, at least one request must be added to msearch request
also the maxConcurrentSearchRequests() setter only support positive values.
2016-06-14 23:29:29 +02:00
Jack Conradson 5cef06fa3e Add a test. 2016-06-14 14:28:47 -07:00
Nik Everett f7f377791f Test: don't use 0 size for terms aggregation
It is no longer allowed.
2016-06-14 17:27:45 -04:00
javanna 70fb67cc7b Build: targetCompatibility and sourceCompatibility are enough to make sure we compile client and client-sniffer with target and source 1.7 2016-06-14 23:16:38 +02:00
Jack Conradson 36f7632232 Correct type checking during casting related to Object. 2016-06-14 14:12:23 -07:00
Nik Everett c8931768ba Clean up after test failure
If the test fails we properly clean up. Also add a toString
implementation so we get useful results on failure.
2016-06-14 16:16:19 -04:00
Robert Muir 2ebc5c342b Merge pull request #18867 from rmuir/more_indy_typing
improve unary operators and cleanup tests
2016-06-14 15:30:43 -04:00
Robert Muir b69e8aadbd refactor tests 2016-06-14 15:07:56 -04:00
Nik Everett 9c85569883 Test docs for plugins
We weren't doing it before because we weren't starting the plugins.
Now we are.

The hardest part of this was handling the files the tests expect
to be on the filesystem. extraConfigFiles was broken.
2016-06-14 14:32:29 -04:00
Ryan Ernst 399d023715 Merge pull request #18865 from rjernst/fix_extra_config_file
Test: Fix integ test extra config files to work with more than one
2016-06-14 10:59:26 -07:00
Nik Everett 3032a7c653 Cache FieldStats
This caches FieldStats at the field level. For one off requests or for
few indicies this doesn't save anything, but when there are 30 indices,
5 shards, 1 replica, 100 parallel requests this is about twice as fast
as not caching. I expect lots of usage won't see much benefit from this
but pointing kibana to a cluster with many indexes and shards, will be
faster.

Closes #18717
2016-06-14 13:57:18 -04:00
Ryan Ernst 0508fc3bf1 Test: Fix integ test extra config files to work with more than one
Groovy does some crazy capturing when using closures inside a loop. In
this case, it somehow decided the local loop variable would be
modified, and so each closure was getting a wrapped value that would be
updated on each loop iteration, until all the closures pointed at the
last value. This change fixes the loop to extract the object to be used by
the closures.
2016-06-14 10:54:50 -07:00
Nik Everett e392e0b1df Create get task API that falls back to the .tasks index
This adds a get task API that supports GET /_tasks/${taskId} and
removes that responsibility from the list tasks API. The get task
API supports wait_for_complation just as the list tasks API does
but doesn't support any of the list task API's filters. In exchange,
it supports falling back to the .results index when the task isn't
running any more. Like any good GET API it 404s when it doesn't
find the task.

Then we change reindex, update-by-query, and delete-by-query to
persist the task result when wait_for_completion=false. The leads
to the neat behavior that, once you start a reindex with
wait_for_completion=false, you can fetch the result of the task by
using the get task API and see the result when it has finished.

Also rename the .results index to .tasks.
2016-06-14 13:37:34 -04:00
Robert Muir e4dc469e58 Merge pull request #18849 from rmuir/give_indy_ops_types
Remove casts and boxing for dynamic math
2016-06-14 13:01:04 -04:00
Robert Muir 79f0ab2fc6 rename this variable 2016-06-14 12:51:29 -04:00
Simon Willnauer ee2ba13cce Register Highlighter instances instead of classes (#18859)
This change detaches highlighter registration from Guice. It's just a
small step into the right direction.
2016-06-14 17:04:58 +02:00
Colin Goodheart-Smithe d7e3f9e4eb #18854 Remove size 0 options in aggregations
Remove size 0 options in aggregations
2016-06-14 15:32:42 +01:00
Christoph Büscher 32f141223d Merge pull request #18800 from cbuescher/fix-interval-rounding-uneven
Fix invalid rounding value for TimeIntervalRounding close to DST transitions
2016-06-14 16:22:11 +02:00
Nik Everett 49c09f1527 Test: Fix error message check for Windows
Betrayal! CRLF strikes again. Weakened the test from equals to
containsString.
2016-06-14 09:56:49 -04:00
Christoph Büscher 03f5aa8ea0 Don't throw IllegalInstantException to determine DST gap
By taking the logic from DateTimeZone#convertLocalToUTC(long, boolean) we
can avoid throwing the exception.
2016-06-14 15:36:00 +02:00
Simon Willnauer 4d78f280ed Remove dead code and dead parameters (#18855) 2016-06-14 15:25:44 +02:00
Christoph Büscher 5abe1f7bb2 Fix invalid rounding value for TimeIntervalRounding close to DST transition
There are edge cases where rounding a date to a certain interval using a time
zone with DST shifts can currently cause the rounded date to be bigger than the
original date. This happens when rounding a date closely after a DST start and
the rounded date falls into the DST gap.

Here is an example for CET time zone, where local time is set forward by one
hour at 2016-03-27T02:00:00+01:00 to 2016-03-27T03:00:00.000+02:00:

The date 2016-03-27T03:01:00.000+02:00 (1459040460000) which is just after the
DST change is first converted to local time (1459047660000). If we then apply
interval rounding for a 14m interval in local time, this  takes us to
1459047240000, which unfortunately falls into the DST gap.  When converting
this back to UTC, joda provides options to throw exceptions on illegal dates
like this, or correct this by adjusting the date to the new time zone offset.
We currently do the later, but this leads to converting this illegal date back
to 2016-03-27T03:54:00.000+02:00 (1459043640000), giving us a date that is
larger than the original date we wanted to round.

This change fixes this by using the "strict" option of 'convertLocalToUTC()'
to detect rounded dates that fall into the DST gap. If this happens, we can use
the time of the DST change instead as the interval start.

Even before this change, intervals around DST shifts like this can be shorter
than the desired interval.  This, for example, happens when the requested
interval width doesn't completely fit into the remaining time span when the DST
shift happens. For example, using a 14m interval in UTC+1 (CET before DST
starts) leads to the following valid rounding values around the time where DST
happens:

2016-03-27T01:30:00+01:00
2016-03-27T01:44:00+01:00
2016-03-27T01:58:00+01:00
2016-03-27T02:12:00+01:00
2016-03-27T02:26:00+01:00
...

while the rounding values in UTC+2 (CET after DST start) are placed like this
around the same time:

2016-03-27T02:40:00+02:00
2016-03-27T02:54:00+02:00
2016-03-27T03:08:00+02:00
2016-03-27T03:22:00+02:00
...

From this we can see then when we switch from UTC+1 to UTC+2 at 02:00 the last
rounding value in UTC+1 is at 01:58 and the first valid one in UTC+2 is at
03:08, so even if we decide to put all the dates in between into one rounding
interval, it will only cover 10 minutes. With this change we choose to use the
moment of DST shift as an aditional interval separator, leaving us with a 2min
interval from [01:58,02:00) before the shift and an 8min interval from
[03:00,03:08) after the shift.

This change also adds tests for the above example and adds randomization to the
existing TimeIntervalRounding tests.
2016-06-14 14:59:51 +02:00
Colin Goodheart-Smithe bec621d46f changes from review 2016-06-14 13:45:03 +01:00
Clinton Gormley f5836951f8 Fixed link in PR template to CONTRIBUTING 2016-06-14 14:34:11 +02:00
Vladimir Kovpak d5f71f9e85 Updated from parameter description. (#18852)
Not sure that my description better but origin description looks very weird,
and i try to make emphasize to offset...
2016-06-14 14:33:15 +02:00
Itamar Syn-Hershko 5a9303dec2 Fixing typos (#18851) 2016-06-14 14:22:55 +02:00
javanna cf93e904e3 remove message parameter from RequestLogger methods
This prevents useless string allocation.
2016-06-14 14:14:03 +02:00
Colin Goodheart-Smithe cfd3356ee3 Remove size 0 options in aggregations
This removes the ability to set `size: 0` in the `terms`, `significant_terms` and `geohash_grid` aggregations for the reasons described in https://github.com/elastic/elasticsearch/issues/18838

Closes #18838
2016-06-14 13:07:02 +01:00
javanna 1932f6bc7c Rename RequestLogger#log methods to distinguish between the two
One method is to log a request that yielded a response, the other one for a failed request
2016-06-14 13:45:38 +02:00
javanna caa6c96259 Build: make client and client-sniffer depend on lucene-test version 5, last 1.7 compatible version 2016-06-14 09:43:31 +02:00
Robert Muir a12937d548 painless: remove casts and boxing for dynamic math 2016-06-14 00:49:13 -04:00