Commit Graph

1780 Commits

Author SHA1 Message Date
javanna a50a0da183 [TEST] adapt to changes upstream, expression has been moved out
Queries that can include scripts make now use of the mock script engine
2015-09-25 10:20:22 +02:00
javanna 34de79370f Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/ElasticsearchException.java
2015-09-25 09:38:24 +02:00
javanna 4425cd6570 [TEST] fix test bug 2015-09-25 09:16:02 +02:00
Nik Everett fe8f0b97e4 Another formatting fix 2015-09-24 16:50:04 -04:00
Isabel Drost-Fromm 18d3ab381f Switch geo validation to enum 2015-09-24 22:33:08 +02:00
Simon Willnauer 152775c515 Move ShardPercolateService creation into IndexShard
This commit removes an unnecessarily guice injected service and
simply creates an instance where it's needed using plain old java ctors
2015-09-24 21:29:59 +02:00
Robert Muir 8b88a69d9c Block process execution with seccomp on linux/amd64
Block execve(), fork(), and vfork() system calls, returning EACCES instead,
on kernels that support seccomp-bpf: either via seccomp() or falling back
to prctl().

Only linux/amd64 is supported. This feature can be disabled (in case
of problems) with bootstrap.seccomp=false.

Closes #13753

Squashed commit of the following:

commit 92cee05c72b49e532d41be7b16709e1c9f919fa9
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 24 10:12:51 2015 -0400

    Add a note about why we don't parse uname() or anything

commit b427971f45cbda4d0b964ddc4a55fae638880335
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 24 09:44:31 2015 -0400

    style only: we already pull errno into a local, use it for catch-all case

commit ddf93305525ed1546baf91f7902148a8f5b1ad06
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 24 08:36:01 2015 -0400

    add TODO

commit f29d1b7b809a9d4c1fcf15f6064e43f7d1b24696
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 24 08:33:28 2015 -0400

    Add full stacktrace at debug level always

commit a3c991ff8b0b16dc5e128af8fb3dfa6346c6d6f1
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 24 00:08:19 2015 -0400

    Add missing check just in case.

commit 628ed9c77603699aa9c67890fe7632b0e662a911
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 23 22:47:16 2015 -0400

    Add public getter, for stats or whatever if they need to know this

commit 3e2265b5f89d42043d9a07d4525ce42e2cb1c727
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 23 22:43:06 2015 -0400

    Enable use of seccomp(2) on Linux 3.17+ which provides more protection.
    Add nice errors.
    Add all kinds of checks and paranoia.
    Add documentation.
    Add boolean switch.

commit 0e421f7fa2d5236c8fa2cd073bcb616f5bcd2d23
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 23 21:36:32 2015 -0400

    Add defensive checks and nice error messages

commit 6231c3b7c96a81af8460cde30135e077f60a3f39
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 23 20:52:40 2015 -0400

    clean up JNA and BPF. block fork and vfork too.

commit bb31e8a6ef03ceeb1d5137c84d50378c270af85a
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 23 19:00:32 2015 -0400

    order is LE already for the JNA buffer, but be explicit about it

commit 10456d2f08f12ddc3d60989acb86b37be6a4b12b
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 23 17:47:07 2015 -0400

    block process execution with seccomp on linux/amd64
2015-09-24 13:55:26 -04:00
Nik Everett f8fa00185f Better format some stream usage 2015-09-24 13:53:05 -04:00
Nik Everett a4f709c6b8 Fix mistake and revert Stream 2015-09-24 13:52:49 -04:00
Nik Everett 63da3b1a7a Remove methods from code review 2015-09-24 13:43:05 -04:00
javanna db9c2796b3 Query refactoring: last //norelease addressed
Some methods had default implementation while queries were going to be refactored, now that they are all refactored all those methods can be made abstract.
2015-09-24 18:00:36 +02:00
javanna aae7faa88e Query refactoring: minor cleanups before we merge into master
Remove ParseFieldMatcher duplication query in both contexts. QueryParseContext is still contained in QueryShardContext, as parsing still happens in the shards here and there. Most of the norelease comments have been removed simply because the scope of the refactoring has become smaller. Some could only be removed once everything, the whole search request, gets parsed on the coordinating node. We will get there eventually.
2015-09-24 17:53:03 +02:00
Christoph Büscher 1968d3e0f0 Tests: fixing minor issues in RangeQueryBuilderTests and MatchQueryBuilderTests 2015-09-24 15:43:56 +02:00
javanna 8976934d3b Remove IndexQueryParseService#parse methods used only in tests
SimpleIndexQueryParserTests was the main responsible: deleted lots of duplicated tests, moved the ones that made sense to keep to their corresponding unit tests (note they were ESSingleNode tests before while are now converted to unit tests).

Closes #13750
2015-09-24 13:35:36 +02:00
Christoph Büscher eb8ea63626 Query Refactoring: remove deprecated methods and temporary classes
After all queries now have a `toQuery` method and the parsers all
support `fromXContent` it is possible to remove the following
workarounds and deprecated methods we kept around while doing the
refactoring:

