Commit Graph

4040 Commits

Author SHA1 Message Date
Simon Willnauer 354aae2fec Merge pull request #16770 from s1monw/http_on_cat
Expose http address in cat/nodes and cat/nodeattrs APIs

We expose a lot of information like IP address and port but never
expose the http address/ip:port in the CAT API. It's nice to have it
there too since otherwise json parsing is required to get this information
2016-02-22 14:20:33 -08:00
Simon Willnauer 3c15200f6f Expose http address in cat/nodes and cat/nodeattrs APIs
We expose a lot of information like IP address and port but never
expose the http address/ip:port in the CAT API. It's nice to have it
there too since otherwise json parsing is required to get this information
2016-02-22 13:22:54 -08:00
David Pilato a55ad665da Merge pull request #16743 from dadoonet/pr/9209-cat-recovery-timeunit
[cat/recovery] Make recovery time a TimeValue()
2016-02-22 12:38:04 -08:00
Lee Hinman 99052c3fef Limit the accepted length of the _id
Elasticsearch should reject ids that are this long, to ensure a document
always remains retrievable for clients that impose a maximum URI length

Closes #16034
2016-02-22 12:34:18 -07:00
Christoph Büscher f8a7bed4f0 Highlighter: Move xContent write of highlight fieldname to SearchSourceBuilder
Most elements in SearchSourceBuilder (e.g. aggs, queries) write their top-level
ParseField name in toXContent(), while HighlightBuilder used to do it in
its own toXContent() method. Moved this up so SeachSourceBuilder for consistency.
2016-02-22 10:58:23 -08:00
Simon Willnauer a574baaf3e [TEST] fix test to only enforce settings if it's not negative AND less than the limit 2016-02-22 10:50:00 -08:00
Simon Willnauer 387f0473dc Assert that we can write in all data-path on startup
Today we might start a node and some of the paths might not have the
required permissions. This commit goes through all data directories as
well as index, shard and state directories and ensures we have write access.
To make this work across all OS etc. we are trying to write a real file
and remove it again in each of those directories
2016-02-22 10:32:29 -08:00
Simon Willnauer 1e15ae6228 Merge pull request #16733 from s1monw/enforce_limits
Enforce node level limits if node is started in production env
2016-02-22 10:30:36 -08:00
Lee Hinman 932808faca [TEST] enable TRACE logging for gateway on testIndexWithFewDocuments 2016-02-22 00:28:34 -07:00
Jason Tedor fa885f2e96 Remove es.max-open-files flag
This commit removes the es.max-open-files flag as the same information
can be obtained from the cluster nodes info API, and is warn logged on
startup if it's set too low anyway.

Closes #16757
2016-02-21 21:01:08 -08:00
Simon Willnauer 55a8b1786e Enforce node level limits if node is started in production env
This commit tries to 'guess' if a user starts a node in production by
checking if any network host is configured. If that is the case soft-limits
that are only logged otherwise are enforced like number of open file descriptors.

Closes #16727
2016-02-21 17:15:50 -08:00
Mike McCandless 2e3160824c Upgrade to Lucene 5.5.0 official release
Closes #16742
2016-02-21 05:26:22 -05:00
Simon Willnauer c8e462e5dc Apply feedback from @rjernst 2016-02-20 17:12:48 -08:00
Drew Raines dd2f26ca40 [cat/recovery] Make recovery time a TimeValue()
Recovery `time` should be a TimeValue() to match other cat APIs.

Closes #9209
2016-02-20 16:30:51 -08:00
Simon Willnauer 4f7dd1284f Remove SNAPSHOT notion from code
Today we have the notion of a snapshot inside Version.java which makes
releasing complicated since to do a release Version.java must be changed.
This commit removes all notions of snapshot from the code and allows to
switch between snapshot and release build by specifying a system property on
the build. For instance running:

```
gradle run -Dbuild.snapshot=false
```

