Commit Graph

15314 Commits

Author SHA1 Message Date
Clinton Gormley 877589e153 In the license checker, include the "ignore prefix" parameter in the output
Closes #13322
2015-09-03 21:00:11 +02:00
javanna da554fc30c Query DSL: match_phrase_prefix to take boost into account
The match_phrase_prefix query properly parses the boost etc. but it loses it in its rewrite method. Fixed that by setting the orginal boost to the rewritten query before returning it. Also cleaned up some warning in MultiPhrasePrefixQuery.

Closes #13129
Closes #13142
2015-09-03 19:46:42 +02:00
Jason Tedor 2a4b7a7fe3 Merge pull request #13318 from jasontedor/fix/13315
Workaround pitfall in Java 8 target-type inference
2015-09-03 13:10:40 -04:00
Jason Tedor 5c4b864a42 Workaround pitfall in Java 8 target-type inference
Target-type inference has been improved in Java 8. This leads to these
lines now being interpreted as invoking String#valueOf(char[]) whereas
they previously were interpreted as invoking String#valueOf(Object).
This change leads to ClassCastExceptions during test execution. Simply
casting the parameter to Object restores the old invocation.

Closes #13315
2015-09-03 13:10:01 -04:00
Robert Muir 11314336b6 bump master (3.0-snapshot) to java 8
Closes #13314

Squashed commit of the following:

commit 0e2d6c8e55e07957d0bea08f3c80f51f481ba6d4
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 3 12:49:51 2015 -0400

    re-enable the rest of this test, as its one method that hangs

commit 04dc6b62d4800f574babcdbbf0e44f5c3400e0f0
Merge: 2b12805 52945b2
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 3 12:48:55 2015 -0400

    Merge branch 'master' into java8

commit 2b128056ded741cddaf1d92c55920d7baf80dc95
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 3 12:28:07 2015 -0400

    more jsr166e removal

commit 5826feba484389a87dbcad9a53ee5bf9a306eb61
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 3 12:15:13 2015 -0400

    disable broken test

commit aabd88b85f2dd7b9b2b9308ffd52bc71aef8ab82
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 3 12:11:12 2015 -0400

    Disable broken test

commit 863463303a12415dfecd6a46a6767eb07a2c7415
Author: Robert Muir <rmuir@apache.org>
Date:   Thu Sep 3 11:38:32 2015 -0400

    bump master (3.0-snapshot) to java 8
2015-09-03 12:55:21 -04:00
Britta Weber 52945b2b46 [test] mute testReadOnPostRecoveryShards 2015-09-03 18:27:09 +02:00
javanna 6e00a613ee Internal: simplify filtered query conversion to lucene query
We have some optimization in FilteredQueryParser that tries to mimic what the rewrite method in lucene does, based on what gets parsed we return the simplest query possible. That might cause issues with boost values though, if specified in both the main query and the inner query that we shortcut to. We should rather rely on lucene's rewrite method to simplify the lucene representation of the query, and always build a filtered query instead.

relates to #13272
Closes #13312
2015-09-03 17:13:00 +02:00
Adrien Grand 3cd86a5140 Merge pull request #13311 from jpountz/enhancement/more_scroll_optimizations
Optimize scrolls for constant-score queries.
2015-09-03 16:59:28 +02:00
Adrien Grand 745b977ce7 Optimize scrolls for constant-score queries.
We currently optimize scroll when sort=_doc because docs are returned in order.
But documents are also returned in order when sorting by score and the query
gives constant scores. This optimization has the nice side-effect of also
optimizing scrolls with the default `match_all` query.
2015-09-03 16:12:04 +02:00
Robert Muir 4b0182932a Merge pull request #13299 from rmuir/network_config_improvements
Improve situation when network.host is set to wildcard (e.g. 0.0.0.0)
2015-09-03 08:18:46 -04:00
David Pilato ac9682dd00 [test] cloud-aws has been replaced by repository-s3 and discovery-ec2 2015-09-03 12:52:02 +02:00
Britta Weber 8e4e98099d Merge pull request #13307 from brwe/doc-script-fix
[doc] remove comment about function_score faster than script sort. It…
2015-09-03 12:36:33 +02:00
Britta Weber 2b27bc11b6 [doc] remove comment about function_score faster than script sort. It is not so. 2015-09-03 12:33:00 +02:00
David Pilato 6953193f5b [test] fix test names
For aws s3 and ec2
2015-09-03 12:21:26 +02:00
David Pilato 4bffdbfafc [doc] fix cross link between core and plugins doc
For ec2 and s3
2015-09-03 12:11:58 +02:00
David Pilato a117fc85a6 Update help install for discovery-ec2 and repository-s3 2015-09-03 11:29:45 +02:00
David Pilato 2931687b46 Merge remote-tracking branch 'origin/master' 2015-09-03 11:13:19 +02:00
David Pilato 30aa231f8e [plugin] split cloud-aws in repository-s3 and discovery-ec2
Until now we had a cloud-aws plugin which is providing 2 disctinct features:

