update to 6.3.2.4, update to Gradle 5.1
This commit is contained in:
parent
db95d266d3
commit
6611a55cba
20 changed files with 110 additions and 82 deletions
|
@ -7,7 +7,7 @@ dependencies {
|
||||||
exclude group: 'org.elasticsearch.plugin', module: 'percolator-client'
|
exclude group: 'org.elasticsearch.plugin', module: 'percolator-client'
|
||||||
exclude group: 'org.elasticsearch.plugin', module: 'lang-mustache-client'
|
exclude group: 'org.elasticsearch.plugin', module: 'lang-mustache-client'
|
||||||
}
|
}
|
||||||
// we try to override the Elasticsearch netty by our netty version which might be more recent
|
// we try to override the Elasticsearch netty by our netty version which is more recent
|
||||||
compile "io.netty:netty-buffer:${rootProject.property('netty.version')}"
|
compile "io.netty:netty-buffer:${rootProject.property('netty.version')}"
|
||||||
compile "io.netty:netty-codec-http:${rootProject.property('netty.version')}"
|
compile "io.netty:netty-codec-http:${rootProject.property('netty.version')}"
|
||||||
compile "io.netty:netty-handler:${rootProject.property('netty.version')}"
|
compile "io.netty:netty-handler:${rootProject.property('netty.version')}"
|
||||||
|
|
75
build.gradle
75
build.gradle
|
@ -1,12 +1,27 @@
|
||||||
|
import java.time.ZonedDateTime
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url 'http://xbib.org/repository'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "org.sonarqube" version "2.6.1"
|
id "org.sonarqube" version "2.6.1"
|
||||||
id "io.codearte.nexus-staging" version "0.11.0"
|
id "io.codearte.nexus-staging" version "0.11.0"
|
||||||
id "org.xbib.gradle.plugin.asciidoctor" version "1.6.0.0"
|
id "org.xbib.gradle.plugin.asciidoctor" version "1.6.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" +
|
printf "Date: %s\nHost: %s\nOS: %s %s %s\nJava: %s %s %s %s\nGradle: %s Groovy: %s Java: %s\n" +
|
||||||
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
|
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
|
||||||
|
ZonedDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME),
|
||||||
InetAddress.getLocalHost(),
|
InetAddress.getLocalHost(),
|
||||||
System.getProperty("os.name"),
|
System.getProperty("os.name"),
|
||||||
System.getProperty("os.arch"),
|
System.getProperty("os.arch"),
|
||||||
|
@ -15,19 +30,25 @@ printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" +
|
||||||
System.getProperty("java.vm.version"),
|
System.getProperty("java.vm.version"),
|
||||||
System.getProperty("java.vm.vendor"),
|
System.getProperty("java.vm.vendor"),
|
||||||
System.getProperty("java.vm.name"),
|
System.getProperty("java.vm.name"),
|
||||||
GroovySystem.getVersion(),
|
gradle.gradleVersion, GroovySystem.getVersion(), JavaVersion.current()
|
||||||
gradle.gradleVersion
|
|
||||||
|
|
||||||
apply plugin: "io.codearte.nexus-staging"
|
apply plugin: "io.codearte.nexus-staging"
|
||||||
|
apply plugin: 'org.xbib.gradle.plugin.asciidoctor'
|
||||||
|
|
||||||
|
ext {
|
||||||
|
user = 'jprante'
|
||||||
|
name = 'elx'
|
||||||
|
description = 'Elasticsearch extensions'
|
||||||
|
scmUrl = 'https://github.com/' + user + '/' + name
|
||||||
|
scmConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
|
||||||
|
scmDeveloperConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
|
||||||
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
//apply plugin: 'findbugs'
|
|
||||||
//apply plugin: 'pmd'
|
|
||||||
//apply plugin: 'checkstyle'
|
|
||||||
apply plugin: 'org.xbib.gradle.plugin.asciidoctor'
|
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
wagon
|
wagon
|
||||||
|
@ -36,36 +57,24 @@ subprojects {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
//testCompile "junit:junit:${project.property('junit.version')}"
|
|
||||||
//testCompile "org.apache.logging.log4j:log4j-core:${project.property('log4j.version')}"
|
|
||||||
alpnagent "org.mortbay.jetty.alpn:jetty-alpn-agent:${project.property('alpnagent.version')}"
|
alpnagent "org.mortbay.jetty.alpn:jetty-alpn-agent:${project.property('alpnagent.version')}"
|
||||||
asciidoclet "org.xbib:asciidoclet:${project.property('asciidoclet.version')}"
|
asciidoclet "org.xbib:asciidoclet:${project.property('asciidoclet.version')}"
|
||||||
wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}"
|
wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_9
|
compileJava {
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
tasks.withType(JavaCompile) {
|
}
|
||||||
options.compilerArgs << "-proc:none" << "-Xlint:all,-rawtypes,-unchecked,-try" << "--release" << "8" //<< "-profile" << "compact3"
|
compileTestJava {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
baseName "${rootProject.name}-${project.name}"
|
baseName "${rootProject.name}-${project.name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
asciidoctor {
|
|
||||||
attributes toc: 'left',
|
|
||||||
doctype: 'book',
|
|
||||||
icons: 'font',
|
|
||||||
encoding: 'utf-8',
|
|
||||||
sectlink: true,
|
|
||||||
sectanchors: true,
|
|
||||||
linkattrs: true,
|
|
||||||
imagesdir: 'img',
|
|
||||||
'source-highlighter': 'coderay'
|
|
||||||
}
|
|
||||||
|
|
||||||
javadoc {
|
javadoc {
|
||||||
options.docletpath = configurations.asciidoclet.files.asType(List)
|
options.docletpath = configurations.asciidoclet.files.asType(List)
|
||||||
options.doclet = 'org.xbib.asciidoclet.Asciidoclet'
|
options.doclet = 'org.xbib.asciidoclet.Asciidoclet'
|
||||||
|
@ -108,6 +117,18 @@ subprojects {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*asciidoctor {
|
||||||
|
attributes toc: 'left',
|
||||||
|
doctype: 'book',
|
||||||
|
icons: 'font',
|
||||||
|
encoding: 'utf-8',
|
||||||
|
sectlink: true,
|
||||||
|
sectanchors: true,
|
||||||
|
linkattrs: true,
|
||||||
|
imagesdir: 'img',
|
||||||
|
'source-highlighter': 'coderay'
|
||||||
|
}*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
task aggregatedJavadoc(type: Javadoc) {
|
task aggregatedJavadoc(type: Javadoc) {
|
||||||
group = 'aggregation'
|
group = 'aggregation'
|
||||||
|
|
|
@ -6,7 +6,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
|
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,18 +21,20 @@ dependencies {
|
||||||
compile project(':api')
|
compile project(':api')
|
||||||
compile "org.xbib:metrics:${project.property('xbib-metrics.version')}"
|
compile "org.xbib:metrics:${project.property('xbib-metrics.version')}"
|
||||||
compileOnly "org.apache.logging.log4j:log4j-api:${project.property('log4j.version')}"
|
compileOnly "org.apache.logging.log4j:log4j-api:${project.property('log4j.version')}"
|
||||||
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
baseName "${rootProject.name}-common"
|
baseName "${rootProject.name}-common"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
baseName = "${project.archivesBaseName}-tests"
|
baseName = "${project.archivesBaseName}-tests"
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
main jar
|
main jar
|
||||||
|
@ -56,7 +58,7 @@ randomizedTest {
|
||||||
|
|
||||||
esTest {
|
esTest {
|
||||||
// test with the jars, not the classes, for security manager
|
// test with the jars, not the classes, for security manager
|
||||||
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
// classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
||||||
systemProperty 'tests.security.manager', 'true'
|
systemProperty 'tests.security.manager', 'true'
|
||||||
}
|
}
|
||||||
esTest.dependsOn jar, testJar
|
esTest.dependsOn jar, testJar
|
||||||
|
|
|
@ -1,28 +1,30 @@
|
||||||
org.gradle.daemon=false
|
|
||||||
org.gradle.warning.mode=all
|
|
||||||
|
|
||||||
group = org.xbib.elasticsearch
|
group = org.xbib.elasticsearch
|
||||||
name = elasticsearch-client-netty
|
name = elasticsearch-client
|
||||||
version = 6.2.2.0
|
version = 6.3.2.0
|
||||||
|
profile = default
|
||||||
|
release = 0
|
||||||
|
|
||||||
elasticsearch.version = 6.2.2
|
elasticsearch.version = 6.3.2
|
||||||
netty.version = 4.1.24.Final
|
lucene.version = 7.3.1
|
||||||
tcnative.version = 2.0.7.Final
|
|
||||||
|
netty.version = 4.1.29.Final
|
||||||
|
tcnative.version = 2.0.15.Final
|
||||||
alpnagent.version = 2.0.7
|
alpnagent.version = 2.0.7
|
||||||
#xbib-netty-http-client.version = 4.1.16.1
|
xbib-netty-http-client.version = 4.1.29.0
|
||||||
xbib-netty-http-client.version = 4.1.24.0
|
|
||||||
xbib-metrics.version = 1.1.0
|
xbib-metrics.version = 1.1.0
|
||||||
|
|
||||||
# elasticsearch build plugin
|
# elasticsearch build plugin
|
||||||
xbib-elasticsearch-test.version = 6.2.2.0
|
elasticsearch-libs.version = 6.3.2.1
|
||||||
lucene.version = 7.2.1
|
elasticsearch-devkit.version = 6.3.2.4
|
||||||
spatial4j.version = 0.6
|
spatial4j.version = 0.7
|
||||||
jts.version = 1.13
|
jts.version = 1.15.1
|
||||||
jna.version = 4.5.1
|
jna.version = 4.5.2
|
||||||
|
log4j.version = 2.11.1
|
||||||
|
checkstyle.version = 8.13
|
||||||
|
|
||||||
# test
|
# test
|
||||||
log4j.version = 2.9.1
|
|
||||||
junit.version = 4.12
|
junit.version = 4.12
|
||||||
wagon.version = 3.0.0
|
wagon.version = 3.0.0
|
||||||
asciidoclet.version = 1.6.0.0
|
asciidoclet.version = 1.6.0.0
|
||||||
|
|
||||||
|
org.gradle.warning.mode=all
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
ext {
|
|
||||||
user = 'xbib'
|
|
||||||
name = 'elasticsearch-java-client'
|
|
||||||
description = 'Netty Java client for Elasticsearch'
|
|
||||||
scmUrl = 'https://github.com/' + user + '/' + name
|
|
||||||
scmConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
|
|
||||||
scmDeveloperConnection = 'scm:git:git://github.com/' + user + '/' + name + '.git'
|
|
||||||
}
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,5 @@
|
||||||
#Fri May 04 14:40:54 CEST 2018
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
|
|
||||||
|
|
2
gradlew
vendored
2
gradlew
vendored
|
@ -28,7 +28,7 @@ APP_NAME="Gradle"
|
||||||
APP_BASE_NAME=`basename "$0"`
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS=""
|
DEFAULT_JVM_OPTS='"-Xmx64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
|
|
2
gradlew.bat
vendored
2
gradlew.bat
vendored
|
@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS=
|
set DEFAULT_JVM_OPTS="-Xmx64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
|
@ -6,7 +6,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
|
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,18 +20,20 @@ configurations {
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':common')
|
compile project(':common')
|
||||||
compile "org.xbib:netty-http-client:${project.property('xbib-netty-http-client.version')}"
|
compile "org.xbib:netty-http-client:${project.property('xbib-netty-http-client.version')}"
|
||||||
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
baseName "${rootProject.name}-common"
|
baseName "${rootProject.name}-common"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
baseName = "${project.archivesBaseName}-tests"
|
baseName = "${project.archivesBaseName}-tests"
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
main jar
|
main jar
|
||||||
|
@ -55,7 +57,7 @@ randomizedTest {
|
||||||
esTest {
|
esTest {
|
||||||
enabled = true
|
enabled = true
|
||||||
// test with the jars, not the classes, for security manager
|
// test with the jars, not the classes, for security manager
|
||||||
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
// classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
||||||
systemProperty 'tests.security.manager', 'true'
|
systemProperty 'tests.security.manager', 'true'
|
||||||
// maybe we like some extra security policy for our code
|
// maybe we like some extra security policy for our code
|
||||||
systemProperty 'tests.security.policy', '/extra-security.policy'
|
systemProperty 'tests.security.policy', '/extra-security.policy'
|
||||||
|
|
|
@ -119,7 +119,10 @@ public class HttpNodesInfoAction extends HttpAction<NodesInfoRequest, NodesInfoR
|
||||||
try {
|
try {
|
||||||
InetAddress[] inetAddresses = InetAddress.getAllByName(host);
|
InetAddress[] inetAddresses = InetAddress.getAllByName(host);
|
||||||
TransportAddress transportAddress = new TransportAddress(inetAddresses[0], port);
|
TransportAddress transportAddress = new TransportAddress(inetAddresses[0], port);
|
||||||
Build build = new Build((String) map2.get("build"), (String)map2.get("date"), (Boolean)map2.get("snapshst"));
|
Build build = new Build(Build.Flavor.OSS, Build.Type.TAR,
|
||||||
|
(String) map2.get("build"),
|
||||||
|
(String)map2.get("date"),
|
||||||
|
(Boolean)map2.get("snapshot"));
|
||||||
Map<String, String> attributes = Collections.emptyMap();
|
Map<String, String> attributes = Collections.emptyMap();
|
||||||
Set<DiscoveryNode.Role> roles = new HashSet<>();
|
Set<DiscoveryNode.Role> roles = new HashSet<>();
|
||||||
Version version = Version.fromString((String) map2.get("version"));
|
Version version = Version.fromString((String) map2.get("version"));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.elasticsearch.action.admin.cluster.settings;
|
package org.elasticsearch.action.admin.cluster.settings;
|
||||||
|
|
||||||
import org.elasticsearch.common.CheckedFunction;
|
import org.elasticsearch.common.CheckedFunction;
|
||||||
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
|
@ -32,7 +33,7 @@ public class HttpClusterUpdateSettingsAction extends HttpAction<ClusterUpdateSet
|
||||||
builder.startObject("transient");
|
builder.startObject("transient");
|
||||||
request.transientSettings().toXContent(builder, ToXContent.EMPTY_PARAMS);
|
request.transientSettings().toXContent(builder, ToXContent.EMPTY_PARAMS);
|
||||||
builder.endObject().endObject();
|
builder.endObject().endObject();
|
||||||
return newPutRequest(url, "/_cluster/settings", builder.bytes());
|
return newPutRequest(url, "/_cluster/settings", BytesReference.bytes(builder));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new UncheckedIOException(e);
|
throw new UncheckedIOException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package org.elasticsearch.action.admin.indices.create;
|
package org.elasticsearch.action.admin.indices.create;
|
||||||
|
|
||||||
import org.elasticsearch.common.CheckedFunction;
|
import org.elasticsearch.common.CheckedFunction;
|
||||||
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.xbib.elasticsearch.client.http.HttpAction;
|
import org.xbib.elasticsearch.client.http.HttpAction;
|
||||||
import org.xbib.netty.http.client.Request;
|
|
||||||
import org.xbib.netty.http.client.RequestBuilder;
|
import org.xbib.netty.http.client.RequestBuilder;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -22,7 +22,7 @@ public class HttpCreateIndexAction extends HttpAction<CreateIndexRequest, Create
|
||||||
protected RequestBuilder createHttpRequest(String url, CreateIndexRequest createIndexRequest) throws IOException {
|
protected RequestBuilder createHttpRequest(String url, CreateIndexRequest createIndexRequest) throws IOException {
|
||||||
XContentBuilder builder = XContentFactory.jsonBuilder();
|
XContentBuilder builder = XContentFactory.jsonBuilder();
|
||||||
builder = createIndexRequest.toXContent(builder, ToXContent.EMPTY_PARAMS);
|
builder = createIndexRequest.toXContent(builder, ToXContent.EMPTY_PARAMS);
|
||||||
return newPutRequest(url, "/" + createIndexRequest.index(), builder.bytes());
|
return newPutRequest(url, "/" + createIndexRequest.index(), BytesReference.bytes(builder));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.elasticsearch.action.admin.indices.settings.put;
|
package org.elasticsearch.action.admin.indices.settings.put;
|
||||||
|
|
||||||
import org.elasticsearch.common.CheckedFunction;
|
import org.elasticsearch.common.CheckedFunction;
|
||||||
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
|
@ -30,7 +31,7 @@ public class HttpUpdateSettingsAction extends HttpAction<UpdateSettingsRequest,
|
||||||
request.settings().toXContent(builder, ToXContent.EMPTY_PARAMS);
|
request.settings().toXContent(builder, ToXContent.EMPTY_PARAMS);
|
||||||
builder.endObject();
|
builder.endObject();
|
||||||
String index = request.indices() != null ? "/" + String.join(",", request.indices()) : "";
|
String index = request.indices() != null ? "/" + String.join(",", request.indices()) : "";
|
||||||
return newPutRequest(url, index + "/_settings", builder.bytes());
|
return newPutRequest(url, index + "/_settings", BytesReference.bytes(builder));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new UncheckedIOException(e);
|
throw new UncheckedIOException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.action.GenericAction;
|
||||||
import org.elasticsearch.common.CheckedFunction;
|
import org.elasticsearch.common.CheckedFunction;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
import org.elasticsearch.common.xcontent.DeprecationHandler;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
import org.elasticsearch.common.xcontent.XContentType;
|
import org.elasticsearch.common.xcontent.XContentType;
|
||||||
import org.xbib.netty.http.client.Request;
|
import org.xbib.netty.http.client.Request;
|
||||||
|
@ -143,6 +144,7 @@ public abstract class HttpAction<R extends ActionRequest, T extends ActionRespon
|
||||||
throw new IllegalStateException("unsupported content-type: " + mediaType);
|
throw new IllegalStateException("unsupported content-type: " + mediaType);
|
||||||
}
|
}
|
||||||
try (XContentParser parser = xContentType.xContent().createParser(httpActionContext.getHttpClient().getRegistry(),
|
try (XContentParser parser = xContentType.xContent().createParser(httpActionContext.getHttpClient().getRegistry(),
|
||||||
|
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
|
||||||
httpActionContext.getHttpResponse().content().array())) {
|
httpActionContext.getHttpResponse().content().array())) {
|
||||||
return entityParser().apply(parser);
|
return entityParser().apply(parser);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
|
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,18 +19,20 @@ configurations {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':common')
|
compile project(':common')
|
||||||
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
baseName "${rootProject.name}-node"
|
baseName "${rootProject.name}-node"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
baseName = "${project.archivesBaseName}-tests"
|
baseName = "${project.archivesBaseName}-tests"
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
main jar
|
main jar
|
||||||
|
@ -55,7 +57,7 @@ randomizedTest {
|
||||||
|
|
||||||
esTest {
|
esTest {
|
||||||
// test with the jars, not the classes, for security manager
|
// test with the jars, not the classes, for security manager
|
||||||
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
// classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
||||||
systemProperty 'tests.security.manager', 'true'
|
systemProperty 'tests.security.manager', 'true'
|
||||||
// maybe we like some extra security policy for our code
|
// maybe we like some extra security policy for our code
|
||||||
systemProperty 'tests.security.policy', '/extra-security.policy'
|
systemProperty 'tests.security.policy', '/extra-security.policy'
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
include 'api'
|
include 'api'
|
||||||
include 'common'
|
include 'common'
|
||||||
include 'node'
|
include 'node'
|
||||||
|
|
|
@ -6,7 +6,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.2.2.0"
|
classpath "org.xbib.elasticsearch:gradle-plugin-elasticsearch-build:6.3.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,18 +19,20 @@ configurations {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':common')
|
compile project(':common')
|
||||||
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testCompile "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('xbib-elasticsearch-test.version')}"
|
testRuntime "org.xbib.elasticsearch:elasticsearch-test-framework:${project.property('elasticsearch-devkit.version')}"
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
baseName "${rootProject.name}-transport"
|
baseName "${rootProject.name}-transport"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
baseName = "${project.archivesBaseName}-tests"
|
baseName = "${project.archivesBaseName}-tests"
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
main jar
|
main jar
|
||||||
|
@ -41,7 +43,7 @@ artifacts {
|
||||||
esTest {
|
esTest {
|
||||||
enabled = true
|
enabled = true
|
||||||
// test with the jars, not the classes, for security manager
|
// test with the jars, not the classes, for security manager
|
||||||
classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
//classpath = files(configurations.testRuntime) + configurations.main.artifacts.files + configurations.tests.artifacts.files
|
||||||
systemProperty 'tests.security.manager', 'true'
|
systemProperty 'tests.security.manager', 'true'
|
||||||
// maybe we like some extra security policy for our code
|
// maybe we like some extra security policy for our code
|
||||||
systemProperty 'tests.security.policy', '/extra-security.policy'
|
systemProperty 'tests.security.policy', '/extra-security.policy'
|
||||||
|
@ -60,4 +62,4 @@ test {
|
||||||
showStandardStreams = true
|
showStandardStreams = true
|
||||||
exceptionFormat = 'full'
|
exceptionFormat = 'full'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.xbib.elasticsearch.client.transport;
|
package org.xbib.elasticsearch.client.transport;
|
||||||
|
|
||||||
import org.elasticsearch.common.inject.internal.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.transport.TransportRequestOptions;
|
import org.elasticsearch.transport.TransportRequestOptions;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public final class RemoteConnectionInfo implements ToXContentFragment, Writeable
|
||||||
seedNodes = input.readList(TransportAddress::new);
|
seedNodes = input.readList(TransportAddress::new);
|
||||||
httpAddresses = input.readList(TransportAddress::new);
|
httpAddresses = input.readList(TransportAddress::new);
|
||||||
connectionsPerCluster = input.readVInt();
|
connectionsPerCluster = input.readVInt();
|
||||||
initialConnectionTimeout = new TimeValue(input);
|
initialConnectionTimeout = input.readTimeValue();
|
||||||
numNodesConnected = input.readVInt();
|
numNodesConnected = input.readVInt();
|
||||||
clusterAlias = input.readString();
|
clusterAlias = input.readString();
|
||||||
if (input.getVersion().onOrAfter(Version.V_6_1_0)) {
|
if (input.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||||
|
@ -82,7 +82,7 @@ public final class RemoteConnectionInfo implements ToXContentFragment, Writeable
|
||||||
out.writeList(seedNodes);
|
out.writeList(seedNodes);
|
||||||
out.writeList(httpAddresses);
|
out.writeList(httpAddresses);
|
||||||
out.writeVInt(connectionsPerCluster);
|
out.writeVInt(connectionsPerCluster);
|
||||||
initialConnectionTimeout.writeTo(out);
|
out.writeTimeValue(initialConnectionTimeout);
|
||||||
out.writeVInt(numNodesConnected);
|
out.writeVInt(numNodesConnected);
|
||||||
out.writeString(clusterAlias);
|
out.writeString(clusterAlias);
|
||||||
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
if (out.getVersion().onOrAfter(Version.V_6_1_0)) {
|
||||||
|
|
Loading…
Reference in a new issue