will build and package a release build while the default always
builds snapshots. Calls to the main rest action will still get the snapshot
information rendered out with the response.
2016-02-20 16:06:26 -08:00
Mike McCandless 5fffede2b0 Upgrade to Lucene 5.5.0 official release 2016-02-20 17:34:16 -05:00
Dongjoon Hyun 764ded9f28 Fix typos in exception/assert/log messages in core module. 2016-02-15 15:32:34 -08:00
Martijn van Groningen 3290cfbd31 test: replaced integration tests with unit test 2016-02-15 22:03:55 +01:00
George P. Stathis b17a92c911 Fixes #16550 (thanks for the pointers @martijnvg!) 2016-02-15 19:58:24 +01:00
Adrien Grand 69e21d4cc3 Fix how analyzers are set in StringFieldMapper.
This was changed when adding the text field in an attempt to clean up
how analyzers are set. Unfortunately this change was not safe for the
string field given that it can also represent keywords.
2016-02-15 19:21:54 +01:00
Colin Goodheart-Smithe 8f68c64f68 Fixes serialisation of Ranges
Range aggregation tests were failing (e.g. http://build-us-00.elastic.co/job/es_core_master_metal/12385/testReport/junit/org.elasticsearch.messy.tests/IPv4RangeTests/testPartiallyUnmapped/) sometimes because both the string and number versions of form and to were being serialised. This meant that the range aggregator builder objects would not serialise and deserialise to the same bytes before and after the builder had been used. This change makes Range object immutable so the builder doesn't need to worry about the range changing under its feet.
2016-02-15 15:14:09 +00:00
Colin Goodheart-Smithe ebc745211d Moved AggregatorBuilder implementations into their own class files
Also renamed histogram.AbstractBuilcer to AbstractHistogramBuilder, range.AbstractBuilder to AbstractRangeBuilder and org.elasticsearch.search.aggregations.pipeline.having to org.elasticsearch.search.aggregations.pipeline.bucketselector
2016-02-15 14:09:36 +00:00
Colin Goodheart-Smithe bd2e00d396 review comments 2016-02-15 10:46:24 +00:00
Colin Goodheart-Smithe 1a46628daa Merge branch 'master' into feature/aggs-refactoring
# Conflicts:
#	core/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java
2016-02-15 10:37:16 +00:00
Adrien Grand 11ce624343 Merge pull request #16637 from jpountz/feature/text
Add a text field.
2016-02-15 10:45:53 +01:00
Adrien Grand 4f8895eae3 Add a text field.
This new field is intended to replace analyzed string fields.
2016-02-15 10:43:44 +01:00
Boaz Leskes 0305628c6b Add some debug logs to testPendingUpdateTask
It times out rarely. Hopefully these will help.
2016-02-15 10:15:00 +01:00
Jason Tedor d313cdd7d0 Assertion handling timestamp in index request
This commit adds an assertion that the mapping metadata is not null when
handling a non-default timestamp when no timestamp is provided.

Closes #16596
2016-02-14 14:41:30 -05:00
Jason Tedor 3bbd1c129e Remove host from cat nodes API
As the host and ip fields are always equal by design, the host field in
the cat nodes API is redundant and should be removed.

Closes #16656
2016-02-14 09:21:32 -05:00
Simon Willnauer 8c1fe37e92 Remove in-place rewriting of SearchSourceBuilder
SearchSourceBuilder should be cloned when rewriting, the in-place rewrite
is failing with local transport assertions.
2016-02-13 08:57:32 +01:00
Simon Willnauer 25d6a143d4 Merge branch 'master' into add_rewrite_infra 2016-02-12 22:13:34 +01:00
Zachary Tong 2ebd2ba616 [TEST] Temporarily silence failing test
Failure ticket at #16645
2016-02-12 15:36:37 -05:00
Martijn van Groningen 299179e704 logging: exception is first argument 2016-02-12 18:23:22 +01:00
Luca Cavanna f589fa8013 Merge pull request #16617 from javanna/enhancement/function_score_strict_parsing
Function Score Query: make parsing stricter
2016-02-12 17:45:10 +01:00
Luca Cavanna ca23ee6104 Merge pull request #16640 from javanna/enhancement/remove_copy_constructors
Remove copy constructors from request classes and TransportMessage type
2016-02-12 17:21:55 +01:00
javanna cb1ca92618 move function score to ParseField 2016-02-12 17:15:04 +01:00
javanna 320f356030 use assertNull rather than assertTrue(object == null) 2016-02-12 17:15:04 +01:00
javanna 507b868692 [TEST] make SearchSourceBuilderTests pickier, check that the search source has been read completely
Same check is already performed in AbstractQueryTestCase, makes sense to have it here too.
2016-02-12 17:15:04 +01:00
javanna a624410450 Function Score Query: make parsing stricter
Function Score Query now checks the type of token that we are parsing, which makes parsing stricter and allows to throw useful errors in case the json is malformed. It also makes code more readable as in what gets parsed when.

Closes #16583
2016-02-12 17:15:03 +01:00
Nicholas Knize a3d425573c Upgrade GeoPointIndexFieldData to support new PREFIX Encoding
This commit updates the OrdinalsBuilder and GeoPoint FieldData loader to work with the new PREFIX_ENCODING introduced in lucene-5.5.0. Backcompat is included to support legacy encoding types.

closes #16634
2016-02-12 10:13:17 -06:00
javanna 8d0089c8d8 Remove unused generics type from TransportMessage
followup of #15776, the type is not needed anymore.
2016-02-12 16:31:35 +01:00
Colin Goodheart-Smithe 83885423a0 [TEST] mute DuelFieldDataTests.testDuelGeoPoints()
Bug URL = https://github.com/elastic/elasticsearch/issues/16634
2016-02-12 15:20:13 +00:00
javanna 5849646baa Java api: remove needless copy constructors from request classes
After #15776 got in, we don't need these copy constructors anymore. When we used to copy requests it was to make sure that headers and context were copied from the parent requests (e.g. index/delete as part of update). This is not a problem anymore.
2016-02-12 16:16:39 +01:00
Simon Willnauer 6c6ed135c5 wrap lines 2016-02-12 15:37:25 +01:00
Simon Willnauer 84d91c87a1 fix test 2016-02-12 15:34:50 +01:00
Simon Willnauer 9e0ceaa63e [TEST] fix test to be env agnostic 2016-02-12 15:25:00 +01:00
Simon Willnauer 8d568ce3e1 Move optimization out of BoolQueryBuilder into tests 2016-02-12 15:14:28 +01:00
Simon Willnauer 387a55d5f9 wrap lines 2016-02-12 13:03:21 +01:00
Simon Willnauer b906c8a389 apply fixes after review 2016-02-12 12:53:12 +01:00
Colin Goodheart-Smithe 86b0777392 removes a lot of warnings form the aggregations 2016-02-12 10:47:08 +00:00
Colin Goodheart-Smithe d9c1e88ba9 PipelineAggregatorBuilder.setMetaData is now chain able 2016-02-12 10:06:51 +00:00
Colin Goodheart-Smithe ed3f7903f4 Merge branch 'master' into feature/aggs-refactoring 2016-02-12 09:48:59 +00:00
Simon Willnauer 685bee3081 Merge branch 'master' into add_rewrite_infra 2016-02-12 09:46:01 +01:00
Simon Willnauer b5aee2075f Merge pull request #16610 from s1monw/test_indices_request_cache
Refactor IndicesRequestCache to make it testable.
2016-02-12 09:27:20 +01:00
Simon Willnauer 691c5c49ed Fix registerSettingsFilterIfMissing and add unittest for settings filter registration 2016-02-12 09:25:24 +01:00
Nik Everett 821a20f582 Merge branch 'master' into feature/reindex 2016-02-11 17:41:05 -05:00
Boaz Leskes 8bc2332d9a Decouple recovery source/target logic and transport piping
The current logic for doing recovery from a source to a target shourd is tightly coupled with the underlying network pipes. This changes decouple the two, making it easier to add unit tests for shard recovery that doesn't involve the node and network environment.

On top that, RecoveryTarget is renamed to RecoveryTargetService leaving space to renaming RecoveryStatus to RecoveryTarget (and thus avoid the confusion we have today with RecoveryState).

Correspondingly RecoverySource is renamed to RecoverySourceService.

Closes #16605
2016-02-11 21:36:48 +01:00
Nicholas Knize 52ee4c7027 upgrade to lucene 5.5.0-snapshot-850c6c2 2016-02-11 14:28:50 -06:00
Nik Everett 30107b4a74 Teach reindex to stop when cancelled
All we do is check the cancelled flag and stop the request at a few key
points.

Adds the cancellation cause to the status so any request that is cancelled
but doesn't die can be seen in the task list.
2016-02-11 15:21:22 -05:00
David Pilato df50371c34 Merge branch 'pr/16477-aws-settings' 2016-02-11 19:47:43 +01:00
gmarz 4a96f4f310 Fix failing stylecheck 2016-02-11 13:09:08 -05:00
javanna 37ff6af759 environemnt -> environment 2016-02-11 18:31:21 +01:00
javanna 8045e51ff3 Corrected typos and removed unused import 2016-02-11 18:31:20 +01:00
Greg Marzouka 2304952647 Merge pull request #16516 from gmarz/fix/pipeline-aggs-meta
Set meta data for pipeline aggregations
2016-02-11 12:27:46 -05:00
Adrien Grand 70f19b2c64 Merge pull request #16589 from jpountz/feature/keyword
Add a new `keyword` field.
2016-02-11 18:23:32 +01:00
Adrien Grand bc47c577d2 Add a new `keyword` field.
The `keyword` field is intended to replace `not_analyzed` string fields. It is
indexed and has doc values by default, and doesn't support enabling term
vectors.

Although it doesn't support setting an analyzer for now, there are plans for
it to support basic normalization in the future such as case folding.
2016-02-11 18:19:53 +01:00
Simon Willnauer d04ec6eb2c Merge pull request #16176 from s1monw/make_security_non_optional
Make security non-optional
2016-02-11 17:37:48 +01:00
Adrien Grand a1e251af20 Remove the MapperBuilders utility class.
We can just call constructors directly.
2016-02-11 17:32:58 +01:00
Simon Willnauer c50586599e Make security non-optional
2.x has show so far that running with security manager is the way to go.
This commit make this non-optional. Users that need to pass their own rules
can still do this via the system configuration for the security manager. They
can even opt out of all security that way.
2016-02-11 17:11:24 +01:00
Simon Willnauer d538dd64c2 Refactor IndicesRequestCache to make it testable.
This commit moves IndicesRequestCache into o.e.indics and makes all API in this
class package private. All references to SearchReqeust, SearchContext etc. have been factored
out and relevant glue code has been added to IndicesService. The IndicesRequestCache is not a
simple class without any hard dependencies on ThreadPool nor SearchService or IndexShard. This now
allows to add unittests.
This commit also removes two settings `indices.requests.cache.clean_interval` and `indices.fielddata.cache.clean_interval`
in favor of `indices.cache.clean_interval` which cleans both caches.
2016-02-11 16:51:44 +01:00
Colin Goodheart-Smithe ca6058efab Adds validation to the Aggregator Builder implementations 2016-02-11 14:04:24 +00:00
Colin Goodheart-Smithe 4a9c84d86d Merge branch 'master' into feature/aggs-refactoring
# Conflicts:
#	core/src/main/java/org/elasticsearch/search/SearchService.java
#	test/framework/src/main/java/org/elasticsearch/search/MockSearchService.java
2016-02-11 14:04:04 +00:00
Simon Willnauer 46cab6d2ec Merge pull request #16603 from s1monw/move_cache_to_indicesservice
Move IndicesQueryCache and IndicesRequestCache into IndicesService
2016-02-11 14:21:36 +01:00
Boaz Leskes efb4582eb1 Move reminder settings in NettyHttpServerTransport to the new infra
Some bw incompatible setting changes:

http.netty.http.blocking_server -> http.tcp.blocking_server
http.netty.host (removed, we just have http.host)
http.netty.bind_host (removed, we just have http.bind_host)
http.netty.publish_host (removed, we just have http.publish_host)
http.netty.tcp_no_delay -> http.tcp.no_delay
http.netty.tcp_keep_alive -> http.tcp.keep_alive
http.netty.reuse_address -> http.txp.reuse_address
http.netty.tcp_send_buffer_size -> http.tcp.send_buffer_size
http.netty.tcp_receive_buffer_size -> http.tcp.receive_buffer_size

Closes #16531
2016-02-11 14:08:10 +01:00
Yannick Welsch 94f19d7e37 Reuse existing allocation id for primary shard allocation
Closes #16530
2016-02-11 14:00:21 +01:00
Simon Willnauer de7b152736 Fix test 2016-02-11 12:09:30 +01:00
David Pilato 37b0fc4f10 Migrate AWS settings to new settings infrastructure
Reintroducing commit fb7723c but now deals with setting names conflicts
Also adds java documentation for each setting

Closes #16293.
Related to https://github.com/elastic/elasticsearch/pull/16477#discussion_r52469084
2016-02-11 12:03:09 +01:00
Simon Willnauer 7835525f45 Move IndicesQueryCache and IndicesRequestCache into IndicesService
this is a minor cleanup that detaches `IndicesRequestCache` and `IndicesQueryCache`
from guice and moves it into `IndicesService`. It also decouples the `IndexShard` and `IndexService`
from these caches which are unnecessary dependencies.
2016-02-11 12:02:21 +01:00
Simon Willnauer 8bdc7362a6 Add infrastructure to rewrite query buidlers
QueryBuilders today do all their heavy lifting in toQuery() which
can be too late for several operations. For instance if we want to fetch geo shapes
on the coordinating node we need to do all this before we create the actual lucene query
which happens on the shard itself. Also optimizations for request caching need to be done
to the query builder rather than the query which then in-turn needs to be serialized again.
This commit adds the basic infrastructure for query rewriting and moves the heavy lifting into
the rewrite method for the following queries:

 * `WrapperQueryBuilder`
 * `GeoShapeQueryBuilder`
 * `TermsQueryBuilder`
 * `TemplateQueryBuilder`

Other queries like `MoreLikeThisQueryBuilder` still need to be fixed / converted. The nice
sideeffect of this is that queries like template queries will now also match the request cache
if their non-template equivalent has been cached befoore. In the future this will allow to
add optimizataion like rewriting time-based queries into primitives like `match_all_docs` or `match_no_docs`
based on the currents shards bounds. This is especially appealing for indices that are read-only ie. never change.
2016-02-11 10:45:49 +01:00
Dongjoon Hyun ebcbe5d4c5 Fix typos in comments
Closes #16592
2016-02-10 21:22:53 -05:00
Igor Motov a5406e1ffa Adds wait for task registration to testCanFetchIndexStatus
In the testCanFetchIndexStatus the task check can occur before the indexing process is started making the test to fail. This commit adds an additional lock to make sure we check tasks only after at least one of the tasks is registered.
2016-02-10 18:33:12 -05:00
gmarz 2adce71d32 Fix MetricsAggregationBuilder missing the ability to set meta data 2016-02-10 17:52:57 -05:00
Jason Tedor b2b02f14cb Add valid duplicate classes JARs
This commit adds JARs containing valid duplicate classes for testing
JAR hell. These JARs can be recreated with
https://github.com/jasontedor/duplicate-classes.
2016-02-10 15:10:43 -05:00
Nik Everett 0da30d5eae Merge branch 'master' into feature/reindex 2016-02-10 14:07:41 -05:00
Nik Everett 4642111bac Teach reindex to retry on rejection
And count it in the status too!
2016-02-10 13:59:17 -05:00
Dongjoon Hyun 06e7c9c005 Fix typos in comments in elasticsearch/common. 2016-02-10 10:29:54 -08:00
Jason Tedor 374ecea435 Remove dead support for Java Service Wrapper
This commit removes bootstrap support for Java Service Wrapper. The
implementation of this has been moved to its own repository where it was
deprecated, does not work with Elasticsearch 2.x, and is untested and
therefore unmaintained.

Closes #16580
2016-02-10 12:10:43 -05:00
Jason Tedor 346ff0435a Fail demoted primary shards and retry request
This commit handles the scenario where a replication action fails on a
replica shard, the primary shard attempts to fail the replica shard
but the primary shard is notified of demotion by the master. In this
scenario, the demoted primary shard must be failed, and then the
request rerouted again to the new primary shard.

Closes #16415, closes #14252
2016-02-10 11:39:32 -05:00
Tal Levy 321c463929 Merge pull request #16557 from talevy/ingest_hide_null_metadata
hide null-valued metadata fields from WriteableIngestDocument#toXContent
2016-02-10 08:29:16 -08:00
Colin Goodheart-Smithe cef9b015e8 fix merge error 2016-02-10 12:20:10 +00:00
Colin Goodheart-Smithe 1f760bd1bd Merge branch 'master' into feature/aggs-refactoring 2016-02-10 12:16:26 +00:00
Colin Goodheart-Smithe 37ce7406d7 Renames PipelineAggregatorFactory to PipelineAggregatorBuilder
Also renames all the implementations appropriately
2016-02-10 11:03:55 +00:00
Colin Goodheart-Smithe 2d1f97beae Made AggregatorFactory fields final and removed AggregationContext from createInternal() parameters 2016-02-10 10:59:59 +00:00
Luca Cavanna 09c32fb1c9 Merge pull request #16539 from javanna/enhancement/ingest_tp
Ingest: use bulk thread pool for bulk request processing (was index before)
2016-02-10 11:49:21 +01:00
Isabel Drost-Fromm e0023a6692 Remove deprecated parameter from field sort builder.
This removes the deprecated ignore_unmapped parameter from field
sort builder.

This is in preparation of #16127
2016-02-10 11:31:23 +01:00
Isabel Drost-Fromm f354ab8e11 Merge pull request #16572 from MaineC/geosort-serialisation
Make GeoDistanceSortBuilder serializable, 2nd try
2016-02-10 11:25:51 +01:00
Colin Goodheart-Smithe 54e2f31189 Parse Aggregations on Coordinating node 2016-02-10 10:00:16 +00:00
Adrien Grand a5e5211341 Merge pull request #16264 from jpountz/fix/update_mapping_meta_on_all_types
Put mapping operations must update metadata of all types.
2016-02-10 10:41:01 +01:00
Jim Ferenczi e283ac8588 Fix sporadic SimpleQueryStringBuilderTests failures. 2016-02-10 10:33:45 +01:00
Colin Goodheart-Smithe ccee05792b Clean up of some NORELEASE comments for Agg refactoring 2016-02-10 09:25:34 +00:00
javanna 9ed32f715f Ingest: use bulk thread pool for bulk request processing (was index before)
Closes #16503
2016-02-10 10:19:21 +01:00
Jim Ferenczi b146f3ecb3 Pack all the plugin files into a single folder named elasticsearch at the root of the plugin zip. 2016-02-10 10:13:05 +01:00
Isabel Drost-Fromm 9432d57409 Make GeoDistanceSortBuilder serializable
Adds to GeoDistanceSortBuilder:

* equals
* hashcode
* writeto/readfrom
* moves xcontent parsing logic over
* adds roundtrip tests
* fixes roundtrip test for xcontent by keeping points just as geopoints not geohashes internally
* fixes xcontent parsing of ignore_malformed if coerce is set/unset
* adds exception to sortMode setter to avoid setting invalid sort modes

Relates to #15178
2016-02-10 10:10:56 +01:00
Adrien Grand 4ab7a18738 Put mapping operations must update metadata of all types.
Today put mapping operations only update metadata of the type that is being
modified, which is not enough since some modifications may have side-effects
on other types.

Closes #16239
2016-02-10 09:41:12 +01:00
Igor Motov 99a7d8e41f Add task cancellation mechanism
Only tasks that extend CancellableTask can be cancelled using this mechanism. If a cancellable task has children it can elect to cancel all child tasks as well. In this case a special ban parent request is sent to all nodes. This request does two things: 1) it prevents any tasks with the banned parent task from being started, and 2) it cancels all currently running tasks that have the banned task as a parent. The ban is lifted as soon as the coordinating node notifies all other nodes that the cancelled task has finished executing. If the coordinating node leaves the cluster before it has a chance to lift its bans, all bans set by this coordinating node are automatically removed.

