Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
saimu.msm committed Jan 30, 2024
1 parent d710a86 commit 34ad460
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,40 +217,38 @@ public void dispatch(AuthInfo authInfo, WriteMetricsRequestV1 request) {
}

public void dispatchUpEvent(AuthInfo authInfo, ReportEventRequest request) {
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 @@ -128,8 +128,9 @@ public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext
try {
field.set(instance, element.getAsNumber().longValue());
} catch (Exception e) {
Date date = new Date();
synchronized (SDF) {
Date date = SDF.parse(element.getAsString());
date = SDF.parse(element.getAsString());
}
field.set(instance, date.getTime());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import lombok.extern.slf4j.Slf4j;


/**
* Client is the Netty TCP client.
*
*/
@Slf4j
public class Client {
int port;
String ip;
Expand Down Expand Up @@ -55,6 +57,8 @@ protected void initChannel(SocketChannel socketChannel) throws Exception {
this.channel = channelFuture.channel();

return channelFuture;
} finally {
log.info("client startup.");
}
}

Expand Down

0 comments on commit 34ad460

Please sign in to comment.