From 2e081b6ff3e5f89f0bbe49cec9c93bbda15bdccc Mon Sep 17 00:00:00 2001 From: emeroad Date: Mon, 20 Mar 2023 11:13:24 +0900 Subject: [PATCH] [#9765] Cleanup --- .../metric/collector/MetricCollectorApp.java | 4 ++-- .../collector/config/MetricKafkaConfiguration.java | 12 ++++++------ .../pinpoint/pinot/kafka/KafkaConfiguration.java | 6 +++--- .../config/UriMetricKafkaConfiguration.java | 4 ++-- .../web/config/UriStatPinotDaoConfiguration.java | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/MetricCollectorApp.java b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/MetricCollectorApp.java index 0dbfad09834a..ca058ec4dc40 100644 --- a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/MetricCollectorApp.java +++ b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/MetricCollectorApp.java @@ -36,8 +36,8 @@ @Profile("metric") public class MetricCollectorApp { - @Bean("objectMapper") - public ObjectMapper getObjectMapper() { + @Bean + public ObjectMapper objectMapper() { return new ObjectMapper(); } diff --git a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/config/MetricKafkaConfiguration.java b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/config/MetricKafkaConfiguration.java index 684d5b6425d8..8c92a03ff3a9 100644 --- a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/config/MetricKafkaConfiguration.java +++ b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/collector/config/MetricKafkaConfiguration.java @@ -18,18 +18,18 @@ @Import({KafkaConfiguration.class}) public class MetricKafkaConfiguration { - @Bean("kafkaDoubleTemplate") - public KafkaTemplate getSystemMetricKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { + @Bean + public KafkaTemplate kafkaDoubleTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { return new KafkaTemplate<>(producerFactory); } - @Bean("kafkaTagTemplate") - public KafkaTemplate getTagKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { + @Bean + public KafkaTemplate kafkaTagTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { return new KafkaTemplate<>(producerFactory); } - @Bean("kafkaDataTypeTemplate") - public KafkaTemplate getDataTypeKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { + @Bean + public KafkaTemplate kafkaDataTypeTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { return new KafkaTemplate<>(producerFactory); } } diff --git a/pinot/pinot-kafka/src/main/java/com/navercorp/pinpoint/pinot/kafka/KafkaConfiguration.java b/pinot/pinot-kafka/src/main/java/com/navercorp/pinpoint/pinot/kafka/KafkaConfiguration.java index bc9b41c21f26..8357801696f6 100644 --- a/pinot/pinot-kafka/src/main/java/com/navercorp/pinpoint/pinot/kafka/KafkaConfiguration.java +++ b/pinot/pinot-kafka/src/main/java/com/navercorp/pinpoint/pinot/kafka/KafkaConfiguration.java @@ -34,8 +34,8 @@ public Map toConfig(KafkaProperties properties) { return config; } - @Bean("kafkaProducerFactory") - public ProducerFactory getKafkaProducerFactory(KafkaProperties properties) { + @Bean + public ProducerFactory kafkaProducerFactory(KafkaProperties properties) { logger.info("kafka {}:{}", ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, properties.getBootstrapServers()); logger.debug("kafka config:{}", properties); @@ -44,7 +44,7 @@ public ProducerFactory getKafkaProducerFactory(KafkaProperties properties) { } @Bean - public KafkaProperties getKafkaProperties(Environment env) { + public KafkaProperties kafkaProperties(Environment env) { KafkaProperties properties = new KafkaProperties(); bindProperties(env, "pinpoint.metric.kafka.bootstrap.servers", properties::setBootstrapServers); diff --git a/uristat/uristat-collector/src/main/java/com/navercorp/pinpoint/uristat/collector/config/UriMetricKafkaConfiguration.java b/uristat/uristat-collector/src/main/java/com/navercorp/pinpoint/uristat/collector/config/UriMetricKafkaConfiguration.java index f88077e26748..db2d0bb7b56f 100644 --- a/uristat/uristat-collector/src/main/java/com/navercorp/pinpoint/uristat/collector/config/UriMetricKafkaConfiguration.java +++ b/uristat/uristat-collector/src/main/java/com/navercorp/pinpoint/uristat/collector/config/UriMetricKafkaConfiguration.java @@ -16,8 +16,8 @@ @Import({KafkaConfiguration.class}) public class UriMetricKafkaConfiguration { - @Bean("kafkaUriStatTemplate") - public KafkaTemplate getKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { + @Bean + public KafkaTemplate kafkaUriStatTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) { return new KafkaTemplate<>(producerFactory); } } diff --git a/uristat/uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/config/UriStatPinotDaoConfiguration.java b/uristat/uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/config/UriStatPinotDaoConfiguration.java index f1371b536977..47b0565433e0 100644 --- a/uristat/uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/config/UriStatPinotDaoConfiguration.java +++ b/uristat/uristat-web/src/main/java/com/navercorp/pinpoint/uristat/web/config/UriStatPinotDaoConfiguration.java @@ -4,6 +4,7 @@ import com.navercorp.pinpoint.uristat.web.model.UriStatHistogram; import com.navercorp.pinpoint.uristat.web.model.UriStatSummary; import com.navercorp.pinpoint.uristat.web.util.UriStatQueryParameter; +import org.apache.ibatis.session.Configuration; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.transaction.managed.ManagedTransactionFactory; import org.apache.ibatis.type.TypeAliasRegistry; @@ -12,7 +13,6 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; import javax.sql.DataSource; @@ -20,7 +20,7 @@ /** * @author Woonduk Kang(emeroad) */ -@Configuration +@org.springframework.context.annotation.Configuration public class UriStatPinotDaoConfiguration { @Bean @@ -41,8 +41,8 @@ public SqlSessionFactory uriStatPinotSessionFactory( return sessionFactoryBean.getObject(); } - private org.apache.ibatis.session.Configuration newConfiguration() { - org.apache.ibatis.session.Configuration config = MyBatisConfiguration.defaultConfiguration(); + private Configuration newConfiguration() { + Configuration config = MyBatisConfiguration.defaultConfiguration(); TypeAliasRegistry typeAliasRegistry = config.getTypeAliasRegistry(); typeAliasRegistry.registerAlias("UriStatHistogram", UriStatHistogram.class);