As an option a task can elect to automatically cancel all child tasks if their parent task was running on a node that just left the cluster. This option makes sense for cancellable heavy tasks that have no side-effects and only return results to the coordinating node. With the coordinating node gone, it doesn't make sense to run such tasks any longer since their results will be most likely discarded.
2016-02-09 22:30:57 -05:00
Nik Everett 5c80dd5048 Merge pull request #16567 from nik9000/checkstyle_equals_hashcode
Fail build if we define equals but not hashCode
2016-02-09 22:00:51 -05:00
Nik Everett f76366909a Fail build if we define equals but not hashCode
That is like some kind of cardinal sin or something, right?

We had two violations though they weren't super likely to be keys in a hashmap
any time soon.
2016-02-09 21:29:08 -05:00
Dongjoon Hyun 1d26b4de22 Fix typos in the names of some variables
Closes #16566
2016-02-09 20:35:42 -05:00
Tal Levy f9453e594a hide null-valued metadata fields from WriteableIngestDocument#toXContent 2016-02-09 12:57:58 -08:00
Yannick Welsch 0d11443aba Fix filters and null parameters in _aliases command
Closes #16549
Closes #16547
2016-02-09 21:43:42 +01:00
Jason Tedor 40789d818e Remove unused import from o.e.e.Environment 2016-02-09 13:26:32 -05:00
Jason Tedor 1046a43445 Remove unused import from o.e.c.h.MessageDigests 2016-02-09 12:59:26 -05:00
Jason Tedor e6545b63d4 Add Javadocs for o.e.c.h.MessageDigests 2016-02-09 12:56:50 -05:00
Alexander Reelsen 0d4711c2fc Ingest: Add attachment processor
This is a simple port of the mapper attachment plugin to the ingest
functionality, no new features. The only option is to limit
the number of chars to prevent indexing of huge documents.

