diff --git a/build.gradle b/build.gradle index 990270cb..ea0ce323 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { ext { - es_version = System.getProperty("es.version", "6.7.1") + es_version = System.getProperty("es.version", "7.2.0") } // This isn't applying from repositories.gradle so repeating it here repositories { @@ -34,7 +34,7 @@ plugins { } ext { - opendistroVersion = '0.9.0' + opendistroVersion = '1.2.0' isSnapshot = "true" == System.getProperty("build.snapshot", "true") } @@ -146,7 +146,6 @@ dependencyLicenses.doFirst { integTestRunner { // add "-Dtests.security.manager=false" to VM options if you want to run integ tests in IntelliJ systemProperty 'tests.security.manager', 'false' - ifNoTests 'ignore' } bundlePlugin { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 44e7c4d1..f4d7b2bf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/release-notes b/release-notes index e4969e53..185b86eb 100644 --- a/release-notes +++ b/release-notes @@ -1,3 +1,15 @@ +## Version 1.2.0 (Version compatible with elasticsearch 7.2.0) +## New Features +This is the release of the Open Distro Performance Analyzer that will work with elasticsearch 7.2.0 + +## Version 1.1.0 (Version compatible with elasticsearch 7.1.1) +## New Features +This is the release of the Open Distro Performance Analyzer that will work with elasticsearch 7.1.1 + +## Version 1.0.0 (Version compatible with elasticsearch 7.0.1) +## New Features +This is the release of the Open Distro Performance Analyzer that will work with elasticsearch 7.0.1 + ## Version 0.9.0 (Version compatible with elasticsearch 6.7.1) ## New Features This is the release of the Open Distro Performance Analyzer that will work with elasticsearch 6.7.1 diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/TransportWhoAmIAction.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/TransportWhoAmIAction.java index 57aea2ec..9bc277e8 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/TransportWhoAmIAction.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/TransportWhoAmIAction.java @@ -20,25 +20,23 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import org.elasticsearch.indices.IndicesService; +import org.elasticsearch.tasks.Task; public class TransportWhoAmIAction extends HandledTransportAction { @Inject - public TransportWhoAmIAction(final Settings settings, final ThreadPool threadPool, - final TransportService transportService, final ActionFilters actionFilters, - final IndexNameExpressionResolver indexNameExpressionResolver, final IndicesService indicesService) { - super(settings, WhoAmIAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, WhoAmIRequest::new); + public TransportWhoAmIAction(final TransportService transportService, + final ActionFilters actionFilters, + final IndicesService indicesService) { + super(WhoAmIAction.NAME, transportService, actionFilters, WhoAmIRequest::new); ESResources.INSTANCE.setIndicesService(indicesService); } @Override - protected void doExecute(WhoAmIRequest request, ActionListener listener) { + protected void doExecute(Task task, WhoAmIRequest request, ActionListener listener) { listener.onResponse(new WhoAmIResponse()); } } diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIAction.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIAction.java index a2294ff2..55751502 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIAction.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIAction.java @@ -16,9 +16,8 @@ package com.amazon.opendistro.elasticsearch.performanceanalyzer.http_action.whoami; import org.elasticsearch.action.Action; -import org.elasticsearch.client.ElasticsearchClient; -public class WhoAmIAction extends Action { +public class WhoAmIAction extends Action { public static final WhoAmIAction INSTANCE = new WhoAmIAction(); public static final String NAME = "cluster:admin/performanceanalyzer/whoami"; @@ -27,14 +26,8 @@ protected WhoAmIAction() { super(NAME); } - @Override - public WhoAmIRequestBuilder newRequestBuilder(final ElasticsearchClient client) { - return new WhoAmIRequestBuilder(client, this); - } - @Override public WhoAmIResponse newResponse() { return new WhoAmIResponse(); } - } diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIRequestBuilder.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIRequestBuilder.java index e89bec88..89f72737 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIRequestBuilder.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/http_action/whoami/WhoAmIRequestBuilder.java @@ -19,7 +19,7 @@ import org.elasticsearch.client.ClusterAdminClient; import org.elasticsearch.client.ElasticsearchClient; -public class WhoAmIRequestBuilder extends ActionRequestBuilder { +public class WhoAmIRequestBuilder extends ActionRequestBuilder { public WhoAmIRequestBuilder(final ClusterAdminClient client) { this(client, WhoAmIAction.INSTANCE); } diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetrics.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetrics.java index 64d32951..adbba4af 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetrics.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetrics.java @@ -81,7 +81,8 @@ public static String getCurrentTimeMetric() { } public static String generatePath(long startTime, String... keysPath) { - Path sDevShmLocationPath = Paths.get(sDevShmLocation).resolve(Paths.get(String.valueOf(PerformanceAnalyzerMetrics.getTimeInterval(startTime)), keysPath)); + Path sDevShmLocationPath = Paths.get(sDevShmLocation) + .resolve(Paths.get(String.valueOf(PerformanceAnalyzerMetrics.getTimeInterval(startTime)), keysPath)); return sDevShmLocationPath.toString(); } @@ -163,7 +164,7 @@ private static File writeToTmp(String keyPath, String value) throws Exception { } public static String getMetric(long startTime, String... keysPath) { - return getMetric(generatePath(startTime, keysPath)); + return getMetric(generatePath(startTime, keysPath)); } public static String getMetric(String keyPath) { diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rest/QueryMetricsRequestHandler.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rest/QueryMetricsRequestHandler.java index f4be281c..87972940 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rest/QueryMetricsRequestHandler.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/rest/QueryMetricsRequestHandler.java @@ -29,17 +29,16 @@ import java.util.Map; import java.util.Set; -import javax.net.ssl.HttpsURLConnection; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.logging.log4j.util.Supplier; - import org.jooq.Record; import org.jooq.Result; import com.amazon.opendistro.elasticsearch.performanceanalyzer.PerformanceAnalyzerApp; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.StatExceptionCode; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.StatsCollector; import com.amazon.opendistro.elasticsearch.performanceanalyzer.config.PluginSettings; import com.amazon.opendistro.elasticsearch.performanceanalyzer.metricsdb.MetricsDB; import com.amazon.opendistro.elasticsearch.performanceanalyzer.model.MetricAttributes; @@ -47,11 +46,9 @@ import com.amazon.opendistro.elasticsearch.performanceanalyzer.reader.ClusterLevelMetricsReader; import com.amazon.opendistro.elasticsearch.performanceanalyzer.reader.ReaderMetricsProcessor; import com.amazon.opendistro.elasticsearch.performanceanalyzer.util.JsonConverter; -import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.StatsCollector; -import com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors.StatExceptionCode; - import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; +import javax.net.ssl.HttpsURLConnection; /** * Request handler that supports querying MetricsDB on every EC2 instance. @@ -188,9 +185,10 @@ public boolean validParams(HttpExchange exchange, List metricList, List< } } } - for (String agg : aggList) { + for (String agg : aggList) { if (!MetricsDB.AGG_VALUES.contains(agg)) { - sendResponse(exchange, String.format("{\"error\":\"%s is an invalid aggregation type.\"}", agg), HttpURLConnection.HTTP_BAD_REQUEST); + sendResponse(exchange, String.format("{\"error\":\"%s is an invalid aggregation type.\"}", agg), + HttpURLConnection.HTTP_BAD_REQUEST); return false; } } diff --git a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/transport/PerformanceAnalyzerTransportRequestHandler.java b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/transport/PerformanceAnalyzerTransportRequestHandler.java index 8d88ab14..00826b07 100644 --- a/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/transport/PerformanceAnalyzerTransportRequestHandler.java +++ b/src/main/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/transport/PerformanceAnalyzerTransportRequestHandler.java @@ -79,9 +79,4 @@ private TransportChannel getShardBulkChannel(T request, TransportChannel channel return performanceanalyzerChannel; } - - @Override - public void messageReceived(T request, TransportChannel channel) throws Exception { - messageReceived(request, channel, null); - } } diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetricsTests.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetricsTests.java index da43e982..51a388fc 100644 --- a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetricsTests.java +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/metrics/PerformanceAnalyzerMetricsTests.java @@ -15,25 +15,24 @@ package com.amazon.opendistro.elasticsearch.performanceanalyzer.metrics; -import com.amazon.opendistro.elasticsearch.performanceanalyzer.config.PluginSettings; -import static org.junit.Assert.assertEquals; -import org.junit.Test; import org.junit.Before; -import static org.mockito.Mockito.when; -import org.mockito.Mock; +import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.junit.runner.RunWith; import org.powermock.modules.junit4.PowerMockRunner; -@PowerMockIgnore({ "org.apache.logging.log4j.*" }) +import com.amazon.opendistro.elasticsearch.performanceanalyzer.config.PluginSettings; +import static org.junit.Assert.assertEquals; + +@PowerMockIgnore({"org.apache.logging.log4j.*"}) @RunWith(PowerMockRunner.class) -@PrepareForTest({ PerformanceAnalyzerMetrics.class, PluginSettings.class }) -@SuppressStaticInitializationFor({ "PluginSettings" }) +@PrepareForTest({PerformanceAnalyzerMetrics.class, PluginSettings.class}) +@SuppressStaticInitializationFor({"PluginSettings"}) public class PerformanceAnalyzerMetricsTests { @Before @@ -59,7 +58,8 @@ public void testBasicMetric() { public void testGeneratePath() { long startTimeInMillis = 1553725339; String generatedPath = PerformanceAnalyzerMetrics.generatePath(startTimeInMillis, "dir1", "id", "dir2"); - String expectedPath = PerformanceAnalyzerMetrics.sDevShmLocation + "/" + String.valueOf(PerformanceAnalyzerMetrics.getTimeInterval(startTimeInMillis)) + "/dir1/id/dir2"; + String expectedPath = PerformanceAnalyzerMetrics.sDevShmLocation + + "/" + PerformanceAnalyzerMetrics.getTimeInterval(startTimeInMillis) + "/dir1/id/dir2"; assertEquals(expectedPath, generatedPath); } }