* remove the BaseQueryParser and BaseQueryParserTemp. All parsers
  implement QueryParser directly now
* remove deprecated methods in QueryParseContext that either returned
  a Query or a Filter.
* remove the temporary QueryWrapperQueryBuilder

Relates to #10217
2015-09-24 12:51:19 +02:00
Boaz Leskes d121550a4f Internal: pending operations in the translog prevent shard from being marked as inactive
The IndexingMemoryController checks periodically if there is any indexing activity on the shard. If no activity is sean for 5m (default) the shard is marked as inactive allowing it's indexing buffer quota to given to other active shards.

Sadly the current check is bad as it checks for 0 translog operation. This makes the inactive wait for a flush to happen - which used to take 30m and since #13707 doesn't happen at all (as we rely on the synced flush triggered by inactivity). This commit fixes the check so it will work with any translog size.

Closes #13759
2015-09-24 12:01:07 +02:00
Simon Willnauer 6cbf2de592 Fire off another maybeFlush on finish to ensure we don't miss a pending flush 2015-09-24 09:28:36 +02:00
Nik Everett ffa5b27c75 Use utility 2015-09-23 17:39:43 -04:00
Nik Everett aa06433868 Fix silly mistake 2015-09-23 17:25:37 -04:00
Nik Everett 65041a8121 Entirely remove and ban ImmutableSet
The last usage was ImmutableMap#keySet
2015-09-23 16:26:16 -04:00
Simon Willnauer 1fd8c64f1f [TEST] Add more logging to IndexShardTests#testMaybeFlush() 2015-09-23 22:22:25 +02:00
Nik Everett 04c570461e Remove and ban ImmutableSet#of 2015-09-23 16:14:38 -04:00
Nik Everett b0ab02e35c Remove and ban ImmutableSet#copyOf
It was used heavily in the Guice we've embedded.
2015-09-23 15:37:49 -04:00
Simon Willnauer 0f6e40ede1 Merge pull request #13742 from s1monw/remove_dead_code
Remove `ExpressionScriptCompilationException` and `ExpressionScriptExecutionException`
2015-09-23 20:41:03 +02:00
Nik Everett 6ecda41485 Remove and ban ImmutableSet#builder 2015-09-23 13:55:34 -04:00
Jason Tedor 4fe243a5ca Merge pull request #13701 from jasontedor/fix-ping-timeout-settings-inconsistency
Fix ping timeout settings inconsistencies
2015-09-23 13:17:46 -04:00
Jason Tedor d8b29f7beb Fix ping timeout settings inconsistencies
This commit fixes ping timeout settings inconsistencies in
ZenDiscovery. In particular, the documentation refers to the ping
timeout setting as discovery.zen.ping_timeout but the code was
ultimately using discovery.zen.ping.timeout if this was set.

This commit also changes all instances of the raw string
“discovery.zen.ping_timeout” to the constant
o.e.d.z.ZenDiscovery.SETTING_PING_TIMEOUT.

Finally, this commit removes the legacy setting
"discovery.zen.initial_ping_timeout".

Closes #6579, #9581, #9908
2015-09-23 12:58:23 -04:00
Christoph Büscher dbb01f5b43 Query Refactoring: Move MoreLikeThisQueryBuilder validation to constructor
The current MoreLikeThisQueryBuilder validation checks for existence of at
least one `like` text or item. This is hard to check in setters, so this PR
tries to change the construction of the query so that we can do these checks
already at construction time.

Changing to using arrays for fieldnames, likeTexts, likeItems, unlikeTexts
and unlikeItems. `likeTexts` and/or `likeItems` need to be specified at
construction time to validate we have at least one item there.

Relates to #10217
2015-09-23 18:20:46 +02:00
Nik Everett 13720eb583 Merge pull request #13724 from nik9000/immutable_map_entry_set_be_gone
Remove and ban ImmutableMap#entrySet
2015-09-23 11:10:03 -04:00
Nik Everett 52f3c89c3b Remove and ban ImmutableMap#entrySet
Banning `ImmutableSet` outright is too much to do all at once - this starts
the process by banning `ImmutableMap#entrySet` - one of the more common ways
that `ImmutableSet`s come up. It then starts to remove calls to
`ImmutableMap#entrySet` by changing declarations from `ImmutableMap` to `Map`.

Unfortunately this process is like pulling on a long, windy string and one
declaration change requires another which requires 5 more which in turn
require another few. So this change is rather large.

As such, to keep the changes manageable they only remove `ImmutableMap` from
the signatures that are needed for `entrySet` and make little effort to stop
using `ImmutableMap` internally. Removing the usages of `ImmutableMap`
complicates immutability guarantees and will be done separately.
2015-09-23 11:07:28 -04:00
jaymode 5b8b15e729 expose all addresses that the transports are bound to
In #12942, the NettyTransport and NettyHttpServerTransport were updated to allow for binding
to multiple addresses. However, the BoundTransportAddress holder only exposed the first address
that the transport was bound to and this object is used to populate the values returned to the user
via our APIs.