Fields can be selected in the processor as well.

Close #16303
2016-02-09 17:03:30 +01:00
Simon Willnauer 5cbc7bb93e Merge pull request #16508 from s1monw/issues/16378
Add field names to several mapping errors
2016-02-09 16:17:33 +01:00
Simon Willnauer 35fc6006f7 fix similarity tests 2016-02-09 15:24:57 +01:00
Colin Goodheart-Smithe 80bbb4a385 Merge branch 'master' into feature/aggs-refactoring
# Conflicts:
#	core/src/main/java/org/elasticsearch/percolator/PercolateContext.java
#	core/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterParser.java
#	core/src/main/java/org/elasticsearch/search/aggregations/bucket/filters/FiltersParser.java
#	core/src/main/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantTermsParametersParser.java
#	core/src/main/java/org/elasticsearch/search/internal/DefaultSearchContext.java
#	core/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParserTests.java
#	test/framework/src/main/java/org/elasticsearch/test/TestSearchContext.java
2016-02-09 10:37:20 +00:00
Colin Goodheart-Smithe e5a506752d Fix where metadata wasn't being passed through to the AggregatorFactory 2016-02-09 10:28:55 +00:00
Dongjoon Hyun 3bad16c1ca Rename variables.
This PR renames the following three variables to fix a typo `settting` into `setting`.
 * Rename a static class member:
   INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTTING -> INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING
 * Rename a parameter: aSettting --> aSetting
 * Rename a local variable: indexSetttings -> indexSettings
