Skip to content

Commit

Permalink
fix: pmd (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
masaimu authored Jan 30, 2024
1 parent 861cf22 commit f9c579f
Show file tree
Hide file tree
Showing 204 changed files with 288 additions and 1,017 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@

import java.util.List;

import javax.annotation.Nonnull;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import lombok.Data;

import com.alibaba.fastjson.annotation.JSONCreator;
import com.alibaba.fastjson.annotation.JSONField;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down Expand Up @@ -1889,7 +1886,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue result =
new io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue(this);
int from_bitField0_ = bitField0_;
result.type_ = type_;
result.timestamp_ = timestamp_;
if (inDataNodesBuilder_ == null) {
Expand Down Expand Up @@ -2568,7 +2564,7 @@ private com.google.protobuf.MapField<java.lang.String, java.lang.String> interna
}

private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableExtension() {
onChanged();;
onChanged();
if (extension_ == null) {
extension_ =
com.google.protobuf.MapField.newMapField(ExtensionDefaultEntryHolder.defaultEntry);
Expand Down Expand Up @@ -3522,10 +3518,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down Expand Up @@ -3560,7 +3553,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header result =
new io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) != 0)) {
tagKeys_ = tagKeys_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
Expand Down Expand Up @@ -4513,7 +4505,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row result =
new io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row(this);
int from_bitField0_ = bitField0_;
result.timestamp_ = timestamp_;
if (((bitField0_ & 0x00000001) != 0)) {
tagValues_ = tagValues_.getUnmodifiableView();
Expand Down Expand Up @@ -5525,7 +5516,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.Table build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.Table buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.Table result =
new io.holoinsight.server.agg.v1.pb.AggProtos.Table(this);
int from_bitField0_ = bitField0_;
result.name_ = name_;
result.timestamp_ = timestamp_;
if (headerBuilder_ == null) {
Expand Down Expand Up @@ -7050,10 +7040,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down Expand Up @@ -7096,7 +7083,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode result =
new io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode(this);
int from_bitField0_ = bitField0_;
result.type_ = type_;
result.timestamp_ = timestamp_;
result.tags_ = internalGetTags();
Expand Down Expand Up @@ -7314,7 +7300,7 @@ private com.google.protobuf.MapField<java.lang.String, java.lang.String> interna
}

private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableTags() {
onChanged();;
onChanged();
if (tags_ == null) {
tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry);
}
Expand Down Expand Up @@ -7612,7 +7598,7 @@ private com.google.protobuf.MapField<java.lang.String, io.holoinsight.server.agg
}

private com.google.protobuf.MapField<java.lang.String, io.holoinsight.server.agg.v1.pb.AggProtos.BasicField> internalGetMutableFields() {
onChanged();;
onChanged();
if (fields_ == null) {
fields_ = com.google.protobuf.MapField.newMapField(FieldsDefaultEntryHolder.defaultEntry);
}
Expand Down Expand Up @@ -8223,10 +8209,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import io.holoinsight.server.common.threadpool.CommonThreadPools;
import io.holoinsight.server.extension.model.Row;
import io.holoinsight.server.extension.model.Table;
import io.holoinsight.server.gateway.core.grpc.GatewayHook;
import io.holoinsight.server.gateway.core.utils.StatUtils;
import io.holoinsight.server.gateway.grpc.DataNode;
import io.holoinsight.server.gateway.grpc.Point;
Expand Down Expand Up @@ -218,42 +217,38 @@ public void dispatch(AuthInfo authInfo, WriteMetricsRequestV1 request) {
}

public void dispatchUpEvent(AuthInfo authInfo, ReportEventRequest request) {
if (true) {
return;
}

for (ReportEventRequest.Event e : request.getEventsList()) {
if (e.getEventType().equals("STAT") && e.getPayloadType().equals("log_monitor_up")) {
String key = e.getTagsOrDefault("t_key", null);
if (key == null) {
continue;
}
String[] ss = key.split("/");
if (ss.length != 2) {
continue;
}
String refCollectKey = ss[0];
String refTargetKey = ss[1];

List<AggTask> aggTasks = storage.getByTableName(refCollectKey);
if (aggTasks.isEmpty()) {
continue;
}

AggProtos.AggTaskValue aggTaskValue = AggProtos.AggTaskValue.newBuilder() //
.setType(2) //
.setTimestamp(e.getEventTimestamp()) //
.putExtension("refCollectKey", refCollectKey) //
.putExtension("refTargetKey", refTargetKey) //
.build();

for (AggTask aggTask : aggTasks) {
// TODO partition ???
AggTaskKey aggTaskKey = new AggTaskKey(authInfo.getTenant(), aggTask.getAggId(), "");
send(aggTaskKey, aggTaskValue);
}
}
}
// for (ReportEventRequest.Event e : request.getEventsList()) {
// if (e.getEventType().equals("STAT") && e.getPayloadType().equals("log_monitor_up")) {
// String key = e.getTagsOrDefault("t_key", null);
// if (key == null) {
// continue;
// }
// String[] ss = key.split("/");
// if (ss.length != 2) {
// continue;
// }
// String refCollectKey = ss[0];
// String refTargetKey = ss[1];
//
// List<AggTask> aggTasks = storage.getByTableName(refCollectKey);
// if (aggTasks.isEmpty()) {
// continue;
// }
//
// AggProtos.AggTaskValue aggTaskValue = AggProtos.AggTaskValue.newBuilder() //
// .setType(2) //
// .setTimestamp(e.getEventTimestamp()) //
// .putExtension("refCollectKey", refCollectKey) //
// .putExtension("refTargetKey", refTargetKey) //
// .build();
//
// for (AggTask aggTask : aggTasks) {
// // TODO partition ???
// AggTaskKey aggTaskKey = new AggTaskKey(authInfo.getTenant(), aggTask.getAggId(), "");
// send(aggTaskKey, aggTaskValue);
// }
// }
// }
}

public void dispatchDetailData(AuthInfo authInfo, Table table) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import io.holoinsight.server.extension.model.Header;
import io.holoinsight.server.extension.model.Row;
import io.holoinsight.server.extension.model.Table;
import io.holoinsight.server.gateway.core.grpc.GatewayHook;
import lombok.extern.slf4j.Slf4j;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down Expand Up @@ -1889,7 +1886,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue result =
new io.holoinsight.server.agg.v1.pb.AggProtos.AggTaskValue(this);
int from_bitField0_ = bitField0_;
result.type_ = type_;
result.timestamp_ = timestamp_;
if (inDataNodesBuilder_ == null) {
Expand Down Expand Up @@ -2568,7 +2564,7 @@ private com.google.protobuf.MapField<java.lang.String, java.lang.String> interna
}

private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableExtension() {
onChanged();;
onChanged();
if (extension_ == null) {
extension_ =
com.google.protobuf.MapField.newMapField(ExtensionDefaultEntryHolder.defaultEntry);
Expand Down Expand Up @@ -3522,10 +3518,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down Expand Up @@ -3560,7 +3553,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header result =
new io.holoinsight.server.agg.v1.pb.AggProtos.Table.Header(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) != 0)) {
tagKeys_ = tagKeys_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
Expand Down Expand Up @@ -4513,7 +4505,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row result =
new io.holoinsight.server.agg.v1.pb.AggProtos.Table.Row(this);
int from_bitField0_ = bitField0_;
result.timestamp_ = timestamp_;
if (((bitField0_ & 0x00000001) != 0)) {
tagValues_ = tagValues_.getUnmodifiableView();
Expand Down Expand Up @@ -5525,7 +5516,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.Table build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.Table buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.Table result =
new io.holoinsight.server.agg.v1.pb.AggProtos.Table(this);
int from_bitField0_ = bitField0_;
result.name_ = name_;
result.timestamp_ = timestamp_;
if (headerBuilder_ == null) {
Expand Down Expand Up @@ -7050,10 +7040,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down Expand Up @@ -7096,7 +7083,6 @@ public io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode build() {
public io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode buildPartial() {
io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode result =
new io.holoinsight.server.agg.v1.pb.AggProtos.InDataNode(this);
int from_bitField0_ = bitField0_;
result.type_ = type_;
result.timestamp_ = timestamp_;
result.tags_ = internalGetTags();
Expand Down Expand Up @@ -7314,7 +7300,7 @@ private com.google.protobuf.MapField<java.lang.String, java.lang.String> interna
}

private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableTags() {
onChanged();;
onChanged();
if (tags_ == null) {
tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry);
}
Expand Down Expand Up @@ -7612,7 +7598,7 @@ private com.google.protobuf.MapField<java.lang.String, io.holoinsight.server.agg
}

private com.google.protobuf.MapField<java.lang.String, io.holoinsight.server.agg.v1.pb.AggProtos.BasicField> internalGetMutableFields() {
onChanged();;
onChanged();
if (fields_ == null) {
fields_ = com.google.protobuf.MapField.newMapField(FieldsDefaultEntryHolder.defaultEntry);
}
Expand Down Expand Up @@ -8223,10 +8209,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;

import io.holoinsight.server.agg.v1.core.Utils;
import io.holoinsight.server.agg.v1.core.data.AggKeySerdes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ private void deltaSync0() {
}

long cost = System.currentTimeMillis() - time0;
log.info(
"[aggtask] delta sync once, [{}, {}), add=[{}] update=[{}] del=[{}] read=[{}] cost=[{}]", //
SDF.format(begin), SDF.format(end), //
add, update, del, deltaMap.size(), cost);
synchronized (SDF) {
log.info(
"[aggtask] delta sync once, [{}, {}), add=[{}] update=[{}] del=[{}] read=[{}] cost=[{}]", //
SDF.format(begin), SDF.format(end), //
add, update, del, deltaMap.size(), cost);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
maybeForceBuilderInitialization();
}

private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
}
}
private void maybeForceBuilderInitialization() {}

@java.lang.Override
public Builder clear() {
Expand Down Expand Up @@ -482,4 +479,3 @@ public io.holoinsight.server.apm.grpc.common.CPU getDefaultInstanceForType() {
}

}

Loading

0 comments on commit f9c579f

Please sign in to comment.