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
This commit is contained in:
Robert Muir 2015-09-03 12:55:21 -04:00
parent 52945b2b46
commit 11314336b6
18 changed files with 54 additions and 1138 deletions

View File

@ -191,13 +191,6 @@
<optional>true</optional>
</dependency>
<!-- remove this for java 8 -->
<dependency>
<groupId>com.twitter</groupId>
<artifactId>jsr166e</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
<build>

View File

@ -1,5 +1,6 @@
<component>
<dependencySets>
<!-- TODO: wtf is this file doing, is it still used? must we list all deps here? -->
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<useTransitiveFiltering>true</useTransitiveFiltering>
@ -24,7 +25,6 @@
<include>com.github.spullara.mustache.java:compiler</include>
<include>com.tdunning:t-digest</include>
<include>commons-cli:commons-cli</include>
<include>com.twitter:jsr166e</include>
<include>org.hdrhistogram:HdrHistogram</include>
</includes>
</dependencySet>

View File

@ -122,7 +122,6 @@ final class Security {
static {
Map<Pattern,String> m = new IdentityHashMap<>();
m.put(Pattern.compile(".*lucene-core-.*\\.jar$"), "es.security.jar.lucene.core");
m.put(Pattern.compile(".*jsr166e-.*\\.jar$"), "es.security.jar.twitter.jsr166e");
m.put(Pattern.compile(".*securemock-.*\\.jar$"), "es.security.jar.elasticsearch.securemock");
SPECIAL_JARS = Collections.unmodifiableMap(m);
}

View File

@ -107,7 +107,7 @@ public class Lucene {
for (SegmentCommitInfo info : infos) {
list.add(info.files());
}
return Iterables.concat(list.toArray(new Collection[0]));
return Iterables.concat(list);
}
/**

View File

@ -19,7 +19,7 @@
package org.elasticsearch.common.metrics;
import com.twitter.jsr166e.LongAdder;
import java.util.concurrent.atomic.LongAdder;
/**
*/

View File

@ -19,7 +19,7 @@
package org.elasticsearch.common.metrics;
import com.twitter.jsr166e.LongAdder;
import java.util.concurrent.atomic.LongAdder;
import java.util.concurrent.TimeUnit;

View File

@ -19,7 +19,7 @@
package org.elasticsearch.common.metrics;
import com.twitter.jsr166e.LongAdder;
import java.util.concurrent.atomic.LongAdder;
/**
*/

View File

@ -19,9 +19,9 @@
package org.elasticsearch.common.metrics;
import com.twitter.jsr166e.LongAdder;
import org.elasticsearch.common.util.concurrent.FutureUtils;
import java.util.concurrent.atomic.LongAdder;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

View File

@ -470,7 +470,7 @@ public class InternalSearchHit implements SearchHit {
builder.field(Fields._SCORE, score);
}
for (SearchHitField field : metaFields) {
builder.field(field.name(), field.value());
builder.field(field.name(), (Object) field.value());
}
if (source != null) {
XContentHelper.writeRawField("_source", source, builder, params);

View File

@ -112,6 +112,7 @@ public class Suggest implements Iterable<Suggest.Suggestion<? extends Entry<? ex
final int size = in.readVInt();
suggestions = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
// TODO: remove these complicated generics
Suggestion<? extends Entry<? extends Option>> suggestion;
final int type = in.readVInt();
switch (type) {
@ -125,7 +126,7 @@ public class Suggest implements Iterable<Suggest.Suggestion<? extends Entry<? ex
suggestion = new PhraseSuggestion();
break;
default:
suggestion = new Suggestion<>();
suggestion = new Suggestion<Entry<? extends Option>>();
break;
}
suggestion.readFrom(in);

View File

@ -36,12 +36,6 @@ grant codeBase "${es.security.jar.lucene.core}" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
};
grant codeBase "${es.security.jar.twitter.jsr166e}" {
// needed for LongAdder etc
// TODO: remove this in java 8!
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
};
grant codeBase "${es.security.jar.elasticsearch.securemock}" {
// needed to support creation of mocks
permission java.lang.RuntimePermission "reflectionFactoryAccess";

View File

@ -21,6 +21,7 @@ package org.elasticsearch.discovery;
import com.google.common.base.Predicate;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteResponse;

View File

@ -85,7 +85,7 @@ public class ExpressionScriptIT extends ESIntegTestCase {
client().prepareIndex("test", "doc", "1").setSource("foo", 4).setRefresh(true).get();
SearchResponse rsp = buildRequest("doc['foo'] + 1").get();
assertEquals(1, rsp.getHits().getTotalHits());
assertEquals(5.0, rsp.getHits().getAt(0).field("foo").getValue());
assertEquals(5.0, rsp.getHits().getAt(0).field("foo").getValue(), 0.0D);
}
public void testBasicUsingDotValue() throws Exception {
@ -94,7 +94,7 @@ public class ExpressionScriptIT extends ESIntegTestCase {
client().prepareIndex("test", "doc", "1").setSource("foo", 4).setRefresh(true).get();
SearchResponse rsp = buildRequest("doc['foo'].value + 1").get();
assertEquals(1, rsp.getHits().getTotalHits());
assertEquals(5.0, rsp.getHits().getAt(0).field("foo").getValue());
assertEquals(5.0, rsp.getHits().getAt(0).field("foo").getValue(), 0.0D);
}
public void testScore() throws Exception {
@ -126,23 +126,23 @@ public class ExpressionScriptIT extends ESIntegTestCase {
SearchResponse rsp = buildRequest("doc['date0'].getSeconds() - doc['date0'].getMinutes()").get();
assertEquals(2, rsp.getHits().getTotalHits());
SearchHits hits = rsp.getHits();
assertEquals(5.0, hits.getAt(0).field("foo").getValue());
assertEquals(-11.0, hits.getAt(1).field("foo").getValue());
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(-11.0, hits.getAt(1).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['date0'].getHourOfDay() + doc['date1'].getDayOfMonth()").get();
assertEquals(2, rsp.getHits().getTotalHits());
hits = rsp.getHits();
assertEquals(5.0, hits.getAt(0).field("foo").getValue());
assertEquals(24.0, hits.getAt(1).field("foo").getValue());
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(24.0, hits.getAt(1).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['date1'].getMonth() + 1").get();
assertEquals(2, rsp.getHits().getTotalHits());
hits = rsp.getHits();
assertEquals(9.0, hits.getAt(0).field("foo").getValue());
assertEquals(10.0, hits.getAt(1).field("foo").getValue());
assertEquals(9.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(10.0, hits.getAt(1).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['date1'].getYear()").get();
assertEquals(2, rsp.getHits().getTotalHits());
hits = rsp.getHits();
assertEquals(1985.0, hits.getAt(0).field("foo").getValue());
assertEquals(1983.0, hits.getAt(1).field("foo").getValue());
assertEquals(1985.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(1983.0, hits.getAt(1).field("foo").getValue(), 0.0D);
}
public void testMultiValueMethods() throws Exception {
@ -158,57 +158,57 @@ public class ExpressionScriptIT extends ESIntegTestCase {
assertSearchResponse(rsp);
SearchHits hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(5.0, hits.getAt(0).field("foo").getValue());
assertEquals(2.0, hits.getAt(1).field("foo").getValue());
assertEquals(5.0, hits.getAt(2).field("foo").getValue());
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(2.0, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(5.0, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].sum()").get();
assertSearchResponse(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(7.5, hits.getAt(0).field("foo").getValue());
assertEquals(5.0, hits.getAt(1).field("foo").getValue());
assertEquals(6.0, hits.getAt(2).field("foo").getValue());
assertEquals(7.5, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(5.0, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(6.0, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].avg() + doc['double1'].avg()").get();
assertSearchResponse(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(4.3, hits.getAt(0).field("foo").getValue());
assertEquals(8.0, hits.getAt(1).field("foo").getValue());
assertEquals(5.5, hits.getAt(2).field("foo").getValue());
assertEquals(4.3, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(8.0, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(5.5, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].median()").get();
assertSearchResponse(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(1.5, hits.getAt(0).field("foo").getValue());
assertEquals(5.0, hits.getAt(1).field("foo").getValue());
assertEquals(1.25, hits.getAt(2).field("foo").getValue());
assertEquals(1.5, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(5.0, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(1.25, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].min()").get();
assertSearchResponse(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(1.0, hits.getAt(0).field("foo").getValue());
assertEquals(5.0, hits.getAt(1).field("foo").getValue());
assertEquals(-1.5, hits.getAt(2).field("foo").getValue());
assertEquals(1.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(5.0, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(-1.5, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].max()").get();
assertSearchResponse(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(5.0, hits.getAt(0).field("foo").getValue());
assertEquals(5.0, hits.getAt(1).field("foo").getValue());
assertEquals(5.0, hits.getAt(2).field("foo").getValue());
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(5.0, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(5.0, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].sum()/doc['double0'].count()").get();
assertSearchResponse(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(2.5, hits.getAt(0).field("foo").getValue());
assertEquals(5.0, hits.getAt(1).field("foo").getValue());
assertEquals(1.5, hits.getAt(2).field("foo").getValue());
assertEquals(2.5, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(5.0, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(1.5, hits.getAt(2).field("foo").getValue(), 0.0D);
}
public void testInvalidDateMethodCall() throws Exception {
@ -236,8 +236,8 @@ public class ExpressionScriptIT extends ESIntegTestCase {
ElasticsearchAssertions.assertSearchResponse(rsp);
SearchHits hits = rsp.getHits();
assertEquals(2, rsp.getHits().getTotalHits());
assertEquals(5.0, hits.getAt(0).field("foo").getValue());
assertEquals(1.0, hits.getAt(1).field("foo").getValue());
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(1.0, hits.getAt(1).field("foo").getValue(), 0.0D);
}
public void testMissingField() throws Exception {
@ -267,9 +267,9 @@ public class ExpressionScriptIT extends ESIntegTestCase {
SearchResponse rsp = buildRequest(script, "a", 2, "b", 3.5, "c", 5000000000L).get();
SearchHits hits = rsp.getHits();
assertEquals(3, hits.getTotalHits());
assertEquals(24.5, hits.getAt(0).field("foo").getValue());
assertEquals(9.5, hits.getAt(1).field("foo").getValue());
assertEquals(13.5, hits.getAt(2).field("foo").getValue());
assertEquals(24.5, hits.getAt(0).field("foo").getValue(), 0.0D);
assertEquals(9.5, hits.getAt(1).field("foo").getValue(), 0.0D);
assertEquals(13.5, hits.getAt(2).field("foo").getValue(), 0.0D);
}
public void testCompileFailure() {

View File

@ -47,8 +47,11 @@ import static org.elasticsearch.index.query.QueryBuilders.*;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.*;
import static org.hamcrest.Matchers.*;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
/**
*/
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/13315")
public class InnerHitsIT extends ESIntegTestCase {
@Test

View File

@ -1 +0,0 @@
233098147123ee5ddcd39ffc57ff648be4b7e5b2

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@

33
pom.xml
View File

@ -37,8 +37,8 @@
<!-- elasticsearch stack -->
<elasticsearch.version>${project.version}</elasticsearch.version>
<jvm.executable>${java.home}${file.separator}bin${file.separator}java</jvm.executable>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- libraries -->
<lucene.version>5.3.0</lucene.version>
@ -171,12 +171,6 @@
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.twitter</groupId>
<artifactId>jsr166e</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-test-framework</artifactId>
@ -605,7 +599,6 @@
<jvmArgs>
<param>-Xmx${tests.heap.size}</param>
<param>-Xms${tests.heap.size}</param>
<param>${java.permGenSpace}</param>
<param>-XX:MaxDirectMemorySize=512m</param>
<param>-Des.logger.prefix=</param>
<param>-XX:+HeapDumpOnOutOfMemoryError</param>
@ -1016,8 +1009,8 @@ org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
@ -1025,7 +1018,7 @@ org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.lineSplit=140
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
@ -1108,22 +1101,6 @@ org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UT
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>set-permgen</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- if we are on java 1.7.* we set perm gen space since some tests need it otherwise we just inject a dummy value -->
<condition property="java.permGenSpace" value="-XX:MaxPermSize=128m" else="-Dsome.dummy.value=" >
<matches pattern="1\.7\..+$" string="${java.runtime.version}" />
</condition>
</target>
<exportAntProperties>true</exportAntProperties>
</configuration>
</execution>
<execution>
<id>check-invalid-patterns</id>
<phase>validate</phase>