2016-02-08 23:13:33 -08:00
Jason Tedor c121af63b4 BootstrapSettings final with private constructor 2016-02-08 17:24:09 -05:00
Simon Willnauer 3dd827017c Merge pull request #16501 from s1monw/trash_thread_local
Detach QueryShardContext from IndexShard and remove obsolete threadlocals
2016-02-08 21:01:35 +01:00
Simon Willnauer 10f55a2df1 simplify method signature 2016-02-08 20:27:22 +01:00
Jason Tedor 06e526ba58 Register bootstrap settings
This commit registers bootstrap settings used on startup. Without
registration, setting any of these settings causes node startup to
fail. By registering these settings (rather than clearing) after use, we
enable them to be visible in any APIs that show all settings.

Closes #16513
2016-02-08 14:15:31 -05:00
gmarz 2051817780 Set meta data for pipeline aggregations
Closes #16484
2016-02-08 13:25:50 -05:00
Colin Goodheart-Smithe 94e594c095 Make AggregatorFactory fully immutable by requiring the parent, subFactories and metadata in the constructor 2016-02-08 17:51:56 +00:00
Jason Tedor 46ee568695 Log warning if max file descriptors too low
This commit adds logging for a warning message if the max file
descriptor count is too low.

Closes #16506
2016-02-08 11:50:38 -05:00
Simon Willnauer 7cb4baebf5 Add field names to several mapping errors
Closes #16378
2016-02-08 17:46:32 +01:00
Colin Goodheart-Smithe 323088d022 Decouples the AggregatorBuilder from the AggregatorFactory 2016-02-08 16:36:27 +00:00
Yannick Welsch 7ea4f7400b Require that relocation source is marked as relocating before starting recovery to relocation target 2016-02-08 17:30:33 +01:00
Simon Willnauer 2412dbe599 apply feedback from @colings86 2016-02-08 17:16:12 +01:00
Jason Tedor cbeae225b9 Speedup MessageDigestTests#testToHexString
The purpose of this commit is to speed up the runtime of
MessageDigestTests#testToHexString. As written, the test contains a loop
that creates 1024 test cases leading to a test runtime on the order of a
few seconds. Given build infrastructure, a single test case should
suffice. Therefore, this commit removes this loop so that the test can
execute on the order of a couple hundred milliseconds.
2016-02-08 10:58:34 -05:00
Adrien Grand bf382ce5d8 Merge pull request #16255 from jpountz/fix/search_analyzer_serialization
Fix serialization of `search_analyzer`.
2016-02-08 16:54:08 +01:00
Adrien Grand 12477f38b4 Fix serialization of `search_analyzer`.
We currently have a bug that it will be omitted if the index analyzer is the
default analyzer.
2016-02-08 16:51:36 +01:00
Jason Tedor ef88943e6e Cleanup JavaVersion
This commit includes a few minor cleanups to o/e/b/JavaVersion.java:
 - Stronger argument checking in JavaVersion#parse
 - Use JDK 8 string joiner
 - Keep an immutable copy of the version sequence
