Skip to content

Commit

Permalink
[#9765] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Mar 20, 2023
1 parent e8367a9 commit 2e081b6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
@Profile("metric")
public class MetricCollectorApp {

@Bean("objectMapper")
public ObjectMapper getObjectMapper() {
@Bean
public ObjectMapper objectMapper() {
return new ObjectMapper();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
@Import({KafkaConfiguration.class})
public class MetricKafkaConfiguration {

@Bean("kafkaDoubleTemplate")
public KafkaTemplate<String, SystemMetricView> getSystemMetricKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
@Bean
public KafkaTemplate<String, SystemMetricView> kafkaDoubleTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
return new KafkaTemplate<>(producerFactory);
}

@Bean("kafkaTagTemplate")
public KafkaTemplate<String, PinotMetricTagDao.MetricJsonTag> getTagKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
@Bean
public KafkaTemplate<String, PinotMetricTagDao.MetricJsonTag> kafkaTagTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
return new KafkaTemplate<>(producerFactory);
}

@Bean("kafkaDataTypeTemplate")
public KafkaTemplate<String, MetricData> getDataTypeKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
@Bean
public KafkaTemplate<String, MetricData> kafkaDataTypeTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
return new KafkaTemplate<>(producerFactory);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public Map<String, Object> 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);

Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
@Import({KafkaConfiguration.class})
public class UriMetricKafkaConfiguration {

@Bean("kafkaUriStatTemplate")
public KafkaTemplate<String, UriStat> getKafkaTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
@Bean
public KafkaTemplate<String, UriStat> kafkaUriStatTemplate(@Qualifier("kafkaProducerFactory") ProducerFactory producerFactory) {
return new KafkaTemplate<>(producerFactory);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -12,15 +13,14 @@
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;

/**
* @author Woonduk Kang(emeroad)
*/
@Configuration
@org.springframework.context.annotation.Configuration
public class UriStatPinotDaoConfiguration {

@Bean
Expand All @@ -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);
Expand Down

0 comments on commit 2e081b6

Please sign in to comment.