use of com.navercorp.pinpoint.collector.cluster.ClusterPoint in project pinpoint by naver.
the class ClusterPointController method getGrpcAgentConnectionList.
private List<GrpcAgentConnection> getGrpcAgentConnectionList(final String applicationName, final String agentId, final long startTimestamp) {
Objects.requireNonNull(applicationName, "applicationName");
List<GrpcAgentConnection> result = new ArrayList<>();
List<ClusterPoint<?>> clusterPointList = clusterPointLocator.getClusterPointList();
for (ClusterPoint<?> clusterPoint : clusterPointList) {
if (!(clusterPoint instanceof GrpcAgentConnection)) {
continue;
}
AgentInfo destAgentInfo = clusterPoint.getDestAgentInfo();
if (!destAgentInfo.getApplicationName().equals(applicationName)) {
continue;
}
if (StringUtils.hasText(agentId) && !destAgentInfo.getAgentId().equals(agentId)) {
continue;
}
if (startTimestamp > 0 && destAgentInfo.getStartTimestamp() != startTimestamp) {
continue;
}
result.add((GrpcAgentConnection) clusterPoint);
}
return result;
}
use of com.navercorp.pinpoint.collector.cluster.ClusterPoint in project pinpoint by naver.
the class AbstractRouteHandler method findClusterPoint.
protected ClusterPoint<?> findClusterPoint(TCommandTransfer deliveryCommand) {
String applicationName = deliveryCommand.getApplicationName();
String agentId = deliveryCommand.getAgentId();
long startTimeStamp = deliveryCommand.getStartTime();
List<ClusterPoint<?>> result = new ArrayList<>();
for (ClusterPoint<?> targetClusterPoint : targetClusterPointLocator.getClusterPointList()) {
AgentInfo destAgentInfo = targetClusterPoint.getDestAgentInfo();
if (destAgentInfo.equals(applicationName, agentId, startTimeStamp)) {
result.add(targetClusterPoint);
}
}
if (result.size() == 1) {
return result.get(0);
}
if (result.size() > 1) {
logger.warn("Ambiguous ClusterPoint {}, {}, {} (Valid Agent list={}).", applicationName, agentId, startTimeStamp, result);
return null;
}
return null;
}
Aggregations