2016-02-08 10:43:46 -05:00
Colin Goodheart-Smithe 02ecfd6279 Merge branch 'master' into feature/aggs-refactoring 2016-02-08 15:41:02 +00:00
Colin Goodheart-Smithe a0b004acb5 Split AggregatorFactory into AggregatorBuilder and AggregatorFactory 2016-02-08 14:27:34 +00:00
Simon Willnauer 96bcb47fc9 Detach QueryShardContext from IndexShard and remove obsolete threadlocals
IndexShard currently holds an arbitraritly used `getQueryShardContext` that comes
out of a ThreadLocal. It's usage is undefined and arbitraty since there is also
such a method with different semantics on `IndexService` This commit removes the threadLocal on
IndexShard as well as on the context itself. It's types are now a member and the QueryShardContext
lifecycle is managed byt SearchContext which passes the types on from the SearchRequest.
2016-02-08 15:05:03 +01:00
Isabel Drost-Fromm 0b3cab6da3 Move sorting tests w/o scripting back to core
In preparation of #16127 this moves sorting tests back to core
that don't actually need scripting or groovy to work.
2016-02-08 14:45:33 +01:00
Boaz Leskes 4decc72da6 Fix recovery translog stats totals when recovering from store
Recovery from store fails to correctly set the translog recovery stats. This fixes it and tightens up the logic bringing it all to IndexShard (previously it was set by the recovery logic).

Closes #15974
Closes #16493
2016-02-08 11:36:59 +01:00
Simon Willnauer 7bfb1dfcc1 [TEST] Don't assert on null value. It's fine to not always see an exception in this part of the test. 2016-02-07 19:58:03 +01:00
Jason Tedor 16fe948a15 Objects#requireNonNull guard in MessageDigests 2016-02-07 11:20:53 -05:00
Jason Tedor d0c03b26f6 Fix trace logging statement in ZenDiscovery 2016-02-06 09:17:49 -05:00
Jason Tedor 542373a779 Avoid cloning MessageDigest instances
This commit modifies the MessageDigests message digest provider to
return a thread local instance of MessageDigest instances instead of
using clone since some providers do not support clone.

