11050 Commits

Author SHA1 Message Date
Simon Willnauer
cef1c97ad4 [TEST] Add percolate type to the mapping 2015-02-18 16:06:28 +01:00
Christoph Büscher
6d41601b4e Aggregations: Format bucket key_as_string in date_histogram according to time_zone
Change bucket key_as_string to reflect `time_zone` parameter. Currently `time_zone`
shifts bucket boundaries to other time zone, but keys are displayed in UTC, so e.g.
daily buckets in "+01:00" time zone have key_as_string like "2014-01-01T23:00:00Z". With this
change the default is to format this dates according to the local time zone, so the
above bucket key would be "2014-01-02T00:00:00+01:00".

Closes #9710
Closes #9744
2015-02-18 15:49:38 +01:00
Simon Willnauer
4125e406c7 [TEST] prevent stackoverflow in mockInternalEngine 2015-02-18 14:40:22 +01:00
Colin Goodheart-Smithe
bcaf22eac3 Merge branch 'master' into feature/aggs_2_0 2015-02-18 13:22:22 +00:00
Simon Willnauer
8c3cb6c613 [TEST] don't cache store stats in tests that ensure stats are correct 2015-02-18 14:02:23 +01:00
Simon Willnauer
dd740c2763 [TEST] remove wrong assertion - stream must be closed to assert the size 2015-02-18 13:54:14 +01:00
Simon Willnauer
ddd16deb1d [ENGINE] Flush IndexWriter to disk on close and shutdown
Today we trash everything that has been indexed but not flushed to disk
if the engine is closed. This might not be desired if we shutting down a
node for restart / upgrade or if we close / archive an index. In such a
case we would like to flush the transaction log and commit everything to
disk. This commit adds a flag to the close method that is set on close
and shutdown but not when we remove the shard due to relocations
2015-02-18 13:41:28 +01:00
Simon Willnauer
85c611a1b7 [STORE] Add simple cache for StoreStats
this commit tries to reduce the filesystem calls to fetch metadata
by using a simple cache on top of the stats call.

Relates to #9683
2015-02-18 12:29:39 +01:00
Michael McCandless
a7e238dbb8 Test: include dir listing when check index fails 2015-02-18 04:31:53 -05:00
David Pilato
3c2414128c Rename Maven repository id
We are using repository ids with spaces in our `pom.xml`. Although it's not forbidden, a common practice is to avoid space in id.

This commit changes codehaus snapshots and lucene snapshots to a consistent naming (using a dash, all lowercase).
We also add a name which is used by Maven when displaying some information about the repository.

