From 34b8472d8fb2abbaadf450520becddf8b516d513 Mon Sep 17 00:00:00 2001 From: Krzysztof Warunek Date: Wed, 6 Mar 2024 00:11:31 +0100 Subject: [PATCH] upgrade/deps_aarch64 --- config/disthene-log4j.xml.sample | 51 +- pom.xml | 30 +- .../java/net/iponweb/disthene/Disthene.java | 515 +++++++++--------- .../iponweb/disthene/carbon/CarbonServer.java | 3 +- .../disthene/carbon/CarbonServerHandler.java | 3 +- .../service/aggregate/AggregateService.java | 3 +- .../service/aggregate/RollupService.java | 3 +- .../service/aggregate/SumService.java | 3 +- .../disthene/service/index/IndexService.java | 3 +- .../disthene/service/index/IndexThread.java | 3 +- .../disthene/service/stats/StatsService.java | 3 +- .../service/store/BatchWriterThread.java | 3 +- .../service/store/CassandraService.java | 3 +- .../service/store/SingleWriterThread.java | 3 +- 14 files changed, 311 insertions(+), 318 deletions(-) diff --git a/config/disthene-log4j.xml.sample b/config/disthene-log4j.xml.sample index 5b95b91..097a07e 100644 --- a/config/disthene-log4j.xml.sample +++ b/config/disthene-log4j.xml.sample @@ -1,42 +1,23 @@ - - + + + + + + + - - - - - - - + - + - - - - - - - + - - - + - - - + + + + + - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index 01fdb6f..920a3f4 100644 --- a/pom.xml +++ b/pom.xml @@ -20,9 +20,19 @@ 1.2 - log4j - log4j - 1.2.17 + org.apache.logging.log4j + log4j-core + 2.17.1 + + + org.apache.logging.log4j + log4j-api + 2.17.0 + + + org.apache.logging.log4j + log4j-slf4j-impl + 2.17.0 commons-logging @@ -47,12 +57,7 @@ com.google.guava guava - 18.0 - - - org.apache.commons - commons-lang3 - 3.4 + 16.0.1 com.datastax.cassandra @@ -64,15 +69,10 @@ lz4 1.2.0 - - org.slf4j - slf4j-log4j12 - 1.7.12 - org.xerial.snappy snappy-java - 1.1.10.1 + 1.1.10.4 net.engio diff --git a/src/main/java/net/iponweb/disthene/Disthene.java b/src/main/java/net/iponweb/disthene/Disthene.java index 25b48da..412c077 100644 --- a/src/main/java/net/iponweb/disthene/Disthene.java +++ b/src/main/java/net/iponweb/disthene/Disthene.java @@ -1,257 +1,258 @@ -package net.iponweb.disthene; - -import com.datastax.driver.core.policies.LatencyAwarePolicy; -import net.engio.mbassy.bus.MBassador; -import net.engio.mbassy.bus.common.Properties; -import net.engio.mbassy.bus.config.BusConfiguration; -import net.engio.mbassy.bus.config.Feature; -import net.engio.mbassy.bus.error.IPublicationErrorHandler; -import net.engio.mbassy.bus.error.PublicationError; -import net.iponweb.disthene.carbon.CarbonServer; -import net.iponweb.disthene.config.AggregationConfiguration; -import net.iponweb.disthene.config.BlackListConfiguration; -import net.iponweb.disthene.config.DistheneConfiguration; -import net.iponweb.disthene.events.DistheneEvent; -import net.iponweb.disthene.service.aggregate.AggregateService; -import net.iponweb.disthene.service.aggregate.RollupService; -import net.iponweb.disthene.service.aggregate.SumService; -import net.iponweb.disthene.service.blacklist.BlacklistService; -import net.iponweb.disthene.service.index.IndexService; -import net.iponweb.disthene.service.metric.MetricService; -import net.iponweb.disthene.service.stats.StatsService; -import net.iponweb.disthene.service.store.CassandraService; -import org.apache.commons.cli.*; -import org.apache.log4j.Logger; -import org.yaml.snakeyaml.Yaml; -import sun.misc.Signal; -import sun.misc.SignalHandler; - -import javax.management.MBeanServer; -import javax.management.ObjectName; -import java.io.IOException; -import java.io.InputStream; -import java.lang.management.ManagementFactory; -import java.net.MalformedURLException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.Map; - -/** - * @author Andrei Ivanov - */ -public class Disthene { - private static Logger logger; - - public static Feature.AsynchronousMessageDispatch dispatch; - - private static final String DEFAULT_CONFIG_LOCATION = "/etc/disthene/disthene.yaml"; - private static final String DEFAULT_BLACKLIST_LOCATION = "/etc/disthene/blacklist.yaml"; - private static final String DEFAULT_AGGREGATION_CONFIG_LOCATION = "/etc/disthene/aggregator.yaml"; - private static final String DEFAULT_LOG_CONFIG_LOCATION = "/etc/disthene/disthene-log4j.xml"; - - private String configLocation; - private String blacklistLocation; - private String aggregationConfigLocation; - - private MBassador bus; - private BlacklistService blacklistService; - private MetricService metricService; - private AggregateService aggregateService; - private StatsService statsService; - private IndexService indexService; - private CassandraService cassandraService; - private SumService sumService; - private RollupService rollupService; - private CarbonServer carbonServer; - - public Disthene(String configLocation, String blacklistLocation, String aggregationConfigLocation) { - this.configLocation = configLocation; - this.blacklistLocation = blacklistLocation; - this.aggregationConfigLocation = aggregationConfigLocation; - } - - private void run() { - try { - Yaml yaml = new Yaml(); - InputStream in = Files.newInputStream(Paths.get(configLocation)); - DistheneConfiguration distheneConfiguration = yaml.loadAs(in, DistheneConfiguration.class); - in.close(); - logger.info("Running with the following config: " + distheneConfiguration.toString()); - - dispatch = Feature.AsynchronousMessageDispatch.Default(); - logger.info("Creating dispatcher"); - bus = new MBassador<>(new BusConfiguration() - .addFeature(Feature.SyncPubSub.Default()) - .addFeature(Feature.AsynchronousHandlerInvocation.Default()) - .addFeature(dispatch) - .setProperty(Properties.Handler.PublicationError, new IPublicationErrorHandler() { - @Override - public void handleError(PublicationError error) { - logger.error(error); - } - }) - ); - - logger.info("Loading blacklists"); - in = Files.newInputStream(Paths.get(blacklistLocation)); - BlackListConfiguration blackListConfiguration = new BlackListConfiguration((Map>) yaml.load(in)); - in.close(); - logger.debug("Running with the following blacklist: " + blackListConfiguration.toString()); - blacklistService = new BlacklistService(blackListConfiguration); - - logger.info("Creating metric service"); - metricService = new MetricService(bus, blacklistService, distheneConfiguration); - - logger.info("Creating base rollup aggregator"); - aggregateService = new AggregateService(bus, distheneConfiguration); - - logger.info("Creating stats"); - statsService = new StatsService(bus, distheneConfiguration.getStats(), distheneConfiguration.getCarbon().getBaseRollup()); - - try { - MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); - ObjectName name = new ObjectName("net.iponweb.disthene.service:type=Stats"); - mbs.registerMBean(statsService, name); - } catch (Exception e) { - logger.error("Failed to create MBean: " + e); - } - - logger.info("Creating ES index service"); - indexService = new IndexService(distheneConfiguration.getIndex(), bus); - - logger.info("Creating C* service"); - cassandraService = new CassandraService(distheneConfiguration.getStore(), bus); - - logger.info("Loading aggregation rules"); - in = Files.newInputStream(Paths.get(aggregationConfigLocation)); - AggregationConfiguration aggregationConfiguration = new AggregationConfiguration((Map>) yaml.load(in)); - in.close(); - logger.debug("Running with the following aggregation rule set: " + aggregationConfiguration.toString()); - logger.info("Creating sum aggregator"); - sumService = new SumService(bus, distheneConfiguration, aggregationConfiguration, blacklistService); - - logger.info("Creating rollup aggregator"); - rollupService = new RollupService(bus, distheneConfiguration, distheneConfiguration.getCarbon().getRollups()); - - logger.info("Starting carbon"); - carbonServer = new CarbonServer(distheneConfiguration, bus); - carbonServer.run(); - - // adding signal handlers - Signal.handle(new Signal("HUP"), new SighupSignalHandler()); - - Signal.handle(new Signal("TERM"), new SigtermSignalHandler()); - } catch (IOException e) { - logger.error(e); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) throws MalformedURLException { - Options options = new Options(); - options.addOption("c", "config", true, "config location"); - options.addOption("l", "log-config", true, "log config location"); - options.addOption("b", "blacklist", true, "blacklist location"); - options.addOption("a", "agg-config", true, "aggregation config location"); - - CommandLineParser parser = new GnuParser(); - - try { - CommandLine commandLine = parser.parse(options, args); - System.getProperties().setProperty("log4j.configuration", "file:" + commandLine.getOptionValue("l", DEFAULT_LOG_CONFIG_LOCATION)); - logger = Logger.getLogger(Disthene.class); - - new Disthene(commandLine.getOptionValue("c", DEFAULT_CONFIG_LOCATION), - commandLine.getOptionValue("b", DEFAULT_BLACKLIST_LOCATION), - commandLine.getOptionValue("a", DEFAULT_AGGREGATION_CONFIG_LOCATION) - ).run(); - - } catch (ParseException e) { - HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp("Disthene", options); - } catch (Exception e) { - System.out.println("Start failed"); - e.printStackTrace(); - } - - } - - private class SighupSignalHandler implements SignalHandler { - - @Override - public void handle(Signal signal) { - logger.info("Received sighup"); - - logger.info("Reloading blacklists"); - try { - Yaml yaml = new Yaml(); - InputStream in = Files.newInputStream(Paths.get(blacklistLocation)); - BlackListConfiguration blackListConfiguration = new BlackListConfiguration((Map>) yaml.load(in)); - in.close(); - - blacklistService.setRules(blackListConfiguration); - - logger.debug("Reloaded blacklist: " + blackListConfiguration.toString()); - } catch (Exception e) { - logger.error("Reloading blacklists failed"); - logger.error(e); - } - - logger.info("Reloading aggregation rules"); - try { - Yaml yaml = new Yaml(); - InputStream in = Files.newInputStream(Paths.get(aggregationConfigLocation)); - AggregationConfiguration aggregationConfiguration = new AggregationConfiguration((Map>) yaml.load(in)); - in.close(); - - sumService.setAggregationConfiguration(aggregationConfiguration); - logger.debug("Reloaded aggregation rules: " + aggregationConfiguration.toString()); - } catch (Exception e) { - logger.error("Reloading aggregation rules failed"); - logger.error(e); - } - - logger.info("Invalidating index cache"); - indexService.invalidateCache(); - } - } - - private class SigtermSignalHandler implements SignalHandler { - - @Override - public void handle(Signal signal) { - logger.info("Shutting down carbon server"); - carbonServer.shutdown(); - - // We will probably loose some last stats here. But leaving it to run will complicate things - logger.info("Shutting down stats service"); - statsService.shutdown(); - - logger.info("Shutting down base rollup aggregator"); - aggregateService.shutdown(); - - logger.info("Shutting down sum aggregator"); - sumService.shutdown(); - - logger.info("Shutting down rollup aggregator"); - rollupService.shutdown(); - - // Now let's wait for this all to propagate and shutdown the bus - logger.info("Shutting down dispatcher"); - bus.shutdown(); - - // Now flush what's left and shutdown - logger.info("Shutting down ES service"); - indexService.shutdown(); - - logger.info("Shutting down C* service"); - cassandraService.shutdown(); - - logger.info("Shutdown complete"); - - System.exit(0); - } - } -} +package net.iponweb.disthene; + +import com.datastax.driver.core.policies.LatencyAwarePolicy; +import net.engio.mbassy.bus.MBassador; +import net.engio.mbassy.bus.common.Properties; +import net.engio.mbassy.bus.config.BusConfiguration; +import net.engio.mbassy.bus.config.Feature; +import net.engio.mbassy.bus.error.IPublicationErrorHandler; +import net.engio.mbassy.bus.error.PublicationError; +import net.iponweb.disthene.carbon.CarbonServer; +import net.iponweb.disthene.config.AggregationConfiguration; +import net.iponweb.disthene.config.BlackListConfiguration; +import net.iponweb.disthene.config.DistheneConfiguration; +import net.iponweb.disthene.events.DistheneEvent; +import net.iponweb.disthene.service.aggregate.AggregateService; +import net.iponweb.disthene.service.aggregate.RollupService; +import net.iponweb.disthene.service.aggregate.SumService; +import net.iponweb.disthene.service.blacklist.BlacklistService; +import net.iponweb.disthene.service.index.IndexService; +import net.iponweb.disthene.service.metric.MetricService; +import net.iponweb.disthene.service.stats.StatsService; +import net.iponweb.disthene.service.store.CassandraService; +import org.apache.commons.cli.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.yaml.snakeyaml.Yaml; +import sun.misc.Signal; +import sun.misc.SignalHandler; + +import javax.management.MBeanServer; +import javax.management.ObjectName; +import java.io.IOException; +import java.io.InputStream; +import java.lang.management.ManagementFactory; +import java.net.MalformedURLException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.Map; + +/** + * @author Andrei Ivanov + */ +public class Disthene { + private static Logger logger; + + public static Feature.AsynchronousMessageDispatch dispatch; + + private static final String DEFAULT_CONFIG_LOCATION = "/etc/disthene/disthene.yaml"; + private static final String DEFAULT_BLACKLIST_LOCATION = "/etc/disthene/blacklist.yaml"; + private static final String DEFAULT_AGGREGATION_CONFIG_LOCATION = "/etc/disthene/aggregator.yaml"; + private static final String DEFAULT_LOG_CONFIG_LOCATION = "/etc/disthene/disthene-log4j.xml"; + + private String configLocation; + private String blacklistLocation; + private String aggregationConfigLocation; + + private MBassador bus; + private BlacklistService blacklistService; + private MetricService metricService; + private AggregateService aggregateService; + private StatsService statsService; + private IndexService indexService; + private CassandraService cassandraService; + private SumService sumService; + private RollupService rollupService; + private CarbonServer carbonServer; + + public Disthene(String configLocation, String blacklistLocation, String aggregationConfigLocation) { + this.configLocation = configLocation; + this.blacklistLocation = blacklistLocation; + this.aggregationConfigLocation = aggregationConfigLocation; + } + + private void run() { + try { + Yaml yaml = new Yaml(); + InputStream in = Files.newInputStream(Paths.get(configLocation)); + DistheneConfiguration distheneConfiguration = yaml.loadAs(in, DistheneConfiguration.class); + in.close(); + logger.info("Running with the following config: " + distheneConfiguration.toString()); + + dispatch = Feature.AsynchronousMessageDispatch.Default(); + logger.info("Creating dispatcher"); + bus = new MBassador<>(new BusConfiguration() + .addFeature(Feature.SyncPubSub.Default()) + .addFeature(Feature.AsynchronousHandlerInvocation.Default()) + .addFeature(dispatch) + .setProperty(Properties.Handler.PublicationError, new IPublicationErrorHandler() { + @Override + public void handleError(PublicationError error) { + logger.error(error); + } + }) + ); + + logger.info("Loading blacklists"); + in = Files.newInputStream(Paths.get(blacklistLocation)); + BlackListConfiguration blackListConfiguration = new BlackListConfiguration((Map>) yaml.load(in)); + in.close(); + logger.debug("Running with the following blacklist: " + blackListConfiguration.toString()); + blacklistService = new BlacklistService(blackListConfiguration); + + logger.info("Creating metric service"); + metricService = new MetricService(bus, blacklistService, distheneConfiguration); + + logger.info("Creating base rollup aggregator"); + aggregateService = new AggregateService(bus, distheneConfiguration); + + logger.info("Creating stats"); + statsService = new StatsService(bus, distheneConfiguration.getStats(), distheneConfiguration.getCarbon().getBaseRollup()); + + try { + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + ObjectName name = new ObjectName("net.iponweb.disthene.service:type=Stats"); + mbs.registerMBean(statsService, name); + } catch (Exception e) { + logger.error("Failed to create MBean: " + e); + } + + logger.info("Creating ES index service"); + indexService = new IndexService(distheneConfiguration.getIndex(), bus); + + logger.info("Creating C* service"); + cassandraService = new CassandraService(distheneConfiguration.getStore(), bus); + + logger.info("Loading aggregation rules"); + in = Files.newInputStream(Paths.get(aggregationConfigLocation)); + AggregationConfiguration aggregationConfiguration = new AggregationConfiguration((Map>) yaml.load(in)); + in.close(); + logger.debug("Running with the following aggregation rule set: " + aggregationConfiguration.toString()); + logger.info("Creating sum aggregator"); + sumService = new SumService(bus, distheneConfiguration, aggregationConfiguration, blacklistService); + + logger.info("Creating rollup aggregator"); + rollupService = new RollupService(bus, distheneConfiguration, distheneConfiguration.getCarbon().getRollups()); + + logger.info("Starting carbon"); + carbonServer = new CarbonServer(distheneConfiguration, bus); + carbonServer.run(); + + // adding signal handlers + Signal.handle(new Signal("HUP"), new SighupSignalHandler()); + + Signal.handle(new Signal("TERM"), new SigtermSignalHandler()); + } catch (IOException e) { + logger.error(e); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws MalformedURLException { + Options options = new Options(); + options.addOption("c", "config", true, "config location"); + options.addOption("l", "log-config", true, "log config location"); + options.addOption("b", "blacklist", true, "blacklist location"); + options.addOption("a", "agg-config", true, "aggregation config location"); + + CommandLineParser parser = new GnuParser(); + + try { + CommandLine commandLine = parser.parse(options, args); + System.getProperties().setProperty("log4j.configuration", "file:" + commandLine.getOptionValue("l", DEFAULT_LOG_CONFIG_LOCATION)); + logger = Logger.getLogger(Disthene.class); + + new Disthene(commandLine.getOptionValue("c", DEFAULT_CONFIG_LOCATION), + commandLine.getOptionValue("b", DEFAULT_BLACKLIST_LOCATION), + commandLine.getOptionValue("a", DEFAULT_AGGREGATION_CONFIG_LOCATION) + ).run(); + + } catch (ParseException e) { + HelpFormatter formatter = new HelpFormatter(); + formatter.printHelp("Disthene", options); + } catch (Exception e) { + System.out.println("Start failed"); + e.printStackTrace(); + } + + } + + private class SighupSignalHandler implements SignalHandler { + + @Override + public void handle(Signal signal) { + logger.info("Received sighup"); + + logger.info("Reloading blacklists"); + try { + Yaml yaml = new Yaml(); + InputStream in = Files.newInputStream(Paths.get(blacklistLocation)); + BlackListConfiguration blackListConfiguration = new BlackListConfiguration((Map>) yaml.load(in)); + in.close(); + + blacklistService.setRules(blackListConfiguration); + + logger.debug("Reloaded blacklist: " + blackListConfiguration.toString()); + } catch (Exception e) { + logger.error("Reloading blacklists failed"); + logger.error(e); + } + + logger.info("Reloading aggregation rules"); + try { + Yaml yaml = new Yaml(); + InputStream in = Files.newInputStream(Paths.get(aggregationConfigLocation)); + AggregationConfiguration aggregationConfiguration = new AggregationConfiguration((Map>) yaml.load(in)); + in.close(); + + sumService.setAggregationConfiguration(aggregationConfiguration); + logger.debug("Reloaded aggregation rules: " + aggregationConfiguration.toString()); + } catch (Exception e) { + logger.error("Reloading aggregation rules failed"); + logger.error(e); + } + + logger.info("Invalidating index cache"); + indexService.invalidateCache(); + } + } + + private class SigtermSignalHandler implements SignalHandler { + + @Override + public void handle(Signal signal) { + logger.info("Shutting down carbon server"); + carbonServer.shutdown(); + + // We will probably loose some last stats here. But leaving it to run will complicate things + logger.info("Shutting down stats service"); + statsService.shutdown(); + + logger.info("Shutting down base rollup aggregator"); + aggregateService.shutdown(); + + logger.info("Shutting down sum aggregator"); + sumService.shutdown(); + + logger.info("Shutting down rollup aggregator"); + rollupService.shutdown(); + + // Now let's wait for this all to propagate and shutdown the bus + logger.info("Shutting down dispatcher"); + bus.shutdown(); + + // Now flush what's left and shutdown + logger.info("Shutting down ES service"); + indexService.shutdown(); + + logger.info("Shutting down C* service"); + cassandraService.shutdown(); + + logger.info("Shutdown complete"); + + System.exit(0); + } + } +} diff --git a/src/main/java/net/iponweb/disthene/carbon/CarbonServer.java b/src/main/java/net/iponweb/disthene/carbon/CarbonServer.java index d9dfdda..524f0c4 100644 --- a/src/main/java/net/iponweb/disthene/carbon/CarbonServer.java +++ b/src/main/java/net/iponweb/disthene/carbon/CarbonServer.java @@ -10,7 +10,8 @@ import net.engio.mbassy.bus.MBassador; import net.iponweb.disthene.config.DistheneConfiguration; import net.iponweb.disthene.events.DistheneEvent; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; /** * @author Andrei Ivanov diff --git a/src/main/java/net/iponweb/disthene/carbon/CarbonServerHandler.java b/src/main/java/net/iponweb/disthene/carbon/CarbonServerHandler.java index d2eed35..30b9eca 100644 --- a/src/main/java/net/iponweb/disthene/carbon/CarbonServerHandler.java +++ b/src/main/java/net/iponweb/disthene/carbon/CarbonServerHandler.java @@ -10,7 +10,8 @@ import net.iponweb.disthene.config.Rollup; import net.iponweb.disthene.events.DistheneEvent; import net.iponweb.disthene.events.MetricReceivedEvent; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; /** * @author Andrei Ivanov diff --git a/src/main/java/net/iponweb/disthene/service/aggregate/AggregateService.java b/src/main/java/net/iponweb/disthene/service/aggregate/AggregateService.java index dd2d39d..119df1c 100644 --- a/src/main/java/net/iponweb/disthene/service/aggregate/AggregateService.java +++ b/src/main/java/net/iponweb/disthene/service/aggregate/AggregateService.java @@ -14,7 +14,8 @@ import net.iponweb.disthene.events.MetricAggregateEvent; import net.iponweb.disthene.events.MetricStoreEvent; import net.iponweb.disthene.util.NamedThreadFactory; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/src/main/java/net/iponweb/disthene/service/aggregate/RollupService.java b/src/main/java/net/iponweb/disthene/service/aggregate/RollupService.java index 7cd7525..0707cc2 100644 --- a/src/main/java/net/iponweb/disthene/service/aggregate/RollupService.java +++ b/src/main/java/net/iponweb/disthene/service/aggregate/RollupService.java @@ -13,7 +13,8 @@ import net.iponweb.disthene.events.DistheneEvent; import net.iponweb.disthene.events.MetricStoreEvent; import net.iponweb.disthene.util.NamedThreadFactory; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/src/main/java/net/iponweb/disthene/service/aggregate/SumService.java b/src/main/java/net/iponweb/disthene/service/aggregate/SumService.java index 66110b1..ed120f9 100644 --- a/src/main/java/net/iponweb/disthene/service/aggregate/SumService.java +++ b/src/main/java/net/iponweb/disthene/service/aggregate/SumService.java @@ -17,7 +17,8 @@ import net.iponweb.disthene.events.MetricReceivedEvent; import net.iponweb.disthene.events.MetricStoreEvent; import net.iponweb.disthene.util.NamedThreadFactory; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/src/main/java/net/iponweb/disthene/service/index/IndexService.java b/src/main/java/net/iponweb/disthene/service/index/IndexService.java index 4af3525..fdc5086 100644 --- a/src/main/java/net/iponweb/disthene/service/index/IndexService.java +++ b/src/main/java/net/iponweb/disthene/service/index/IndexService.java @@ -9,7 +9,8 @@ import net.iponweb.disthene.events.DistheneEvent; import net.iponweb.disthene.events.MetricStoreEvent; import net.iponweb.disthene.util.NamedThreadFactory; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.opensearch.client.opensearch.OpenSearchClient; import org.opensearch.client.transport.aws.AwsSdk2Transport; import org.opensearch.client.transport.aws.AwsSdk2TransportOptions; diff --git a/src/main/java/net/iponweb/disthene/service/index/IndexThread.java b/src/main/java/net/iponweb/disthene/service/index/IndexThread.java index 341c3d6..40c0062 100644 --- a/src/main/java/net/iponweb/disthene/service/index/IndexThread.java +++ b/src/main/java/net/iponweb/disthene/service/index/IndexThread.java @@ -2,7 +2,8 @@ import net.iponweb.disthene.bean.Metric; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.opensearch.client.opensearch.OpenSearchClient; import org.opensearch.client.opensearch._types.Refresh; import org.opensearch.client.opensearch.core.BulkRequest; diff --git a/src/main/java/net/iponweb/disthene/service/stats/StatsService.java b/src/main/java/net/iponweb/disthene/service/stats/StatsService.java index 332cbc7..26b5f5c 100644 --- a/src/main/java/net/iponweb/disthene/service/stats/StatsService.java +++ b/src/main/java/net/iponweb/disthene/service/stats/StatsService.java @@ -9,7 +9,8 @@ import net.iponweb.disthene.config.StatsConfiguration; import net.iponweb.disthene.events.*; import net.iponweb.disthene.util.NamedThreadFactory; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/src/main/java/net/iponweb/disthene/service/store/BatchWriterThread.java b/src/main/java/net/iponweb/disthene/service/store/BatchWriterThread.java index 33d291a..844e789 100644 --- a/src/main/java/net/iponweb/disthene/service/store/BatchWriterThread.java +++ b/src/main/java/net/iponweb/disthene/service/store/BatchWriterThread.java @@ -8,7 +8,8 @@ import net.iponweb.disthene.events.DistheneEvent; import net.iponweb.disthene.events.StoreErrorEvent; import net.iponweb.disthene.events.StoreSuccessEvent; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.util.*; import java.util.concurrent.Executor; diff --git a/src/main/java/net/iponweb/disthene/service/store/CassandraService.java b/src/main/java/net/iponweb/disthene/service/store/CassandraService.java index e3c1b5f..6405d43 100644 --- a/src/main/java/net/iponweb/disthene/service/store/CassandraService.java +++ b/src/main/java/net/iponweb/disthene/service/store/CassandraService.java @@ -11,7 +11,8 @@ import net.iponweb.disthene.events.DistheneEvent; import net.iponweb.disthene.events.MetricStoreEvent; import net.iponweb.disthene.util.CassandraLoadBalancingPolicies; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.util.ArrayList; import java.util.Collection; diff --git a/src/main/java/net/iponweb/disthene/service/store/SingleWriterThread.java b/src/main/java/net/iponweb/disthene/service/store/SingleWriterThread.java index d90ca29..5f5c077 100644 --- a/src/main/java/net/iponweb/disthene/service/store/SingleWriterThread.java +++ b/src/main/java/net/iponweb/disthene/service/store/SingleWriterThread.java @@ -11,7 +11,8 @@ import net.iponweb.disthene.events.DistheneEvent; import net.iponweb.disthene.events.StoreErrorEvent; import net.iponweb.disthene.events.StoreSuccessEvent; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.util.Collections; import java.util.Queue;