use of com.navercorp.pinpoint.web.service.map.AcceptApplication in project pinpoint by naver.
the class BFSLinkSelector method findAcceptApplication.
private Set<AcceptApplication> findAcceptApplication(Application fromApplication, String host, Range range) {
logger.debug("findAcceptApplication {} {}", fromApplication, host);
final RpcApplication rpcApplication = new RpcApplication(host, fromApplication);
final Set<AcceptApplication> hit = this.acceptApplicationLocalCache.get(rpcApplication);
if (CollectionUtils.isNotEmpty(hit)) {
logger.debug("acceptApplicationLocalCache hit {}", rpcApplication);
return hit;
}
final Set<AcceptApplication> acceptApplicationSet = hostApplicationMapDao.findAcceptApplicationName(fromApplication, range);
this.acceptApplicationLocalCache.put(rpcApplication, acceptApplicationSet);
Set<AcceptApplication> acceptApplication = this.acceptApplicationLocalCache.get(rpcApplication);
logger.debug("findAcceptApplication {}->{} result:{}", fromApplication, host, acceptApplication);
return acceptApplication;
}
use of com.navercorp.pinpoint.web.service.map.AcceptApplication in project pinpoint by naver.
the class BFSLinkSelector method checkRpcCallAccepted.
private List<LinkData> checkRpcCallAccepted(LinkData linkData, Range range) {
// replace if the rpc client's destination has an agent installed and thus has an application name
final Application toApplication = linkData.getToApplication();
if (!toApplication.getServiceType().isRpcClient() && !toApplication.getServiceType().isQueue()) {
return Collections.singletonList(linkData);
}
logger.debug("checkRpcCallAccepted(). Find applicationName:{} {}", toApplication, range);
final Set<AcceptApplication> acceptApplicationList = findAcceptApplication(linkData.getFromApplication(), toApplication.getName(), range);
logger.debug("find accept application:{}", acceptApplicationList);
if (CollectionUtils.isNotEmpty(acceptApplicationList)) {
if (acceptApplicationList.size() == 1) {
logger.debug("Application info replaced. {} => {}", linkData, acceptApplicationList);
AcceptApplication first = acceptApplicationList.iterator().next();
final LinkData acceptedLinkData = new LinkData(linkData.getFromApplication(), first.getApplication());
acceptedLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
return Collections.singletonList(acceptedLinkData);
} else {
// special case - there are more than 2 nodes grouped by a single url
return createVirtualLinkData(linkData, toApplication, acceptApplicationList);
}
} else {
// for queues, accept application may not exist if no consumers have an agent installed
if (toApplication.getServiceType().isQueue()) {
return Collections.singletonList(linkData);
} else {
final Application unknown = new Application(toApplication.getName(), ServiceType.UNKNOWN);
final LinkData unknownLinkData = new LinkData(linkData.getFromApplication(), unknown);
unknownLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
return Collections.singletonList(unknownLinkData);
}
}
}
use of com.navercorp.pinpoint.web.service.map.AcceptApplication in project pinpoint by naver.
the class DFSLinkSelector method checkRpcCallAccepted.
private List<LinkData> checkRpcCallAccepted(LinkData linkData, Range range) {
// replace if the rpc client's destination has an agent installed and thus has an application name
final Application toApplication = linkData.getToApplication();
if (!toApplication.getServiceType().isRpcClient()) {
return Collections.singletonList(linkData);
}
logger.debug("checkRpcCallAccepted(). Find applicationName:{} {}", toApplication, range);
final Set<AcceptApplication> acceptApplicationList = findAcceptApplication(linkData.getFromApplication(), toApplication.getName(), range);
logger.debug("find accept application:{}", acceptApplicationList);
if (CollectionUtils.isNotEmpty(acceptApplicationList)) {
if (acceptApplicationList.size() == 1) {
logger.debug("Application info replaced. {} => {}", linkData, acceptApplicationList);
AcceptApplication first = acceptApplicationList.iterator().next();
final LinkData acceptedLinkData = new LinkData(linkData.getFromApplication(), first.getApplication());
acceptedLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
return Collections.singletonList(acceptedLinkData);
} else {
// special case - there are more than 2 nodes grouped by a single url
return createVirtualLinkData(linkData, toApplication, acceptApplicationList);
}
} else {
final Application unknown = new Application(toApplication.getName(), ServiceType.UNKNOWN);
final LinkData unknownLinkData = new LinkData(linkData.getFromApplication(), unknown);
unknownLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
return Collections.singletonList(unknownLinkData);
}
}
use of com.navercorp.pinpoint.web.service.map.AcceptApplication in project pinpoint by naver.
the class DFSLinkSelector method findAcceptApplication.
private Set<AcceptApplication> findAcceptApplication(Application fromApplication, String host, Range range) {
logger.debug("findAcceptApplication {} {}", fromApplication, host);
final RpcApplication rpcApplication = new RpcApplication(host, fromApplication);
final Set<AcceptApplication> hit = this.acceptApplicationLocalCache.get(rpcApplication);
if (CollectionUtils.isNotEmpty(hit)) {
logger.debug("acceptApplicationLocalCache hit {}", rpcApplication);
return hit;
}
final Set<AcceptApplication> acceptApplicationSet = hostApplicationMapDao.findAcceptApplicationName(fromApplication, range);
this.acceptApplicationLocalCache.put(rpcApplication, acceptApplicationSet);
Set<AcceptApplication> acceptApplication = this.acceptApplicationLocalCache.get(rpcApplication);
logger.debug("findAcceptApplication {}->{} result:{}", fromApplication, host, acceptApplication);
return acceptApplication;
}
use of com.navercorp.pinpoint.web.service.map.AcceptApplication in project pinpoint by naver.
the class RpcCallProcessor method replaceLinkData.
private List<LinkData> replaceLinkData(LinkData linkData, Range range) {
final Application toApplication = linkData.getToApplication();
if (toApplication.getServiceType().isRpcClient() || toApplication.getServiceType().isQueue()) {
// rpc client's destination could have an agent installed in which case the link data must be replaced to point
// to the destination application.
logger.debug("Finding accept applications for {}, {}", toApplication, range);
final Set<AcceptApplication> acceptApplicationList = findAcceptApplications(linkData.getFromApplication(), toApplication.getName(), range);
logger.debug("Found accept applications: {}", acceptApplicationList);
if (CollectionUtils.hasLength(acceptApplicationList)) {
if (acceptApplicationList.size() == 1) {
logger.debug("Application info replaced. {} => {}", linkData, acceptApplicationList);
AcceptApplication first = acceptApplicationList.iterator().next();
final LinkData acceptedLinkData = new LinkData(linkData.getFromApplication(), first.getApplication());
acceptedLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
return Collections.singletonList(acceptedLinkData);
} else {
// special case - there are more than 2 nodes grouped by a single url
return virtualLinkMarker.createVirtualLinkData(linkData, toApplication, acceptApplicationList);
}
} else {
// for queues, accept application may not exist if no consumers have an agent installed
if (toApplication.getServiceType().isQueue()) {
return Collections.singletonList(linkData);
} else {
final Application unknown = new Application(toApplication.getName(), ServiceType.UNKNOWN);
final LinkData unknownLinkData = new LinkData(linkData.getFromApplication(), unknown);
unknownLinkData.setLinkCallDataMap(linkData.getLinkCallDataMap());
return Collections.singletonList(unknownLinkData);
}
}
}
return Collections.singletonList(linkData);
}
Aggregations