use of com.navercorp.pinpoint.thrift.dto.command.TRouteResult in project pinpoint by naver.
the class AgentServiceImpl method createActiveThreadCount.
private AgentActiveThreadCount createActiveThreadCount(String agentId, PinpointRouteResponse response) {
TRouteResult routeResult = response.getRouteResult();
if (routeResult == TRouteResult.OK) {
AgentActiveThreadCountFactory factory = new AgentActiveThreadCountFactory();
factory.setAgentId(agentId);
return factory.create(response.getResponse(TCmdActiveThreadCountRes.class, null));
} else {
AgentActiveThreadCountFactory factory = new AgentActiveThreadCountFactory();
factory.setAgentId(agentId);
return factory.createFail(routeResult.name());
}
}
use of com.navercorp.pinpoint.thrift.dto.command.TRouteResult in project pinpoint by naver.
the class ClusterPointRouter method handleStreamRouteCreate.
private StreamCode handleStreamRouteCreate(TCommandTransfer request, StreamCreatePacket packet, ServerStreamChannelContext streamChannelContext) {
byte[] payload = ((TCommandTransfer) request).getPayload();
TBase<?, ?> command = deserialize(payload);
if (command == null) {
return StreamCode.TYPE_UNKNOWN;
}
TCommandTransferResponse response = streamRouteHandler.onRoute(new StreamEvent((TCommandTransfer) request, streamChannelContext, command));
TRouteResult routeResult = response.getRouteResult();
if (routeResult != TRouteResult.OK) {
logger.warn("handleStreamRouteCreate failed. command:{}, routeResult:{}", command, routeResult);
return convertToStreamCode(routeResult);
}
return StreamCode.OK;
}
use of com.navercorp.pinpoint.thrift.dto.command.TRouteResult in project pinpoint by naver.
the class DefaultPinpointRouteResponse method parse.
public void parse(DeserializerFactory<HeaderTBaseDeserializer> commandDeserializerFactory) {
if (!isParsed) {
if (payload == null || payload.length == 0) {
routeResult = TRouteResult.EMPTY_RESPONSE;
return;
}
TBase object = deserialize(commandDeserializerFactory, payload, null);
if (object == null) {
routeResult = TRouteResult.NOT_SUPPORTED_RESPONSE;
} else if (object instanceof TCommandTransferResponse) {
TCommandTransferResponse commandResponse = (TCommandTransferResponse) object;
TRouteResult routeResult = commandResponse.getRouteResult();
if (routeResult == null) {
this.routeResult = TRouteResult.UNKNOWN;
} else {
this.routeResult = routeResult;
}
response = deserialize(commandDeserializerFactory, commandResponse.getPayload(), null);
} else {
routeResult = TRouteResult.UNKNOWN;
response = object;
}
isParsed = true;
}
}
Aggregations