This naming is also consistent with [elasticsearch-parent project](https://github.com/elasticsearch/elasticsearch-parent) which will be used in the next future in 1.x and master branch.

**Important note**: If you have trouble to compile elasticsearch or a plugin using `mvn compile` and hit a `Access denied to: [URL_HERE], ReasonPhrase: Forbidden. -> [Help 1]`, you can remove related maven files:

```sh
find ~/.m2/repository -name _remote.repositories -exec rm -v {} \;
find ~/.m2/repository -name _maven.repositories -exec rm -v {} \;
```

Another option is to tell Maven not using those files with `--llr`:

```sh
mvn compile --llr
```
2015-02-17 20:39:04 +01:00
Lee Hinman
a22bd493a4 [CORE] move InternalEngine.segmentStats() into abstract Engine 2015-02-17 10:17:12 -07:00
Martijn van Groningen
add4339446 Added nested scope to query parse context that keeps track the current nested level during search request parsing.
The nested scope is set by any nested feature, so that sub nested queries and filters know about their context and these sub nested queries and filters can construct the right parent filter.
Removed the LateBindingParentFilter workaround in the nested query parser in favour of the nested scope maintained in the query parse context.
Due to this change nested queries and filters can now also be included in nested sorting and inner hits, because those features also now use the nested scope.

This change doesn't fix the usage of nested filters in nested and reverse_nested aggregations. The `nested` filter shouldn't be used inside these aggregations and instead the `nested` and `reverse_nested` aggs should be used to query on the right level. In a different change `nested` inside a `nested` and `reverse_nested` aggregation should result in a parse error.

Closes #9305
2015-02-17 17:53:46 +01:00
Simon Willnauer
41fd4d8722 [GATEWAY] Don't rename recovery translog in gateway
we used to reuse files / write them twice in translog. Today we don't
do this anymore so the rename logic is unneeded.
2015-02-17 12:55:48 +01:00
Colin Goodheart-Smithe
5a2c4ab5ae Added test for second_derivative 2015-02-17 11:37:28 +00:00
Colin Goodheart-Smithe
7f844660a8 Cleaning up NOCOMMITs 2015-02-17 11:31:24 +00:00
Colin Goodheart-Smithe
f03fe5b8b6 Cleaning up NOCOMMITs which are resolved 2015-02-17 11:31:02 +00:00
Colin Goodheart-Smithe
6c12cfd465 updated derivative tests to test _count 2015-02-17 11:15:04 +00:00
Colin Goodheart-Smithe
3375c02b42 Added support for _count and _key as bucketsPaths 2015-02-17 11:14:47 +00:00
Colin Goodheart-Smithe
19cdfe256e DerivativeReducer now copies histogram options from old histogram instance 2015-02-17 10:08:25 +00:00
Colin Goodheart-Smithe
269d4bc30e InternalHistogram.Factory.create() can now work from prototype
Another InternalHistogram instance can be passed into the method with the buckets and the name and will be used to set all the options such as minDocCount, formatter, Order etc.
2015-02-17 10:07:56 +00:00
Simon Willnauer
2e3c6a9118 [ENGINE] Move more methods into abstract Engine 2015-02-17 11:04:46 +01:00
Colin Goodheart-Smithe
f68bce51f1 Tests for derivative reducer
Most tests have been marked with @AwaitsFix since they require functionality to be implemented before they will pass
2015-02-17 09:05:24 +00:00
Simon Willnauer
1b8d8da648 [TEST] use util method to propperly shudtown threadpools 2015-02-17 09:32:50 +01:00
Colin Goodheart-Smithe
511e275825 More update to support Reducer Builders 2015-02-16 16:32:42 +00:00
Christoph Büscher
30fd70f07b Aggregations: Simplify time zone option in date_histogram
Removed the existing `pre_zone` and `post_zone` option in `date_histogram` in favor of
the simpler `time_zone` option. Previously, specifying different values for these could
lead to confusing scenarios where ES would return bucket keys that are not UTC.
Now `time_zone` is the only option setting, the calculation of date buckets to take place in the
preferred time zone, but after rounding converting the bucket key values back to UTC.

Closes #9062
Closes #9637
2015-02-16 16:54:06 +01:00
Alex Ksikes
455a85dc3b Term Vectors: requests are now timed
When asking for term statistics, generating term vectors on the fly or with
`dfs` set to `true`, some requests may take a while, so it is useful to know
exactly how long.

Closes #9583
2015-02-16 14:08:15 +01:00
Colin Goodheart-Smithe
c97dd84bad Added Builder for Derivatives Reducer 2015-02-16 11:57:01 +00:00
Colin Goodheart-Smithe
e994044d28 Added Builder classes for Reducers 2015-02-16 11:56:41 +00:00
Adrien Grand
9f4c56a7b8 Internal: Remove XCollector.
We don't actually need this interface, we can just run the post-collection
operation once collection is finished on impls that need it.

Close #9677
2015-02-16 12:03:54 +01:00
Adam
460e8d34fc Removed 'Master' from names.txt
Fixes #9698
2015-02-16 10:59:50 +00:00
Colin Goodheart-Smithe
247b6a7e13 removed obselete NOCOMMIT and left over sysout call 2015-02-16 10:54:37 +00:00
Colin Goodheart-Smithe
58f2ceca12 Derivative Reducer now supported nth order derivatives 2015-02-16 10:52:00 +00:00
Colin Goodheart-Smithe
f20dae85a9 getProperty method in the aggregations framework now throws a specific exception 2015-02-16 10:51:31 +00:00
Colin Goodheart-Smithe
3ab3ffa989 First (rough) pass at dependancy resolution for reducers
uses the depth-first algorithm from http://en.wikipedia.org/wiki/Topological_sorting#Algorithms

Needs some cleaning up
2015-02-16 10:42:08 +00:00
Colin Goodheart-Smithe
63f3281f12 Merge branch 'master' into feature/aggs_2_0 2015-02-16 09:27:27 +00:00
Simon Willnauer
0698af93c2 [BUILD] Add marvel and license to the release script 2015-02-16 09:46:12 +01:00
Alexander Reelsen
5092904885 Packaging: Add antlr and asm dependencies 2015-02-13 23:55:35 +01:00
Lee Hinman
305ba33710 [CORE] Move as much as possible into abstract Engine
This paves the way for more shared code between the `InternalEngine` and
`ShadowEngine` by way of the abstract `Engine` class. No actual
functionality has been changed.
2015-02-13 14:43:58 -07:00
Blake Niemyjski
8cba6c3abb Fixed an invalid query
Closes #9682
2015-02-13 21:11:42 +01:00
Colin Goodheart-Smithe
9357fc4f95 bucketsPath is now in the Reducer class since every Reducer implementation will need it 2015-02-13 15:43:39 +00:00
Christoph Büscher
c597d8d56b Aggregations: Prevent negative intervals in date_histogram
Negative settings for interval in date_histogram could lead to OOM errors in conjunction
with min_doc_count=0. This fix raises exceptions in the histogram builder and the
 TimeZoneRounding classes so that the query fails before this can happen.

Closes #9634
Closes #9690
2015-02-13 16:05:46 +01:00
Colin Goodheart-Smithe
18c2cb64b7 Validation of the reducer factories is now called from within the AggregatorFactories 2015-02-13 14:33:44 +00:00
Simon Willnauer
616d0c044f remove dead code 2015-02-13 13:43:00 +01:00
Simon Willnauer
287fab46a1 [STORE] use Directory#fileLength() less during calculating checksums 2015-02-13 13:42:11 +01:00
Simon Willnauer
09eb8d1383 [RECOVERY] Handle corruptions during recovery finalization
Today we sometimes have to transfer files without verifying the checksum
ie. if the file had an old alder32 checksum but was using random access
while writing such that we can only verify they files length. We will likely
not detect corruptions there and with the new checks during recovery finalization
we might run into corrupt index exceptions in that stage. This causes
the primary to be failed as well since we don't handle the exception today. This commit
adds better handling and a test for this scenario.
2015-02-13 12:10:37 +01:00
Boaz Leskes
c9480783b3 Rest: expose master_timeout flag on GET _template & HEAD _template
These are master level operation but we currently don't expose this parameter

Closes #9688
2015-02-13 11:25:26 +01:00
Boaz Leskes
51ba120b54 Internal: only ack index store deletion on data nodes
When an index is deleted we wait on all nodes to ack the delete. Data nodes are expected to both ack the remove of the index from their IndicesService and also the deletion of the store from disk. At the moment all nodes sends this ack which causes wrong counting on the master side. On top of this, we currently have an unneeded WARN message in the logs when client nodes try to acquire locks but do not have a data folder.

Relates to #9605

Closes #9672
2015-02-13 10:38:41 +01:00
Simon Willnauer
8dad914a1c Remove obsolet deleteFile call in Store 2015-02-13 10:18:52 +01:00
javanna
8c0ea251f7 [TEST] declare support for groovy-scripting feature in the Java REST tests runner
Groovy was disabled by default, but we turn it on in our test infra. We can then declare support for it so we go and execute script related tests as part of the REST tests suite.
2015-02-13 16:18:28 +11:00
javanna
c8b9228dd6 [TEST] allow to disable REST spec validation
With #9629 we introduced REST spec validation, which barfs whenever the REST spec don't follow the defined conventions. That said, we sometimes execute tests against previous branches and tags which have spec that needs fixing but we can't go back and fix them. We now support the `-Dtests.rest.validate_spec` system property that allows to turn off REST spec validation (enabled by default) so that we can still run tests against old branches/tags.
2015-02-13 15:50:34 +11:00