This change exposes all of the bound addresses in the BoundTransportAddress holder, which allows
for an accurate representation of all interfaces that elasticsearch is bound to and listening on.
2015-09-23 11:06:35 -04:00
Jason Tedor b1965267ec Fix broken test in BootstrapCliParserTests 2015-09-23 10:37:55 -04:00
Jason Tedor 8d1d8f9c46 Merge pull request #13737 from jasontedor/cli-parameter-order-error-message
More helpful error message on parameter order
2015-09-23 10:14:13 -04:00
Jason Tedor 9e7c56b430 More helpful error message on parameter order
This commit addresses a confusing error message that arises when a
property parameter (e.g. -D) is after a double-dash parameter. The
current error message reports to the user that the parameter does not
start with “--". Adding the second dash as the error message suggests
causes the parameter to be silently ignored. This is confusing for the
user. With this commit, the user is now informed that the parameter
order is violated.

Relates e27ede48ce
2015-09-23 10:13:40 -04:00
Nicholas Knize 8fe9a11943 Fix GeoPointFieldMapper to index geohash at correct precision(s). Add test coverage. 2015-09-23 09:07:52 -05:00
Simon Willnauer a63a30bcc4 Remove `ExpressionScriptCompilationException` and `ExpressionScriptExecutionException`
These exceptions are useless and unused, since we are on a major verison we should remove
them. This commit also makes it easier to remove excepitons in the future.
2015-09-23 15:09:30 +02:00
Simon Willnauer 67a911ff24 [TEST] force REQUEST durabilty otherwise test will fail 2015-09-23 14:10:40 +02:00
Simon Willnauer c32b9c3846 Add back presumably redundant shouldFlush() check.
The check prevents a race condition since we can't use real locks here.
Relates to #13707
2015-09-23 13:57:12 +02:00
Boaz Leskes d62f864317 Reduced the number of ClusterStateUpdateTask variants
In the past ClusterStateUpdateTask was an interface and we had various derived marker interfaces to control behavior. Since then we moved ClusterStateUpdateTask to be an abstract class but we kept the old hierarchy of implementations. All of those (but the AckedClusterStateUpdateTask) can be folded into ClusterStateUpdateTask, adding correct default behavior.

Closes #13735
2015-09-23 13:43:20 +02:00
Robert Muir d6c1880f08 Merge pull request #13726 from rmuir/lang-expression
Factor expressions scripts out to lang-expression plugin
2015-09-23 07:32:15 -04:00
Clinton Gormley e27ede48ce Added a clarifying note about argument order in the bin/elasticsearch start script 2015-09-23 13:17:57 +02:00
Simon Willnauer 75e816400c Remove TranslogService and fold it into synchronous IndexShard API
This commit moves the size and ops based flush into a synchronous API into
IndexShard and removes the time-based flush alltogether since it' basically
covered by the inactive async flush API we have today. The functionality doesn't
need to be covered by scheduled task and async APIs while we can actually make all
the decisions in a sync manner which is way easier to control and to test.

Closes #13707
2015-09-23 12:39:06 +02:00
javanna 7eedd84dc3 Query refactoring: refactor query_string query and score functions
Refactor the function_score query so it can be parsed on the coordinating node, split parse into fromXContent and toQuery, make FunctionScoreQueryBuilder Writeable.

Closes #13653
2015-09-23 11:32:54 +02:00
javanna 6350470ee3 Remove index member from QueryParseContext
Given that we are moving to parsing queries on the coordinating node, the index name is not relevant anymore in QueryParseContext, as the parsing phase cannot be related to any specific index. On the contrary, the QueryShardContext is the one that holds mappings etc. and the index name too, as the lucene query creation happens on the data node and can still be related with the index that it happens against.

Changes are mainly around tests that were expecting the index name, moved to using QueryShardException in some of them, removed the index name elsewhere.

Closes #13631
2015-09-23 10:30:53 +02:00
Michael McCandless 4fb6386df3 Merge pull request #13718 from mikemccand/catch_throwable
LoggingRunnable.run should catch and log all errors, not just Exception
2015-09-23 04:24:27 -04:00
Ryan Ernst cfb1e6c6c2 Refactor file script tests to be real unit tests 2015-09-22 23:39:22 -07:00
Ryan Ernst 05957cc4f3 rewrite custom scriptcontext tests to be unit tests 2015-09-22 21:16:10 -07:00
Robert Muir b65a631d9b i am fucking done taking out your trash: have it back, clean it up yourself. just let me secure the system. 2015-09-22 23:50:28 -04:00
Robert Muir 689af1a6d6 Factor expressions scripts out to lang-expression plugin 2015-09-22 20:33:47 -04:00
Nik Everett e284210652 [core] Forbid ForwardingSet
Removes CopyOnWriteHashSet, our only usage of ForwardingSet. We weren't
using it.