Closes #16479
2016-02-06 09:10:31 -05:00
Simon Willnauer b185209b63 Make IndicesWarmer a private class of IndexService
There is no need for IndicesWarmer to be a global accessible class. All it needs
access to is inside IndexService. It also doesn't need to be mutable once it's not a per node
instance. This commit move IndicesWarmer to IndexWarmer and makes the default impls like field data and
norms warming an impl detail. Also the IndexShard doesn't depend on this class anymore, instead it accepts
an Engine.Warmer as a ctor argument which delegates to the actual warmer from the index.
2016-02-05 15:24:17 +01:00
Simon Willnauer 778ec84a7c Merge pull request #16469 from s1monw/simplify_indices_field_data_cache
Simplify IndicesFieldDataCache and detach from guice
2016-02-05 14:24:19 +01:00
Simon Willnauer 9b2f40f627 Merge pull request #16471 from s1monw/no_sys_props_leaked
Apply system properties after all arguemnts are parsed in BootstrapCLIParser
2016-02-05 14:23:00 +01:00
Christoph Büscher 97172aa2fd Merge pull request #16465 from cbuescher/issue-13884-test
Tests: Add test for minimum_should_match for SimpleQueryStringQuery
2016-02-05 13:12:53 +01:00
Christoph Büscher d885fe62ea Add test for minimum_should_match, one term and multiple fields
This adds a test case similar to the issue in #13884 which was
fixed in #16155.
2016-02-05 12:33:13 +01:00
Andrej Kazakov 7f2b369dfd Use Accept header field in cat API
The cat API previously used the Content-Type header field for
determining the media type of the response. This is in opposition to the
HTTP spec which specifies the Accept header field for this purpose. This
commit replaces the use of the Content-Type header field with the Accept
header field in the cat API.

Closes #14421
2016-02-05 06:28:39 -05:00
Colin Goodheart-Smithe 19d9c588e1 more line length fixes 2016-02-05 10:41:06 +00:00
Colin Goodheart-Smithe 92d958c46e fixed 140 character line limit 2016-02-05 10:26:49 +00:00
Simon Willnauer 1e18c9a7b6 Apply system properties after all arguemnts are parsed in BootstrapCLIParser
One of our tests leaked a system property here since we failed after appling some
system properties in BootstrapCLIParser. This is not a huge deal in production since
we exit the JVM if we fail on that. Yet for correctnes we should only apply them if
we manage to parse them all.
This also caused a test failure lately on CI but on an unrelated test:
  https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+periodic/314/console
2016-02-05 11:21:00 +01:00
Simon Willnauer b5ef48ce57 fix more tests 2016-02-05 10:36:02 +01:00
Colin Goodheart-Smithe f06f17f328 Merge branch 'master' into feature/aggs-refactoring
# Conflicts:
#	core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java
#	core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java
2016-02-05 09:22:14 +00:00
Simon Willnauer 9d07501c96 fix test 2016-02-05 09:54:55 +01:00
Simon Willnauer 00be9e58f2 Simplify IndicesFieldDataCache and detach from guice
Indices level field data cacheing belongs into IndicesService and doesn't need to be
wired by guice. This commit also moves the async cache refresh out of the class into
IndicesService such that threadpool dependencies are removed and testing / creation becomes
simpler.
2016-02-05 09:43:33 +01:00
Martijn van Groningen 7a6adfd93a ingest: Added foreach processor.
This processor is useful when all elements of a json array need to be processed in the same way.
This avoids that a processor needs to be defined for each element in an array.
Also it is very likely that it is unknown how many elements are inside an json array.
2016-02-04 23:44:01 +01:00
Simon Willnauer 59a20015d6 Make TermVectorService static 2016-02-04 17:17:16 +01:00
Simon Willnauer 75802515ea Merge branch 'master' into detach_shard_from_term_vectors 2016-02-04 17:12:09 +01:00
Simon Willnauer 450ee70038 Remove DFS support from TermVector API
Retrieving distributed DF for TermVectors is beside it's esotheric justification
a very slow process and can cause serious load on the cluster. We also don't have nearly
enough testing for this stuff and given the complexity we should remove it rather than carrying it
around.
2016-02-04 16:20:24 +01:00
Yannick Welsch 15507580bb Merge pull request #16243 from ywelsch/fix/remove-shardrouting-version
Remove obsolete version in ShardRouting
2016-02-04 15:52:00 +01:00
Yannick Welsch 4937531a17 Remove obsolete version in ShardRouting
Closes #16243
2016-02-04 15:50:25 +01:00
Boaz Leskes 4cdab159f1 Remove plugability of the gateway
In the spirit of simplification, remove the ability to have a custom gateway. We haven't seen any valid use for it so far.

closes #16448
2016-02-04 15:45:05 +01:00
Nik Everett bb4d8b79fe Merge branch 'master' into feature/reindex 2016-02-04 09:23:49 -05:00
Boaz Leskes 924e880480 Remove `gateway.initial_meta` and always rely on min master nodes
During initial cluster forming, when  a master is elected, it reaches out to all other masters nodes and ask the last cluster state they persisted. To make sure we select the right state, we must successfully read from a `min_master_nodes` nodes. The gateway currently have specific settings to override this behavior, but I don't think they are ever used. We can drop them and reach out to the discovery layer, the single source of truth for the min master nodes settings.

