22494 Commits

Author SHA1 Message Date
javanna
467dfbda0c use TimeUnit and long to keep track of time 2016-06-06 15:12:13 +02:00
javanna
a461dd84d2 Build: add hamcrest and securemock to version.properties 2016-06-06 15:02:52 +02:00
Nicholas Knize
371c73e140 refactor matrix agg documentation from modules to main agg section 2016-06-06 07:39:00 -05:00
Tanguy Leroux
a1172d816c Implement ctx.op = "delete" on _update_by_query and _reindex
closes #18043
2016-06-06 11:11:29 +02:00
Tanguy Leroux
4ca04d6f6c Close SearchContext if query rewrite failed
If a query failed to be rewritten and throws an exception, the SearchContext is not properly closed, skewing the ref count on the underlying Store.
2016-06-06 09:40:56 +02:00
Nik Everett
08f7f79b2e Wrap lines at 140 characters (:qa projects) 2016-06-05 15:55:44 -04:00
javanna
05e26a46d7 raise default socket timeout to 10s and default connect timeout to 1s 2016-06-04 01:06:18 +02:00
javanna
56e689e1b3 [TEST] remove unused method 2016-06-04 01:05:53 +02:00
javanna
f2318ed5ae Build: add missing licenses, SHAs and enable dependency licenses check 2016-06-04 00:56:42 +02:00
Robert Muir
619b8831f9 Merge pull request #18734 from uschindler/painless_arraylength_java9_factory
painless: Add support for the new Java 9 MethodHandles#arrayLength() factory
2016-06-03 18:21:30 -04:00
javanna
b15279b5ef Allow to pass socket facttry registry to createDefaultHttpClient method 2016-06-03 23:59:26 +02:00
Nik Everett
b79fd4c360 Remove log file
Looks like accidentally committed.
2016-06-03 17:56:53 -04:00
Uwe Schindler
c0a3a20071 painless: Add support for the new Java 9 MethodHandles#arrayLength() factory (see https://bugs.openjdk.java.net/browse/JDK-8156915) 2016-06-03 23:35:11 +02:00
javanna
b891c46657 [TEST] remove status matcher and hasStatus assertion
All it does is checking the status code of a response, which can be done with a single line in each test
2016-06-03 23:25:17 +02:00
Jason Tedor
34f4e386df Merge pull request #17335 from rjernst/placeholder
Cleanup placeholder replacement
2016-06-03 16:34:42 -04:00
Jason Tedor
be0036542c More complete exception message in settings tests
This commit adds additional details to the exception message assertions
in the YAML settings loader tests.
2016-06-03 16:18:46 -04:00
Stefan Scherer
92c6d78d4a Use java from path if JAVA_HOME is not set
This commit adds support to the Windows scripts for finding java.exe via
the path if JAVA_HOME is not set.