Related to #13224
2015-09-22 12:31:08 -04:00
Michael McCandless de8eadab93 catch Throwable instead of Exception in LoggingRunnable.run 2015-09-22 11:36:16 -04:00
Chris Earle 6d3202b6b5 Remove unnecessary suppression 2015-09-22 10:41:50 -04:00
Chris Earle 764051b4e3 Moving system property setting to before it can be used 2015-09-22 10:41:50 -04:00
Christoph Büscher 5ebb074e57 Fixing warnings and errors in javadoc 2015-09-22 13:59:34 +02:00
Christoph Büscher 1aae68d2e8 Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/QueryParseContext.java
	core/src/main/java/org/elasticsearch/index/query/QueryParser.java
2015-09-22 12:43:55 +02:00
Christoph Büscher 7d887a1e05 Tests: fix failing GeoDistanceRangeQueryTest 2015-09-22 12:13:53 +02:00
Britta Weber 997ea08e7b remove tests. they are fragile, hard to debug and add no value
closes #13542
closes #13343
closes #13316
2015-09-22 11:42:24 +02:00
Christoph Büscher 03035a28a3 Query Refactoring: moving validation to setters and constructors
Moving validation from validate() to constructors and setters for the
following query builders:

* GeoDistanceQueryBuilder
* GeoDistanceRangeQueryBuilder
* GeoPolygonQueryBuilder
* GeoShapeQueryBuilder
* GeohashCellQuery
* TermsQueryBuilder

Relates to #10217
2015-09-22 11:05:56 +02:00
Simon Willnauer ac2be641b3 add missing license header 2015-09-22 10:03:19 +02:00
Simon Willnauer 2c9a280878 only set matcher if parser is not null 2015-09-22 09:34:00 +02:00
Simon Willnauer 5f258b1585 Add a ObjectParser helper for stream parsing
This parser prototype allows to decleratively define parsers for XContent
instead of writing messy and error prone while loops. It encapsulates all the error handling logic
and only even tries to parse if the token types match the declaration.
2015-09-22 09:26:17 +02:00
Robert Muir b582de79ae Merge pull request #13702 from rmuir/broke_javadocs
Fix all javadocs issues, re-enable compiler warnings (but disable on java 9 where maven is broken)
2015-09-22 00:46:31 -04:00
Robert Muir 2f67cacaa3 Fix all javadocs issues, re-enable compiler warnings (but disable on java9 where maven is broken) 2015-09-21 23:35:32 -04:00
Ryan Ernst 8aa6aec344 Merge pull request #13663 from rjernst/license_cleanup
Remove unnecessary copies of license and notice files
2015-09-21 18:04:57 -07:00
Nik Everett 6876321581 Merge 'RestUtils.decodeQueryString ignores the URI fragment when parsing a query string'
Fixes #13365
2015-09-21 15:59:11 -04:00
Camilo Díaz Repka c2b3b8d983 Teach decodeQueryString about fragments
Fixes #13320
2015-09-21 15:50:29 -04:00
Robert Muir 7bcdae28ca Merge pull request #13695 from rmuir/factor_out_scripts
Get lang-javascript, lang-python, securemock ready for script refactoring
2015-09-21 15:44:08 -04:00
Robert Muir f0733bd829 Get lang-javascript, lang-python, securemock ready for script refactoring.
I want to refactor scripting engines so we can contain dangerous "God-like" permissions
like createClassloader/sun.reflect. These are used for dynamic class generation (scripts, mocks).
This will mean some refactoring to ES core.

But first lets get the plugins in order first. I removed those permissions globally, and
fixed grants for lang-javascript, lang-python, securemock so that everything works.

lang-javascript needs no code changes, because rhino is properly written :)
lang-python needs accesscontroller blocks. securemock was already working as of 1.1

This is just a baby step, to try to do some of this incrementally! It doesn't yet provide
us anything.
2015-09-21 15:13:17 -04:00
Igor Motov e09e43a325 Increment tribe node version on updates
Currently the tribe node version always stays 0, which can cause issues for the services that rely on cluster state version. For example, ClusterStateObserver doesn't revalidate the cluster state after change, which leads to cluster health check with wait flags to take much longer then actually needed.
2015-09-21 14:45:59 -04:00
David Pilato f230eabc15 [cloud-azure] Split azure plugin in 3 plugins
Until now we had a cloud-azure plugin which is providing 3 distinct features:

* discovery on Azure
* snapshot/restore on Aure
* SMB store

This commit splits the plugin by feature so people can use either one or the other or both features.

