Skip to content

Commit

Permalink
[pinpoint-apm#11379] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Aug 22, 2024
1 parent c8e4596 commit 4d8fc3d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 386 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,19 @@
package com.navercorp.pinpoint.collector.config;

import com.navercorp.pinpoint.collector.manage.HBaseManager;
import com.navercorp.pinpoint.common.hbase.async.HBaseTableMultiplexerFactory;
import com.navercorp.pinpoint.common.hbase.async.HbasePutWriter;
import com.navercorp.pinpoint.common.hbase.async.LoggingHbasePutWriter;
import com.navercorp.pinpoint.common.hbase.config.HbaseMultiplexerProperties;
import com.navercorp.pinpoint.common.hbase.counter.HBaseBatchPerformance;
import com.navercorp.pinpoint.common.hbase.counter.HbaseBatchPerformanceCounter;
import com.navercorp.pinpoint.common.server.config.CommonCacheManagerConfiguration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;

@Configuration
@Import({
CommonCacheManagerConfiguration.class,
HbaseAsyncConfiguration.TableMultiplexerConfig.class
})
public class HbaseAsyncConfiguration {

Expand All @@ -49,45 +41,6 @@ public HbaseBatchPerformanceCounter batchPerformanceCounter() {
return new HbaseBatchPerformanceCounter();
}

@Configuration
@ConditionalOnProperty(name = "hbase.client.put-writer", havingValue = "tableMultiplexer")
public static class TableMultiplexerConfig {
private final Logger logger = LogManager.getLogger(TableMultiplexerConfig.class);

@Bean
public HbaseMultiplexerProperties hbaseMultiplexerProperties() {
return new HbaseMultiplexerProperties();
}

@Primary
@Bean
public HbasePutWriter hbasePutWriter(@Qualifier("batchConnectionFactory") Connection connection,
HbaseBatchPerformanceCounter counter,
HbaseMultiplexerProperties properties) throws Exception {
HbasePutWriter writer = newPutWriter(connection, counter, properties);
logger.info("HbaseSpanPutWriter:{}", writer);
return writer;
}

@Bean
public HbasePutWriter spanPutWriter(@Qualifier("batchConnectionFactory") Connection connection,
HbaseBatchPerformanceCounter counter,
HbaseMultiplexerProperties properties) throws Exception {
HbasePutWriter writer = newPutWriter(connection, counter, properties);
logger.info("HbaseSpanPutWriter:{}", writer);
return writer;
}

private HbasePutWriter newPutWriter(Connection connection, HbaseBatchPerformanceCounter counter,
HbaseMultiplexerProperties properties) throws Exception {
HBaseTableMultiplexerFactory factory = new HBaseTableMultiplexerFactory(connection, counter);
factory.setHbaseMultiplexerProperties(properties);
HbasePutWriter writer = factory.getObject();
return new LoggingHbasePutWriter(writer);
}

}

@Bean
public HBaseManager hBaseManager(@Qualifier("batchPerformanceCounter") HBaseBatchPerformance hBaseAsyncOperation) {
return new HBaseManager(hBaseAsyncOperation);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4d8fc3d

Please sign in to comment.