Skip to content

Commit

Permalink
odfe 1.8 version upgrade (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
vamshin authored May 19, 2020
1 parent 734a4ed commit 9b5e114
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
Build-k-NN:
strategy:
matrix:
java: [13]
java: [14]

name: Build and Release k-NN Plugin
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
Build-k-NN:
strategy:
matrix:
java: [13]
java: [14]

name: Build and Test k-NN Plugin
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
strategy:
matrix:
java: [13]
java: [14]
# Job name
name: Build KNN with JDK ${{ matrix.java }}
# This job runs on Linux
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To learn more, please see our [documentation](https://opendistro.github.io/for-e

1. Check out the package from version control.
2. Launch Intellij IDEA, choose **Import Project**, and select the `settings.gradle` file in the root of this package.
3. To build from the command line, set `JAVA_HOME` to point to a JDK >= 13 before running `./gradlew`.
3. To build from the command line, set `JAVA_HOME` to point to a JDK 14 before running `./gradlew`.

## Build

Expand Down
44 changes: 34 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@

buildscript {
ext {
es_version = System.getProperty("es.version", "7.6.1")
es_version = System.getProperty("es.version", "7.7.0")
es_group = "org.elasticsearch"
distribution = 'oss-zip'
}
Expand All @@ -38,26 +38,21 @@ buildscript {

plugins {
id 'java-library'
id 'nebula.ospackage' version "8.2.0" apply false
id 'nebula.ospackage' version "8.3.0" apply false
id 'idea'
id 'jacoco'
}

apply plugin: 'elasticsearch.esplugin'

def usingRemoteCluster = System.properties.containsKey('tests.rest.cluster') || System.properties.containsKey('tests.cluster')
def usingMultiNode = project.properties.containsKey('numNodes')
// Only apply jacoco test coverage if we are running a local single node cluster
def integTestDependOnJniLib = false
if (!usingRemoteCluster) {
integTestDependOnJniLib = true
if (!usingMultiNode) {
apply from: 'build-tools/knnplugin-coverage.gradle'
}
}

ext {
opendistroVersion = '1.7.0'
opendistroVersion = '1.8.0'
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.TXT')
Expand All @@ -76,8 +71,37 @@ allprojects {


jacoco {
toolVersion = "0.8.3"
toolVersion = "0.8.5"
}

jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it)
}))
}
}
test.finalizedBy(project.tasks.jacocoTestReport)
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.5
}

}
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it)
}))
}
}
check.dependsOn jacocoTestCoverageVerification

check.dependsOn jacocoTestReport

Expand Down
Binary file modified buildSrc/libKNNIndexV1_7_3_6.jnilib
Binary file not shown.
Binary file modified buildSrc/libKNNIndexV1_7_3_6.so
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public List<QuerySpec<?>> getQueries() {
public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
ResourceWatcherService resourceWatcherService, ScriptService scriptService,
NamedXContentRegistry xContentRegistry, Environment environment,
NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry) {
NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry,
IndexNameExpressionResolver indexNameExpressionResolver) {
KNNIndexCache.setResourceWatcherService(resourceWatcherService);
KNNSettings.state().initialize(client, clusterService);
KNNCircuitBreaker.getInstance().initialize(threadPool, clusterService, client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.amazon.opendistroforelasticsearch.knn.plugin.transport.KNNStatsRequest;

import com.amazon.opendistroforelasticsearch.knn.plugin.stats.KNNStats;
import com.google.common.collect.ImmutableList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.client.node.NodeClient;
Expand All @@ -32,6 +33,7 @@

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

Expand All @@ -53,10 +55,6 @@ public class RestKNNStatsHandler extends BaseRestHandler {
* @param knnStats KNNStats
*/
public RestKNNStatsHandler(Settings settings, RestController controller, KNNStats knnStats) {
controller.registerHandler(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/{nodeId}/stats/",this);
controller.registerHandler(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/{nodeId}/stats/{stat}",this);
controller.registerHandler(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/stats/",this);
controller.registerHandler(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/stats/{stat}",this);
this.knnStats = knnStats;
}

Expand All @@ -65,6 +63,16 @@ public String getName() {
return NAME;
}

@Override
public List<Route> routes() {
return ImmutableList.of(
new Route(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/{nodeId}/stats/"),
new Route(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/{nodeId}/stats/{stat}"),
new Route(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/stats/"),
new Route(RestRequest.Method.GET, KNNPlugin.KNN_BASE_URI + "/stats/{stat}")
);
}

@Override
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) {
// From restrequest, create a knnStatsRequest
Expand Down Expand Up @@ -119,4 +127,4 @@ private KNNStatsRequest getRequest(RestRequest request) {
}
return knnStatsRequest;
}
}
}

0 comments on commit 9b5e114

Please sign in to comment.