Doc is updated accordingly.
2015-09-21 17:55:23 +02:00
Christoph Büscher cc69de5c5f Merge branch 'master' into feature/query-refactoring 2015-09-21 15:38:43 +02:00
Simon Willnauer 3f94b5a395 Merge pull request #13465 from s1monw/issues/13404
Don't be lenient if JarHell is found
2015-09-21 09:53:30 +02:00
Isabel Drost-Fromm 91b97a6f7b Refactors GeoBoundingBoxQueryBuilder/-Parser
This add equals, hashcode, read/write methods, validation, separates toQuery
and JSON parsing and adds serialization and query generation tests.

Deprecates two types of initializing the bounding box: In our documentation we
speak about specifying top/left and bottom/right corner of a bounding box. Here
we also allow for top/right and bottom/left. This adds not only to the amount
of code but also testing needed w/o too much benefit for the user other than
more chances to confuse top/right/bottom/left/latitude/longitude IMHO.

Missing: The toQuery method with type set to "indexed" is not tested at the
moment.

Cleanup changes unrelated to base refactoring:
* Switched from type String to enum for types in GeoBoundingBoxQueryBuilder.
* Switched to using type GeoPoint for storing the bounding box coordinates
  instead of array of double values.

Relates to #10217 for the query refactoring part.
Relates to #12016 for how missing mappings are handled.

Adds a utility class for generating random geo data.

Adds some missing documentation.

Extend test to MEMORY type config

Fix final review comments and rebase
2015-09-20 19:49:52 +02:00
Ryan Ernst 18c519145d Remove unnecessary copies of license and notice files
We moved a lot of repositories into elasticsearch, but in their new
location they retained their LICENSE.txt and NOTICE.txt files. These are
all the same, and having the license and notice and the root of the
repository should be sufficient.
2015-09-18 17:48:30 -07:00
Simon Willnauer 37cff7b01c Add tests and fixes for primitive numeric ctors on TermsQueryBuilder 2015-09-18 22:56:50 +02:00
Simon Willnauer 2305ccef43 Remove forbidden API usage 2015-09-18 22:02:38 +02:00
Colin Goodheart-Smithe a2334981fa Fix messed up merge 2015-09-18 20:47:05 +02:00
Simon Willnauer 2da1baf546 Merge branch 'master' into feature/query-refactoring 2015-09-18 20:38:15 +02:00
Simon Willnauer 1228a9fe55 Merge branch 'master' into feature/query-refactoring 2015-09-18 20:35:56 +02:00
Jason Tedor dea7989a0f Move method to CollectionUtils to reduce number of source files 2015-09-18 08:43:17 -04:00
Jason Tedor 702cf7be72 Replace Integers.checkedCast with built-in method 2015-09-18 08:43:17 -04:00
Jason Tedor f0e20cf594 Remove need for lenient tryParse method 2015-09-18 08:43:17 -04:00
Jason Tedor c281826702 Remove and forbid use of com.google.common.primitives.Ints
This commit removes and now forbids all uses of
com.google.common.primitives.Ints across the codebase. This is one of
many steps in the eventual removal of Guava as a dependency.

Relates #13224
2015-09-18 08:43:17 -04:00
Colin Goodheart-Smithe c8d1f7aa67 [TESTS] fix failing tests due to ParsingException rename 2015-09-18 13:28:48 +01:00
Colin Goodheart-Smithe a8368b5dcd Merge pull request #13631 from s1monw/refactor_query_parsing_exception
Rename QueryParsingException to a more generic ParsingException
2015-09-18 12:30:49 +01:00
Christoph Büscher c6d254ad7e Add QueryShardException to list in ElasticsearchException 2015-09-18 12:38:56 +02:00
Christoph Büscher bab9523c56 Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/ElasticsearchException.java
2015-09-18 12:05:03 +02:00
Robert Muir 47025defa6 Remove this: we are gonna manage these right 2015-09-18 00:23:06 -04:00
Robert Muir a5127bb6b0 Fix intellij test logging 2015-09-18 00:16:01 -04:00
Robert Muir 3504fefb6b Add Intellij support for plugins with extra permissions.
graduate this from a hack for insecure plugins to something we can
live with for per-module/plugin permissions, it now works reasonably
in unit tests and with Intellij and Eclipse IDEs.

remove security warnings: we will deal with these issues in a secure
way, if we cannot, then the plugin shouldn't be in our core codebase.
2015-09-17 23:51:51 -04:00
Robert Muir 5e5e10c91b Merge pull request #13645 from rmuir/crazy_test_framework_again
Fix more issues with plugin unit tests and allow running from IDE.
2015-09-17 18:06:22 -04:00
Christoph Büscher 37b46fb79c Query Refactoring: moving validation to constructors and setters
This PR is the second batch in moving the query validation we started
to collect in the validate() method to the corresponding setters
and constructors.
2015-09-17 23:30:42 +02:00
Robert Muir 394b6265c3 Fix more issues with plugin unit tests and allow running from IDE.
This is the more sheisty business along the same lines as
https://github.com/elastic/elasticsearch/pull/13638

