From 70e056fcaf6391aa8e074f5e90cd968e9175096a Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Mon, 11 Mar 2019 20:16:33 +0100 Subject: [PATCH 1/3] Bump Elasticsearch library version to 6.6.1. --- README.md | 7 ++++--- pom.xml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index db35af2..8ce6de7 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ The data sent to the StatsD server tries to be roughly equivalent to the [Indice | Elasticsearch | Plugin | Release date | | -------------- | -------------- | ------------ | +| 6.6.1 | 6.6.1.0 | Mar 11, 2019 | | 6.5.0 | 6.5.0.0 | Jan 2, 2019 | | 6.4.3 | 6.4.3.0 | Jan 1, 2019 | | 6.4.2 | 6.4.2.0 | Oct 10, 2018 | @@ -84,12 +85,12 @@ The plugin artifacts are published to Maven Central and Github. To install a pre From Github: ``` -./bin/elasticsearch-plugin install https://github.com/Automattic/elasticsearch-statsd-plugin/releases/download/6.5.0.0/elasticsearch-statsd-6.5.0.0.zip +./bin/elasticsearch-plugin install https://github.com/Automattic/elasticsearch-statsd-plugin/releases/download/6.6.1.0/elasticsearch-statsd-6.6.1.0.zip ``` From Maven Central: ``` -./bin/elasticsearch-plugin install http://repo1.maven.org/maven2/com/automattic/elasticsearch-statsd/6.5.0.0/elasticsearch-statsd-6.5.0.0.zip +./bin/elasticsearch-plugin install http://repo1.maven.org/maven2/com/automattic/elasticsearch-statsd/6.6.1.0/elasticsearch-statsd-6.6.1.0.zip ``` Change the version to match your ES version. For ES `x.y.z` the version is `x.y.z.0` @@ -105,7 +106,7 @@ mvn clean package -Djava.security.policy=src/test/resources/plugin-security-test Once we have the artifact, install it with the following command: ``` -bin/elasticsearch-plugin install file:///absolute/path/to/current/dir/target/releases/elasticsearch-statsd-6.5.0.0.zip +bin/elasticsearch-plugin install file:///absolute/path/to/current/dir/target/releases/elasticsearch-statsd-6.6.1.0.zip ``` ## Installation Elasticsearch 5.x diff --git a/pom.xml b/pom.xml index ad1e150..52b4ce2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.automattic elasticsearch-statsd - 6.5.0.0 + 6.6.1.0 jar elasticsearch-statsd @@ -46,7 +46,7 @@ - 6.5.0 + 6.6.1 4.12 1.8 UTF-8 From 2a8fd7876bee408301820dc13c91483b7ace5027 Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Mon, 11 Mar 2019 20:17:03 +0100 Subject: [PATCH 2/3] Don't use `settings` field from AbstractLifecycleComponent. --- .../java/com/automattic/elasticsearch/statsd/StatsdService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java b/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java index 72b45dd..63c9eda 100644 --- a/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java +++ b/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java @@ -75,7 +75,7 @@ public StatsdService(Settings settings, Client client, ClusterService clusterSer StatsdService.this.statsdPort)); this.statsdReporterThread = EsExecutors - .daemonThreadFactory(this.settings, "statsd_reporter") + .daemonThreadFactory(settings, "statsd_reporter") .newThread(new StatsdReporterThread()); } From c9baf4d0142986ed6eab89fe4174b660f54f24af Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Mon, 11 Mar 2019 20:20:37 +0100 Subject: [PATCH 3/3] Don't depend on `AbstractLifecycleComponent`'s logger. `AbstractLifecycleComponent` doesn't extend `AbstractComponent` anymore, so the logging facilities are unavailable. The changes in the Elasticsearch codebase now make classes instantiate their own logger objects. See more details in https://github.com/elastic/elasticsearch/pull/35560. --- .../com/automattic/elasticsearch/statsd/StatsdService.java | 4 ++++ .../elasticsearch/statsd/test/StatsdMockServer.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java b/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java index 63c9eda..bbec7d7 100644 --- a/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java +++ b/src/main/java/com/automattic/elasticsearch/statsd/StatsdService.java @@ -1,5 +1,7 @@ package com.automattic.elasticsearch.statsd; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import com.automattic.elasticsearch.plugin.StatsdPlugin; import com.timgroup.statsd.NonBlockingStatsDClient; import com.timgroup.statsd.StatsDClient; @@ -46,6 +48,8 @@ public class StatsdService extends AbstractLifecycleComponent { private final Thread statsdReporterThread; private final AtomicBoolean closed = new AtomicBoolean(false); + protected static final Logger logger = LogManager.getLogger(StatsdService.class); + @Inject public StatsdService(Settings settings, Client client, ClusterService clusterService, IndicesService indicesService, NodeService nodeService) { super(settings); diff --git a/src/test/java/com/automattic/elasticsearch/statsd/test/StatsdMockServer.java b/src/test/java/com/automattic/elasticsearch/statsd/test/StatsdMockServer.java index 534c0b0..4c9f601 100644 --- a/src/test/java/com/automattic/elasticsearch/statsd/test/StatsdMockServer.java +++ b/src/test/java/com/automattic/elasticsearch/statsd/test/StatsdMockServer.java @@ -1,7 +1,7 @@ package com.automattic.elasticsearch.statsd.test; +import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.logging.Loggers; import java.io.BufferedReader; import java.io.ByteArrayInputStream; @@ -18,7 +18,7 @@ public class StatsdMockServer extends Thread { public Collection content = new ArrayList<>(); private DatagramSocket socket; private boolean isClosed = false; - private final Logger logger = Loggers.getLogger(getClass()); + protected static final Logger logger = LogManager.getLogger(StatsdMockServer.class); public StatsdMockServer(int port) { this.port = port;