Skip to content

Commit

Permalink
[#nossiue] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Aug 12, 2024
1 parent 88112ea commit 5b43747
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.navercorp.pinpoint.collector.config.SchedulerConfiguration;
import com.navercorp.pinpoint.collector.dao.hbase.encode.ApplicationIndexRowKeyEncoderV1;
import com.navercorp.pinpoint.collector.dao.hbase.encode.ApplicationIndexRowKeyEncoderV2;
import com.navercorp.pinpoint.collector.util.DurabilityApplier;
import com.navercorp.pinpoint.common.hbase.config.DistributorConfiguration;
import com.navercorp.pinpoint.common.hbase.config.HbaseNamespaceConfiguration;
import com.navercorp.pinpoint.common.hbase.config.HbaseTemplateConfiguration;
Expand All @@ -13,7 +14,10 @@
import com.navercorp.pinpoint.common.server.bo.serializer.RowKeyEncoder;
import com.navercorp.pinpoint.common.server.hbase.config.HbaseClientConfiguration;
import com.sematext.hbase.wd.AbstractRowKeyDistributor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
Expand Down Expand Up @@ -42,6 +46,7 @@
"classpath:profiles/${pinpoint.profiles.active:local}/hbase.properties"
})
public class CollectorHbaseModule {
private final Logger logger = LogManager.getLogger(CollectorHbaseModule.class);

@Bean("applicationIndexRowKeyEncoder")
@ConditionalOnProperty(name = "collector.scatter.serverside-scan", havingValue = "v1")
Expand All @@ -57,4 +62,10 @@ public RowKeyEncoder<SpanBo> applicationIndexRowKeyEncoderV2(@Qualifier("applica
return new ApplicationIndexRowKeyEncoderV2(rowKeyDistributor);
}

@Bean
public DurabilityApplier spanPutWriterDurabilityApplier(@Value("${collector.span.durability:USE_DEFAULT}") String spanDurability) {
logger.info("Span(Trace Put) durability:{}", spanDurability);
return new DurabilityApplier(spanDurability);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;

import java.util.List;
Expand Down Expand Up @@ -72,16 +71,14 @@ public HbaseTraceDaoV2(@Qualifier("spanPutWriter")
@Qualifier("traceRowKeyEncoderV2") RowKeyEncoder<TransactionId> rowKeyEncoder,
SpanSerializerV2 spanSerializer,
SpanChunkSerializerV2 spanChunkSerializer,
@Value("${collector.span.durability:USE_DEFAULT}")
String spanDurability) {
DurabilityApplier durabilityApplier) {
this.putWriter = Objects.requireNonNull(putWriter, "putWriter");
this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider");
this.rowKeyEncoder = Objects.requireNonNull(rowKeyEncoder, "rowKeyEncoder");
this.spanSerializer = Objects.requireNonNull(spanSerializer, "spanSerializer");
this.spanChunkSerializer = Objects.requireNonNull(spanChunkSerializer, "spanChunkSerializer");

this.durabilityApplier = new DurabilityApplier(spanDurability);
logger.info("Span(Trace Put) durability:{}", durabilityApplier);
this.durabilityApplier = Objects.requireNonNull(durabilityApplier, "durabilityApplier");
}

@Override
Expand Down

0 comments on commit 5b43747

Please sign in to comment.