1 hour total adding the real functionality, days of wasted time
on simulated fake functionality to satisfy our crazy test framework...

I debugged on the problematic jenkins machine and I think issues are
from parsing the classpath and URL normalization etc (trailing slashes
vs not, etc in URLs). So I simplifed the code, to remove this completely,
inverting the logic so we just use an exclusion list instead of inclusion one.

I also allow tests for these plugins to run from the IDE (works at least for eclipse) too.
At least for eclipse this is even less realistic as it piles all the code (src and test)
into a single codebase, but it means you can *use it* and you just have to run mvn verify
before pushing as always. And as always... best effort.
2015-09-17 17:02:11 -04:00
Chris Earle dac7a33ff7 Merge pull request #8201 from pickypg/feature/groovy-compile-indy-8184
Enable indy (invokedynamic) compile flag for Groovy scripts by default
2015-09-17 16:43:34 -04:00
Chris Earle ce50269e0a Removing note about 7u60 from master, which is Java 8+ only 2015-09-17 16:43:22 -04:00
Michael McCandless 3a33388872 Catch IndexWriter 'files do not exist' assertion and throw EngineCreationFailureExc 2015-09-17 16:19:03 -04:00
Robert Muir ffe50d5021 really get groovy indy working 2015-09-17 16:09:21 -04:00
Robert Muir 3e626d0dd8 add paranoia 2015-09-17 16:09:20 -04:00
Robert Muir 7828460ef6 Give groovy scripts read access to groovy.indy.logging, needed for
IndyInterface bootstrap.
2015-09-17 16:09:20 -04:00
Chris Earle 6a779fc730 Adding support for invokedynamic with Groovy scripts. 2015-09-17 16:09:20 -04:00
Nicholas Knize 9a67d6641b Fix RandomShapeGenerator to retry on JTS Assertion and RandomShapeException
A JTS bug causes a misinterpretation of polygon coordinates leading to an unhelpful "geom" AssertionError. While this assertion occurs approx 0.02% of the time it can lead to a misleading test failure. This patch catches the geom assertion and retries randomShapeCreation. For safety a threshold is set to prevent unlimited retrying - though 1 retry is typically sufficient for correcting the invalid shape.

closes #13551
2015-09-17 13:44:04 -05:00
Nicholas Knize 584aaa08f8 Fix RandomShapeGenerator to retry on JTS Assertion and RandomShapeException
A JTS bug causes a misinterpretation of polygon coordinates leading to an unhelpful "geom" AssertionError. While this assertion occurs approx 0.02% of the time it can lead to a misleading test failure. This patch catches the geom assertion and retries randomShapeCreation. For safety a threshold is set to prevent unlimited retrying - though 1 retry is typically sufficient for correcting the invalid shape.

closes #13551
2015-09-17 13:23:46 -05:00
Robert Muir 7898ba103e Merge pull request #13638 from rmuir/more_realistic_unit_tests_for_plugins_like_this
Better simulate problematic plugins permissions in unit tests.
2015-09-17 12:06:08 -04:00
Robert Muir 0fdc16927e Elaborate more on how this works 2015-09-17 11:51:00 -04:00
Robert Muir 9219af8106 Better simulate problematic plugins permissions in unit tests.
We don't have a plugin .zip for unit tests, so we can't do it
correctly. But we can approximate it better, so that if code
is simply missing an AccessController block at least tests will fail.
2015-09-17 10:17:17 -04:00
Clinton Gormley 312bf5a011 Remove workaround for V2_0_0_beta1 in VersionTests 2015-09-17 15:48:05 +02:00
Clinton Gormley f20473a2e4 Add version 2.0.0-beta2 2015-09-17 15:41:34 +02:00
Clinton Gormley a7042fd809 Add bwc indices for 2.0.0-beta1 and 2.0.0-beta2 2015-09-17 15:41:34 +02:00
Simon Willnauer ec6643b994 bring back fully qualified classname 2015-09-17 14:58:40 +02:00
Simon Willnauer effaaf0566 Rename QueryParsingException to a more generic ParsingException
this allows us to reuse this exception in more places rather than adding
new ones that are basically just subclasses.
2015-09-17 14:56:21 +02:00
Boaz Leskes a1e83f6f4f Test: don't use setDaemon in DiscoveryWithServiceDisruptionsIT. 2015-09-17 14:24:48 +02:00
Boaz Leskes 39f86a1abe Test: move LongGCDisruption from Thread.getAllStackTraces() to Thread.enumerate()
To allow it to run without the "modifyThreadGroup" permission.
2015-09-17 14:23:57 +02:00
Christoph Büscher 887399eebf Query Refactoring: moving validation to constructors and setters
This PR is an initial step to move the query validation we started
to collect in the validate() method to the corresponding setters
and constructors.
2015-09-17 13:57:34 +02:00
Martijn van Groningen 1a8495d1d6 tests: Add to ability for a integration test to prevent specific templates from being wiped between tests. 2015-09-17 12:34:46 +02:00
Simon Willnauer e9713cbb7b Append new exceptions to the end otherwise backporting won't work 2015-09-17 11:14:59 +02:00
Simon Willnauer af9166d84d Use a dedicated id to serialize EsExceptions instead of it's class name.
Classnames change quickly due to refactorings etc. If that happens in a minor release
we loose the ability to deserialize the exceptoin coming from another node sicne we today
look it up by classname. This change uses a dedicated static id instead of the classname
to lookup the actual class.
2015-09-17 11:08:09 +02:00
Robert Muir dc0bebada1 Support tests for insecure plugins on systems with multiple fs roots. 2015-09-17 02:30:45 -04:00
Robert Muir d4e53d8393 fix compilation with ECJ (eclipse IDE etc) 2015-09-16 14:33:39 -04:00
Robert Muir 09d2188869 Merge branch 'master' into kill_more_bogus_permissions 2015-09-16 12:17:43 -04:00
Christoph Büscher 125be0a05f Tests: Fix HighlighterSearchIT#testMultiMatchQueryHighlight, dont use null type 2015-09-16 18:14:53 +02:00
Lee Hinman 37ba02ab21 [TEST] Fix incorrect location for greaterThanOrEqual fix 2015-09-16 10:10:42 -06:00
Robert Muir ba934c6bee Remove some bogus permissions only needed for tests.
Especially the worst of the worst with thread permissions: for example,
this prevents some code from starting daemon thread that will outlive
the elasticsearch process and hang around doing evil shit.
2015-09-16 12:07:18 -04:00
Alex Ksikes a3c68f690b Refactors MultiMatchQueryBuilder and Parser
Relates to #10217