Closes #16446
2016-02-04 13:42:28 +01:00
Simon Willnauer 30f569f958 Remove dependency from IndexShard on TermVectorService
This dependency is just syntactic sugar and complicates IndexShard creation.
This commit move it out where it's actually used and needed.
2016-02-04 12:55:45 +01:00
Simon Willnauer e69350f2ba Fix method visibility in SettingsModule.java 2016-02-04 11:53:06 +01:00
Simon Willnauer cb811a85da Add javadocs for SettingsModule 2016-02-04 11:49:59 +01:00
Simon Willnauer e19833171b Add more javadocs to Setting.java 2016-02-04 11:44:36 +01:00
Simon Willnauer c416b23739 Merge pull request #16445 from s1monw/filter_settings_on_node_info
Add settings filtering to node info requests
2016-02-04 11:26:04 +01:00
Simon Willnauer 26a0c72323 add test fore node info settings filtering 2016-02-04 11:15:29 +01:00
Ryan Ernst 5c0f09b03a Merge pull request #16443 from rjernst/cli_terminal
CliTool: Cleanup and document Terminal
2016-02-04 02:05:28 -08:00
Ryan Ernst e97345984d Remove format args from readText and readSecret 2016-02-04 02:03:17 -08:00
Simon Willnauer ca1a12e4c3 Add settings filtering to node info requests
Today we don't filter settings in NodeInfo so transport clients get unfiltered settings.
2016-02-04 10:45:32 +01:00
Simon Willnauer cc520b20e1 Merge branch 'master' into fix_settings_filter 2016-02-04 09:28:41 +01:00
Ryan Ernst b80200a363 CliTool: Cleanup and document Terminal
This change documents the Terminal abstraction that cli tools use, as
well as simplifies the api to be a minimal set of methods to interact
with a terminal.
2016-02-03 22:22:56 -08:00
Ryan Ernst b0ed528be8 Plugin cli: Delete temp zip file once it is unzipped 2016-02-03 20:17:42 -08:00
Nik Everett a2f07679fd Add task status
Implements a simple task status for superclasses of ReplicationRequest to
show how you can do use the status.
2016-02-03 18:21:42 -05:00
Simon Willnauer e1cf5e745d some plugins share settings - make it easy to filter them 2016-02-03 21:50:06 +01:00
Simon Willnauer 686627be5a Move ModuleTestCase into framework 2016-02-03 21:04:44 +01:00
Ali Beyad 592f5499cd More robust handling of CORS HTTP Access Control
Uses a refactored version of Netty's CORS implementation to provide more
robust cross-origin resource request functionality.  The CORS specific
Elasticsearch parameters remain the same, just the underlying
implementation has changed.

It has also been refactored in a way that allows dropping in Netty's
CORS handler as a replacement once Elasticsearch is upgraded to Netty 4.
2016-02-03 14:50:20 -05:00
Simon Willnauer e02d2e004e Rewrite SettingsFilter to be immutable
This change rewrites the entire settings filtering mechanism to be immutable.
All filters must be registered up-front in the SettingsModule. Filters that are comma-sparated are
not allowed anymore and check on registration.
This commit also adds settings filtering to the default settings recently added to ensure we don't render
filtered settings.
2016-02-03 20:05:55 +01:00
Colin Goodheart-Smithe 761adbb28d Fixed merge errors 2016-02-03 15:08:24 +00:00
Colin Goodheart-Smithe 5d9d91b761 Merge branch 'master' into feature/aggs-refactoring 2016-02-03 14:45:16 +00:00
Nik Everett 5e98094db1 Remove long lines from ElasticsearchException
Mostly just wrapping the exception list.

Also:
* Reworks the docs on ElasticsearchExceptionHandle
* Removes long lines from ExceptionSerializationTests
 * Switches one method from arrow shaped to early returns
 * Adds line breaks
2016-02-03 09:33:02 -05:00
Martijn van Groningen 0d9f535044 ingest: seal all processor and processor factory implementations 2016-02-03 14:53:11 +01:00
Isabel Drost-Fromm 7d787ad1d1 Merge pull request #16411 from MaineC/test-fix/geo-sort-messy
Move non-groovy geo tests from messy tests to core
2016-02-03 14:52:01 +01:00
Simon Willnauer bac6c7c764 Remove dead code 2016-02-03 14:42:11 +01:00
Simon Willnauer 1972487deb Merge pull request #16365 from s1monw/make_settings_strict
Make settings validation strict
2016-02-03 14:29:25 +01:00
Isabel Drost-Fromm f99570b0f4 Split messy geo distance/ geo distance sorting tests.
This splits the geo distance and geo distance sorting tests marked messy:
Test cases that don't really need Groovy support are moved back to the
core test suite closer to the code they actually test.

Relates to #15178
2016-02-03 13:54:07 +01:00
Konrad Beiske 2c247e9d56 Merge pull request #16017 from beiske/xcontent_exclude
Add option to exclude based on paths in XContent
2016-02-03 13:51:49 +01:00
Simon Willnauer a77344d742 Merge branch 'master' into make_settings_strict 2016-02-03 13:21:49 +01:00
Jason Tedor eb9bdd5f8a Shard state action request logging 2016-02-03 06:56:01 -05:00
Jason Tedor 0b474c6cfc Shard state action request logging
This commit modifies the string representation of a shard state action
request. The issue being addressed is that the previous logging would
log "failure: [Unknown]" for shard started actions but this just leads
to confusion that there is a failure but its cause is unknown.

Closes #16396
2016-02-03 06:52:54 -05:00
Robert Muir 20b584c7e1 Merge pull request #16400 from rmuir/lucene_4de5f1d
Upgrade to lucene 5.5.0-snapshot-4de5f1d
2016-02-03 06:45:50 -05:00
Konrad Beiske 42833b0f71 Adjusted indentation 2016-02-03 12:37:38 +01:00
Konrad Beiske 42a44b19aa Fixed parameter order in FilterPathBasedFilter constructor 2016-02-03 12:23:14 +01:00
Konrad Beiske 6f915549c6 Fixed typo in javadoc 2016-02-03 12:18:05 +01:00
Konrad Beiske 0dfb55d72c exclude{Filters}, filters => filters, exclude 2016-02-03 12:11:27 +01:00
Simon Willnauer d5ece77f2a remove dead code 2016-02-03 11:36:11 +01:00