* discovery on EC2
* snapshot/restore on S3

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-03 11:12:20 +02:00
Colin Goodheart-Smithe ddd064ce1f [TESTS] Changed message in NamingConventionTests to reflect code checks
Before this change the check would check that all test classes end in Tests but the message would say they need to end in Test or Tests which was confusing.
2015-09-03 10:08:25 +01:00
Simon Willnauer 796701d52e Move version to 3.0.0-SNAPSHOT 2015-09-03 10:43:28 +02:00
Adrien Grand 2f29e4b5b4 Merge pull request #13037 from jpountz/enhancement/quick_counts
Optimize counts on simple queries.
2015-09-03 09:47:47 +02:00
Adrien Grand 5ff9ca9965 Optimize counts on simple queries.
Today we always collect in order to compute counts, but some of them can be
easily optimized by using pre-computed index statistics. This is especially
true in the case that there are no deletions, which should be common for the
time-based data use-case.

Counts on match_all queries can always be optimized, so requests like

```
GET index/_search?size=0

GET index/_search
{
  "size": 0,
  "query" : {
    "match_all": {}
  }
}
```

should now return almost instantly. Additionally, when there are no deletions,
term queries are also optimized, so the below queries which all boil down to a
single term query would also return almost immediately:

```
GET index/type/_search?size=0

GET index/_search
{
  "size": 0,
  "query" : {
    "match": {
      "foo": "bar"
    }
  }
}

GET index/_search
{
  "size": 0,
  "query" : {
    "constant_score": {
      "filter": {
        "exists": {
          "field": "foo"
        }
      }
    }
  }
}
```
2015-09-03 09:36:51 +02:00
Adrien Grand bd44dbe5cd Docs: Insist that setting size=0 will help performance. 2015-09-03 09:36:34 +02:00
Adrien Grand d85cbd9f37 Merge pull request #13295 from sksamuel/patch-1
Updated param name to match type
2015-09-03 09:23:20 +02:00
Lee Hinman f25befda12 Merge remote-tracking branch 'dakrone/fix-Xloggc-args' 2015-09-02 22:04:51 -06:00
Robert Muir 6bdf89c47e Improve situation when network.host is set to wildcard (e.g. 0.0.0.0)
Users might specify something like -Des.network.host=0.0.0.0, as that
was the old default with previous versions of elasticsearch. This means
to bind to all interfaces, but it makes no sense as a publish address.

Pick a good one in this case, just like we do in other cases where
publish isn't explicitly specified and we are bound to multiple (e.g.
when configured by interface, or dns hostname with multiple addresses).
However, in this case warn the user about it: since its arbitrarily
picking the first non-loopback address like the old versions
did, thats a little too heuristical, but lets make the cutover easy.

Separately, fail hard if things like multicast or broadcast addresses are
configured as bind or publish addresses, as that is simply invalid.

Closes #13274
2015-09-02 23:03:31 -04:00
Igor Motov e288c9b0ce Tests: set the upper bound on the number of simulated failures in a restore test
The number and distribution of errors in some restore test may cause restore process to continue to fail for a prolong time. This test caps the total number of simulated failures to make sure that restore is guaranteed to eventually succeed after a limited number of retries.
2015-09-02 19:13:45 -04:00
Lee Hinman 3b0b05f6cd Don't surround -Xloggc log filename with quotes
The `-Xloggc:filename.log` parameter has very strict filename semantics:

```
[A-Z][a-z][0-9]-_.%[p|t]
```

Our script specifies \" and \" to surround it, which makes Java think we
are sending: -Xloggc:"foo.log" and it fails with:

```
Invalid file name for use with -Xloggc: Filename can only contain the characters [A-Z][a-z][0-9]-_.%[p|t] but it has been "foo.log"
Note %p or %t can only be used once
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
```

We can't quote this, and we should not need to since the valid
characters don't include a space character, so we don't need to worry
about quoting.