This PR is against the query-refactoring branch.

Closes #13405
2015-09-16 13:41:22 +02:00
Christoph Büscher c5a7fedb23 TermsQueryBuilder: removing guava Longs 2015-09-16 13:16:59 +02:00
Christoph Büscher ff74e94260 Merge branch 'master' into feature/query-refactoring
Conflicts:
    core/src/main/java/org/elasticsearch/common/unit/Fuzziness.java
    core/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java
    core/src/main/java/org/elasticsearch/index/query/IdsQueryParser.java
    core/src/main/java/org/elasticsearch/index/query/functionscore/random/RandomScoreFunctionParser.java
    core/src/test/java/org/elasticsearch/search/highlight/HighlighterSearchIT.java
2015-09-16 13:04:18 +02:00
Christoph Büscher 8fb1aa9781 Refactors GeoDistanceQueryBuilder/-Parser
Splits parsing and Lucene query generation. Switches from storing lat/lon
separately to using GeoPoint instead.

Relates to #10217
2015-09-16 11:15:32 +02:00
Alex Ksikes 65139ee40a Removes unused empty parser's constructors 2015-09-16 11:03:34 +02:00
Michael McCandless 0060a749ca Fix test case to verify the AssertionError did in fact come from IndexWriter.filesExist 2015-09-16 04:59:36 -04:00
Jason Tedor 30a7795119 Remove unused import in o.e.c.u.i.Iterables 2015-09-16 04:51:06 -04:00
Michael McCandless 51773f2a66 fix test to expect AssertionError as well 2015-09-16 04:31:27 -04:00
Robert Muir 01e6d8e3dc Remove java.lang.reflect.ReflectPermission "suppressAccessChecks"
Closes #13603

Squashed commit of the following:

commit 8799fb42d80297a79285beaf407b1bbecdb5854d
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 16 03:32:29 2015 -0400

    Add randomizedtesting snapshot note

commit 0d874d9f0f5fddaeab8f48f9816a052dcaa691be
Author: Robert Muir <rmuir@apache.org>
Date:   Wed Sep 16 03:11:01 2015 -0400

    Add a mechanism for insecure plugins and get all tests passing

commit 80540aeb9a264f6f299aaa3bc89df7f9b7923a60
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Sep 15 22:59:29 2015 -0400

    Really remove, we are killing this

commit 884818c1ad44ca2e7572a6998c086580be919657
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Sep 15 22:57:22 2015 -0400

    fill in TODOs

commit 34f4cb81f249edfec4d8d211da892f8c987e5948
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Sep 15 22:31:43 2015 -0400

    Publish snapshots of RR and lucene and cutover

commit d68eb9d66ce059761805c64d67e41a29098c9afa
Merge: f27e208 f62da59
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Sep 15 12:32:41 2015 -0400

    Merge branch 'master' into kill-setaccessible

commit f27e20855216dab6a6ad035d41018d8c67f3144c
Author: Robert Muir <rmuir@apache.org>
Date:   Tue Sep 15 12:32:21 2015 -0400

    make a real lucene snapshot
2015-09-16 04:08:31 -04:00
Simon Willnauer 76b027a979 [TEST] Only assert on a generic AssertionError
The specific error might be lost on the transport layer and turned into a generic
AssertionError instead.

