Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Support Elasticsearch 7.10 (#82)
Browse files Browse the repository at this point in the history
* Support Elasticsearch 7.10

* Fix link for release notes
  • Loading branch information
lezzago authored Nov 17, 2020
1 parent 65cad9d commit 8492cf1
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 24 deletions.
15 changes: 9 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

buildscript {
ext {
es_version = System.getProperty("es.version", "7.9.1")
es_version = System.getProperty("es.version", "7.10.0")
}

repositories {
Expand All @@ -39,6 +39,7 @@ ext {

apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.testclusters'
apply plugin: 'elasticsearch.java-rest-test'

ext {
projectSubstitutions = [:]
Expand All @@ -55,22 +56,23 @@ dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
forbiddenApisTest.ignoreFailures = true
validateNebulaPom.enabled = false
loggerUsageCheck.enabled = false

esplugin {
name 'opendistro-job-scheduler'
description 'Open Distro for Elasticsearch job schduler plugin'
classname 'com.amazon.opendistroforelasticsearch.jobscheduler.JobSchedulerPlugin'
}

testClusters.integTest {
testDistribution = 'OSS'
}

integTest.runner {
javaRestTest {
// add "-Dtests.security.manager=false" to VM options if you want to run integ tests in IntelliJ
systemProperty 'tests.security.manager', 'false'
}

testClusters.javaRestTest {
testDistribution = 'OSS'
}

allprojects {
group = 'com.amazon.opendistroforelasticsearch'
version = "${opendistroVersion}.0"
Expand All @@ -89,6 +91,7 @@ allprojects {

dependencies {
compile project(path: ":${rootProject.name}-spi", configuration: 'shadow')
javaRestTestImplementation project.sourceSets.main.runtimeClasspath
}

// RPM & Debian build
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# permissions and limitations under the License.
#

version = 1.11.0
version = 1.12.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## 2020-11-17 Version 1.12.0.0

Compatible with Elasticsearch 7.10

### Maintenance
* Support Elasticsearch 7.10 ([#82](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/82))
14 changes: 7 additions & 7 deletions sample-extension-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.testclusters'
apply plugin: 'elasticsearch.java-rest-test'

esplugin {
name 'opendistro-job-scheduler-sample-extension'
Expand All @@ -35,16 +36,15 @@ dependencies {

licenseHeaders.enabled = false
validateNebulaPom.enabled = false
testingConventions.enabled = false;
testingConventions.enabled = false
loggerUsageCheck.enabled = false

integTest.dependsOn(rootProject.assemble)
integTestRunner {
javaRestTest.dependsOn(rootProject.assemble)
javaRestTest {
systemProperty 'tests.security.manager', 'false'
}
testClusters.integTest {
testClusters.javaRestTest {
testDistribution = 'OSS'
// need to install job-scheduler first, need to assemble job-scheduler first
plugin file("${rootProject.getBuildDir()}/distributions/${rootProject.getName()}-${project.getVersion()}.zip")
}

// As of ES 7.7 the sample-extension-plugin is being added to the list of plugins for the testCluster during build before
Expand All @@ -53,7 +53,7 @@ testClusters.integTest {
// Will need to do a deep dive to find out exactly what task adds the sample-extension-plugin and add job-scheduler there but a temporary hack is to
// reorder the plugins list after evaluation but prior to task execution when the plugins are installed.
afterEvaluate {
testClusters.integTest.nodes.each { node ->
testClusters.javaRestTest.nodes.each { node ->
def plugins = node.plugins
def firstPlugin = plugins.get(0)
if (firstPlugin.provider == project.bundlePlugin.archiveFile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public ScheduledJobRunner getJobRunner() {
public ScheduledJobParser getJobParser() {
return (parser, id, jobDocVersion) -> {
SampleJobParameter jobParameter = new SampleJobParameter();
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser::getTokenLocation);
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser);

while (!parser.nextToken().equals(XContentParser.Token.END_OBJECT)) {
String fieldName = parser.currentName();
Expand Down
7 changes: 3 additions & 4 deletions spi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ plugins {

apply plugin: 'elasticsearch.java'
apply plugin: 'elasticsearch.testclusters'
apply plugin: 'elasticsearch.java-rest-test'

ext {
projectSubstitutions = [:]
Expand Down Expand Up @@ -75,14 +76,12 @@ test {
task integTest(type: RestIntegTestTask) {
description 'Run integ test with elasticsearch test framework'
group 'verification'
runner {
systemProperty 'tests.security.manager', 'false'
}
systemProperty 'tests.security.manager', 'false'
dependsOn test
}
check.dependsOn integTest

testClusters.integTest {
testClusters.javaRestTest {
testDistribution = 'OSS'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static LockModel parse(final XContentParser parser, long seqNo, long prim
Long lockDurationSecond = null;
Boolean released = null;

XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser::getTokenLocation);
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser);
while (!XContentParser.Token.END_OBJECT.equals(parser.nextToken())) {
String fieldName = parser.currentName();
parser.nextToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
public class ScheduleParser {
public static Schedule parse(XContentParser parser) throws IOException {
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser::getTokenLocation);
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser);

while(!XContentParser.Token.END_OBJECT.equals(parser.nextToken())) {
String fieldName = parser.currentName();
Expand All @@ -52,7 +52,7 @@ public static Schedule parse(XContentParser parser) throws IOException {
}
}
XContentParserUtils.ensureExpectedToken(XContentParser.Token.END_OBJECT, parser.currentToken(),
parser::getTokenLocation);
parser);
parser.nextToken();
return new CronSchedule(expression, timezone);
case IntervalSchedule.INTERVAL_FIELD:
Expand All @@ -78,7 +78,7 @@ public static Schedule parse(XContentParser parser) throws IOException {
}
}
XContentParserUtils.ensureExpectedToken(XContentParser.Token.END_OBJECT, parser.currentToken(),
parser::getTokenLocation);
parser);
parser.nextToken();
return new IntervalSchedule(startTime, period, unit);
default:
Expand Down

0 comments on commit 8492cf1

Please sign in to comment.