Relates #18685
2016-06-03 15:30:18 -04:00
Jason Tedor
974c753bf6 Fix uncaught checked exception in AzureTestUtils
This commit fixes an uncaught checked IOException now thrown in
AzureTestUtils after 3adaf096758a6015ca4f733e2e49ee5528ac3cd5.
2016-06-03 14:17:25 -04:00
Jason Tedor
bbd5f26d45 Merge branch 'master' into rjernst-placeholder
* master: (911 commits)
  [TEST] wait for yellow after setup doc tests (#18726)
  Fix recovery throttling to properly handle relocating non-primary shards (#18701)
  Fix merge stats rendering in RestIndicesAction (#18720)
  [TEST] mute RandomAllocationDeciderTests.testRandomDecisions
  Reworked docs for index-shrink API (#18705)
  Improve painless compile-time exceptions
  Adds UUIDs to snapshots
  Add test rethrottle test case for delete-by-query
  Do not start scheduled pings until transport start
  Adressing review comments
  Only filter intial recovery (post API) when shrinking an index (#18661)
  Add tests to check that toQuery() doesn't return null
  Removing handling of null lucene query where we catch this at parse time
  Handle empty query bodies at parse time and remove EmptyQueryBuilder
  Mute failing assertions in IndexWithShadowReplicasIT until fix
  Remove allow running as root
  Add upgrade-not-supported warning to alpha release notes
  remove unrecognized javadoc tag from matrix aggregation module
  set ValuesSourceConfig fields as private
  Adding MultiValuesSource support classes and documentation to matrix stats agg module
  ...
2016-06-03 13:32:03 -04:00
javanna
f17f0f9247 rename ElasticsearchResponse#getFirstHeader to getHeader 2016-06-03 18:28:31 +02:00
javanna
29eee328fe [TEST] expand RequestLoggerTests to all the supported http methods 2016-06-03 18:23:52 +02:00
javanna
c48b7a7a97 [TEST] create standard RestClient at first request and reuse it
A RestClient instance is now created whenever EsIntegTestCase#getRestClient is invoked for the first time. It is then kept until the cluster is cleared (depending on the cluster scope of the test).

Renamed other two restClient methods to createRestClient, as that instance needs to be closed and managed in the tests.
2016-06-03 18:21:19 +02:00
javanna
23a94bb974 [TEST] create standard RestClient at first request and reuse it
A RestClient instance is now created whenever EsIntegTestCase#getRestClient is invoked for the first time. It is then kept until the cluster is cleared (depending on the cluster scope of the test).

Renamed other two restClient methods to createRestClient, as that instance needs to be closed and managed in the tests.
2016-06-03 18:00:54 +02:00
javanna
f5825b86e6 [TEST] restore needed LogManager.reset to prevent logging to sysout 2016-06-03 16:56:29 +02:00
javanna
4fa824f891 [TEST] add a lot of forgotten try with resources to wrap ElasticsearchResponses 2016-06-03 16:42:07 +02:00
Britta Weber
d55f719f8a [TEST] wait for yellow after setup doc tests (#18726)
* [TEST] wait for yellow after setup doc tests

We have many places in the doc where we expect and index to be
yellow before we execute a query. Therefore we have to
always wait for yellow after setup.
2016-06-03 16:37:28 +02:00
javanna
13a27a34f8 [TEST] add RestClient integration test
Relies on real HttpServer to test the actual interaction between RestClient and HttpClient, and how requests get sent in real life.
2016-06-03 16:20:12 +02:00
javanna
4572b69011 [TEST] add RestClient unit tests
Unit tests rely on mockito to mock the internal HttpClient instance. No http request is performed, we only simulate interaction between RestClient and its internal HttpClient.
2016-06-03 16:20:12 +02:00
javanna
9ed2d610ec [TEST] rename restClientTests back to RestClientBuilderTests 2016-06-03 16:20:12 +02:00
javanna
24ea585c9e don't use setDefaultHeaders from HttpClient
Store default headers ourselves instead, otherwise default ones cannot be replaced. Don't allow for multiple headers with same key, last one wins and replaces previous ones with same key.

Also fail with null params or headers.
2016-06-03 16:20:11 +02:00
javanna
47e52044e4 [TEST] add setHosts test and rename RestClientBuilderTests to RestClientTests 2016-06-03 16:01:07 +02:00
javanna
35dbdeeae5 check hosts is not null nor empty earlier, remove check from nextHost
if we check at set time, we don't need to check each single time in nextHost
2016-06-03 16:01:07 +02:00
javanna
6d66fbd9c1 add toString to DeadHostState class 2016-06-03 16:01:07 +02:00
javanna
c9db111387 add javadocs on closing responses 2016-06-03 16:01:07 +02:00
javanna
83c6e736de add support for PATCH and TRACE methods
Although elasticsearch doesn't support these methods (RestController doesn't even allow to register handler for them), the RestClient should allow to send requests using them.
2016-06-03 16:01:07 +02:00
javanna
51e487fa55 [TEST] remove okhttp test dependency
Use sun HttpServer instead and disable forbidden-apis for test classes. It turns out to be more flexible than okhttp as it allows get & delete with body.
2016-06-03 16:01:07 +02:00
javanna
3745305ffb [TEST] be more specific around http method used for sniffing 2016-06-03 16:01:07 +02:00
javanna
044a97c740 move client sniffer to its own project
Create a new subproject called client-sniffer that contains the o.e.client.sniff package. Since it is going to go to a separate jar, due to its additional functionalities and dependency on jackson, it makes sense to have it as a separate project that depends on client. This way we make sure that client doesn't depend on it etc.
2016-06-03 16:01:07 +02:00
javanna
7f4807b29e add some javadocs 2016-06-03 16:01:07 +02:00
javanna
29b1f8d44a make some classes and methods package private
ElasticsearchResponseException, as well as ElasticsearchResponse, should only be created from o.e.client package.
RequestLogger should only be used from this package too.
2016-06-03 16:01:07 +02:00
javanna
6490355cb6 make host state immutable
Instead of having a Connection mutable object that holds the state of the connection to each host, we now have immutable objects only. We keep two sets, one with all the hosts, one with the blacklisted ones. Once we blacklist a host we associate it with a DeadHostState which keeps track of the number of failed attempts and when the host should be retried. A new state object is created each and every time the state of the host needs to be updated.
2016-06-03 16:01:07 +02:00
javanna
e81aad972a remove usage of deprecated api 2016-06-03 16:01:07 +02:00
javanna
c70e08c393 include response body in ElasticsearchResponseException error message 2016-06-03 16:01:07 +02:00
javanna
eae914ae8e Replace rest test client with low level RestClient
We still have a wrapper called RestTestClient that is very specific to Rest tests, as well as RestTestResponse etc. but all the low level bits around http connections etc. are now handled by RestClient.
2016-06-03 16:01:07 +02:00
javanna
325b723930 [TEST] add rest client test dependency and replace usage of HttpRequestBuilder with RestClient in integration tests 2016-06-03 16:01:07 +02:00
javanna
6d3f6c7faf support missing OPTIONS method, it is supported in elasticsearch core 2016-06-03 16:01:07 +02:00
javanna
9a38d81bec Expose whole ElasticsearchResponse within ElasticsearchResponseException
The only small problem is that the response gets closed straightaway and its body read immediately into a string. Should be ok to load it all into memory eagerly though in case of errors. Otherwise it becomes cumbersome to have an exception implement Closeable...
2016-06-03 16:01:07 +02:00
javanna
16ab491016 add getFirstHeader method to ElasticsearchResponse 2016-06-03 16:01:07 +02:00
javanna
1d06916b07 adapt params argument, they can only be Strings in performRequest method 2016-06-03 16:01:07 +02:00
javanna
3890842fd4 add project substitution for org.elasticsearch:client so that we can add it as a dep in other projects 2016-06-03 16:01:07 +02:00