Closes #13599
2015-09-16 09:21:13 +02:00
Igor Motov 8d542da89d Test: await fix on GroovyScriptIT.testGroovyExceptionSerialization 2015-09-15 22:54:29 -04:00
Alex Ksikes a13336da54 Refactors MoreLikeThisQueryBuilder and Parser
Relates to #10217

This PR is against the query-refactoring branch.

Closes #13486
2015-09-16 02:09:38 +02:00
Igor Motov d6f9fe96af Tests: Make sure that the cluster state came from the same master before checking for discrepancies
If nodes don't agree on the master, the cluster state doesn't have to match even if they have the same version
2015-09-15 19:34:48 -04:00
Alex Ksikes 4096244ec2 Also adds tests for date fields for match query builder
PR is against the query refactoring branch.

Closes #13585
2015-09-16 00:26:18 +02:00
Simon Willnauer bfa984e1c2 Prevent losing stacktraces when exceptions occur
This commit removes unnecesssary use of ExceptionHelpers where we actually
should serialize / deserialize the actual exception. This commit also
fixes one of the oddest problems where the actual exception was never
rendered / printed if `all shards failed` due to a missing cause.

This commit unfortunately doesn't fix Snapshot/Restore which is almost
unfixable since it has to serialize XContent and read from it which can't
transport exceptions.
2015-09-15 23:20:54 +02:00
xuzha c6da8d5e13 IndexNameExpressionResolver should not ignore any wildcards that occur
elsewhere in the expression,

closes #13334
2015-09-15 10:54:33 -07:00
Nicholas Knize 589fb9674f Relax geopoint comparison tolerance
Weighted centroid, morton hash, and geohash can be imprecise (computation error) to 1e-5. The previous compareTo set this tolerance too strict (1e-6) causing a reproducible comparison error on weighted centroid (#13558). This change relaxes the tolerance to the acceptable computation error of 1e-5

closes #13558
2015-09-15 12:35:10 -05:00
Michael McCandless 2cc873b2d6 Merge branch 'master' into remove_index_buffer_size
Conflicts:
	core/src/main/java/org/elasticsearch/index/engine/EngineConfig.java
2015-09-15 11:34:49 -04:00
Jason Tedor 3d4fac6256 Remove unused import in o.e.t.UpdateThreadPoolSettingsTests 2015-09-15 10:48:01 -04:00
Jason Tedor 2357e65fcc Remove unused import in o.e.a.t.TermVectorsFilter 2015-09-15 10:46:59 -04:00
Michael McCandless 028acdd06f Merge pull request #13548 from mikemccand/indexing_memory_controller
Improve IndexingMemoryController a bit:
      - promptly push indexing buffer changes to IndexWriter, instead of waiting for next refresh/flush
      - don't wait for merges to finish before dropping a shards's indexing buffer to 512 KB once it's inactive
      - fix NPE if indices.memory.index_buffer_size is in node's settings with a bytes (not %) unit
      - add some more logger.debug
2015-09-15 10:39:10 -04:00
Jason Tedor 2833ad4d6f Remove unused import in o.e.t.ESIntegTestCase 2015-09-15 10:37:57 -04:00
Jason Tedor b3c6327caf Remove and forbid use of com.google.common.base.Joiner
This commit removes and now forbids all uses of
com.google.common.base.Joiner across the codebase. This is one of many
steps in the eventual removal of Guava as a dependency.

Relates #13224
2015-09-15 10:30:42 -04:00
Jason Tedor 7a29febd72 Remove and forbid use of com.google.common.math.LongMath
This commit removes and now forbids all uses of
com.google.common.math.LongMath across the codebase. This is one step
of many in the eventual removal of Guava as a dependency.
2015-09-15 10:28:02 -04:00
Simon Willnauer ff4a11aa32 Replace and ban next batch of Guava classes
This commit replaces and bans:
 * com.google.common.util.concurrent.UncheckedExecutionException
 * com.google.common.util.concurrent.AtomicLongMap
 * com.google.common.primitives.Longs
 * com.google.common.io.ByteStreams
 * com.google.common.collect.UnmodifiableIterator
 * com.google.common.collect.ObjectArrays
 * com.google.common.collect.Multimap
 * com.google.common.collect.MultimapBuilder

Relates to #13224
2015-09-15 14:44:41 +02:00
Jason Tedor 527ab95c39 Remove and forbid use of com.google.common.collect.Iterables
This commit removes and now forbids all uses of
com.google.common.collect.Iterables across the codebase. This is one of
many steps in the eventual removal of Guava as a dependency.

Relates #13224
2015-09-15 07:47:36 -04:00
Jason Tedor acbede48d7 Completely remove Preconditions.checkArgument 2015-09-15 07:23:35 -04:00
Jason Tedor 78bff93ab1 Completely remove Preconditions.checkState 2015-09-15 07:23:34 -04:00