Resolves #13277
2015-09-02 16:45:46 -06:00
Ryan Ernst f202ecdc84 Merge pull request #13294 from rjernst/no_test_exclusions3
Rename test suffix so we only use "Tests"
2015-09-02 15:19:17 -07:00
Stephen Samuel 8057f71c1d Updated param name to match type 2015-09-02 23:07:17 +01:00
Ryan Ernst 06d5e24548 Tests: Rename test suffix so we only use "Tests"
We currently have a small number of test classes with the suffix "Test",
yet most use the suffix "Tests". This change renames all the "Test"
classes, so that we have a simple rule: "Non-inner classes ending with
Tests".
2015-09-02 14:38:43 -07:00
Jason Tedor fe46227db8 Remove sole usgae of com.google.common.annotations.Beta 2015-09-02 17:31:11 -04:00
Simon Willnauer d10f80aea0 Merge pull request #13203 from kiryam/master
Add listeners for postIndex, postCreate, and postDelete
2015-09-02 22:52:29 +02:00
Ryan Ernst e40b2d5dd7 Merge pull request #13291 from rjernst/no_test_exclusions2
Remove stress tests
2015-09-02 13:45:06 -07:00
Ryan Ernst 0caa473353 Remove benchmark/stress too 2015-09-02 13:44:42 -07:00
Ryan Ernst 425e4c3492 Tests: Remove stress tests
These are not actually tests, but command line applications that must be
run manually. This change removes the entire stresstest package. We can
add back individual tests that we find necessary, and make them real
tests (whether integ or not).
2015-09-02 13:07:15 -07:00
Ryan Ernst fabadc6a67 Fix naming for plugins abstract test cases
See #13282
2015-09-02 12:33:53 -07:00
Ivannikov Kirill 92a6968f2a Catch exception in callback of exception 2015-09-02 23:56:37 +05:00
David Pilato 4d05832a0b [qa] Add smoke test client module
As we log a lot, we hit a default limit:

```
The test or suite printed 9450 bytes to stdout and stderr, even though the limit was set to 8192 bytes. Increase the limit with @Limit, ignore it completely with @SuppressSysoutChecks or run with -Dtests.verbose=true
```

(cherry picked from commit 0cb325d)
2015-09-02 20:40:07 +02:00
Ryan Ernst e3304a19af Merge pull request #13282 from rjernst/no_test_exclusions
Remove test class exclusion for Abstract prefix and rename classes accordingly
2015-09-02 11:13:30 -07:00
Ryan Ernst 205675ad19 Addressed PR comments 2015-09-02 11:13:05 -07:00
Ryan Ernst 51db6cc358 Tests: Remove test class exclusion for Abstract prefix and rename classes accordingly
While the list of having exclusions is small, it shouldn't be necessary
at all. Base test cases should be suffixed with TestCase so they are not
picked up by the test class name pattern. This same rule works for
abstract classes as well.

This change renames abstract tests to use the TestCase suffix, adds a
check in naming convention tests, and removes the exclusion from our
test runner configuration. It also excludes inner classes (the only
exclude we should have IMO), so that we have no need to @Ignore the
inner test classes for naming convention tests.
2015-09-02 11:00:17 -07:00
Britta Weber 3d5128db07 Merge pull request #13268 from brwe/test-start-end
[test] print test start and end of test setup and cleanup
2015-09-02 19:44:40 +02:00
David Pilato 1ffc6cd6a7 [qa] Add smoke test client module
Fix previous commit. A `pom` project does not run any test...
And the cluster name is set externally so we can't assert that it's `elasticsearch`.
2015-09-02 19:28:04 +02:00
Britta Weber d47857b66f [test] don't call optimize while shard is relocating
In this test we assume that after waitForRelocation() has returned shards
are no more relocated and optimize will therefore succeed always.
However, because the test does not wait for green status, relocations can
still start after waitForRelocation() has returned successfully.

see #13266 for a detailed explanation
2015-09-02 19:15:46 +02:00
David Pilato 1a8a2c9bc2 [qa] Add smoke test client module
This commit adds a new smoke test for testing client as a end Java user.

It starts a cluster in `pre-integration-test` phase, then execute the client operations defined as JUnit tests within `integration-test` phase and then stop the external cluster in `post-integration-test` phase.

You can also run test classes from your IDE.

* Start an external node on your machine with `bin/elasticsearch` (note that you can test Java API regressions if you run an older or newer node version)
* Run the JUnit test. By default, it will run tests on `localhost:9300` but you can change this setting using system property `tests.cluster`. It also expects the default `cluster.name` (`elasticsearch`).

This commit also starts adding [snippets as defined by Maven](https://maven.apache.org/guides/mini/guide-snippet-macro.html) to help keeping automatically synchronized the Java reference guide with the current code.

Our documentation builder tool does not support snippets though but we will most likely support it at some point.
2015-09-02 17:34:54 +02:00
Lee Hinman 118eab5462 Merge pull request #13257 from elastic/docsfix
Fixed non-valid JSON (though ES would accept it)
2015-09-02 07:51:13 -06:00
Ivannikov Kirill 0d2675e80b fix typo 2015-09-02 18:22:15 +05:00
Ivannikov Kirill cddf198c83 postCreateUnderLock try catch listeners 2015-09-02 18:21:17 +05:00
Ivannikov Kirill 39fad8c374 try catch in post listeners 2015-09-02 18:18:49 +05:00