use of com.navercorp.pinpoint.web.service.SearchDepth in project pinpoint by naver.
the class LinkSelectContext method advance.
public LinkSelectContext advance() {
SearchDepth nextCallerDepth = callerDepth.nextDepth();
SearchDepth nextCalleeDepth = calleeDepth.nextDepth();
LinkSelectContext nextContext = new LinkSelectContext(range, nextCallerDepth, nextCalleeDepth, linkVisitChecker);
return nextContext;
}
use of com.navercorp.pinpoint.web.service.SearchDepth in project pinpoint by naver.
the class UnidirectionalLinkSelector method select.
@Override
public LinkDataDuplexMap select(List<Application> sourceApplications, Range range, int callerSearchDepth, int calleeSearchDepth) {
logger.debug("Creating link data map for {}", sourceApplications);
final SearchDepth callerDepth = new SearchDepth(callerSearchDepth);
final SearchDepth calleeDepth = new SearchDepth(calleeSearchDepth);
LinkDataDuplexMap linkDataDuplexMap = new LinkDataDuplexMap();
List<Application> applications = filterApplications(sourceApplications);
List<Application> outboundApplications = Collections.unmodifiableList(applications);
LinkSelectContext outboundLinkSelectContext = new LinkSelectContext(range, callerDepth, new SearchDepth(0), linkVisitChecker);
List<Application> inboundApplications = Collections.unmodifiableList(applications);
LinkSelectContext inboundLinkSelectContext = new LinkSelectContext(range, new SearchDepth(0), calleeDepth, linkVisitChecker);
while (!outboundApplications.isEmpty() || !inboundApplications.isEmpty()) {
logger.info("outbound depth search start. callerDepth:{}, calleeDepth:{}, size:{}, nodes:{}", outboundLinkSelectContext.getCallerDepth(), outboundLinkSelectContext.getCalleeDepth(), outboundApplications.size(), outboundApplications);
LinkDataDuplexMap outboundMap = applicationsMapCreator.createLinkDataDuplexMap(outboundApplications, outboundLinkSelectContext);
logger.info("outbound depth search end. callerDepth:{}, calleeDepth:{}", outboundLinkSelectContext.getCallerDepth(), outboundLinkSelectContext.getCalleeDepth());
logger.info("inbound depth search start. callerDepth:{}, calleeDepth:{}, size:{}, nodes:{}", inboundLinkSelectContext.getCallerDepth(), inboundLinkSelectContext.getCalleeDepth(), inboundApplications.size(), inboundApplications);
LinkDataDuplexMap inboundMap = applicationsMapCreator.createLinkDataDuplexMap(inboundApplications, inboundLinkSelectContext);
logger.info("inbound depth search end. callerDepth:{}, calleeDepth:{}", inboundLinkSelectContext.getCallerDepth(), inboundLinkSelectContext.getCalleeDepth());
linkDataDuplexMap.addLinkDataDuplexMap(outboundMap);
linkDataDuplexMap.addLinkDataDuplexMap(inboundMap);
outboundApplications = filterApplications(outboundLinkSelectContext.getNextApplications());
inboundApplications = filterApplications(inboundLinkSelectContext.getNextApplications());
outboundLinkSelectContext = outboundLinkSelectContext.advance();
inboundLinkSelectContext = inboundLinkSelectContext.advance();
}
return virtualLinkHandler.processVirtualLinks(linkDataDuplexMap, linkVisitChecker, range);
}
use of com.navercorp.pinpoint.web.service.SearchDepth in project pinpoint by naver.
the class BidirectionalLinkSelector method select.
@Override
public LinkDataDuplexMap select(List<Application> sourceApplications, Range range, int callerSearchDepth, int calleeSearchDepth) {
logger.debug("Creating link data map for {}", sourceApplications);
final SearchDepth callerDepth = new SearchDepth(callerSearchDepth);
final SearchDepth calleeDepth = new SearchDepth(calleeSearchDepth);
LinkDataDuplexMap linkDataDuplexMap = new LinkDataDuplexMap();
List<Application> applications = filterApplications(sourceApplications);
LinkSelectContext linkSelectContext = new LinkSelectContext(range, callerDepth, calleeDepth, linkVisitChecker);
while (!applications.isEmpty()) {
logger.info("depth search start. callerDepth:{}, calleeDepth:{}, size:{}, nodes:{}", linkSelectContext.getCallerDepth(), linkSelectContext.getCalleeDepth(), applications.size(), applications);
LinkDataDuplexMap levelData = applicationsMapCreator.createLinkDataDuplexMap(applications, linkSelectContext);
logger.info("depth search end. callerDepth:{}, calleeDepth:{}", linkSelectContext.getCallerDepth(), linkSelectContext.getCalleeDepth());
linkDataDuplexMap.addLinkDataDuplexMap(levelData);
List<Application> nextApplications = linkSelectContext.getNextApplications();
applications = filterApplications(nextApplications);
linkSelectContext = linkSelectContext.advance();
}
return virtualLinkHandler.processVirtualLinks(linkDataDuplexMap, linkVisitChecker, range);
}
Aggregations