@GetMapping(value = "/filterServerMap")
    public FilterMapViewV3 getFilterServer(
            @Valid @ModelAttribute
            ApplicationForm appForm,
            @Valid @ModelAttribute
            RangeForm rangeForm,
            @RequestParam("originTo") long originTo,
            @Valid @ModelAttribute
            GroupForm groupForm,
            @Valid @ModelAttribute
            FilterForm filterForm,
            @RequestParam(value = "limit", required = false, defaultValue = "10000")
            @PositiveOrZero int limitParam,
            @RequestParam(value = "useStatisticsAgentState", defaultValue = "true", required = false)
            boolean useStatisticsAgentState) {
        final String applicationName = appForm.getApplicationName();

        final int limit = Math.min(limitParam, LimitUtils.MAX);
        final Filter<List<SpanBo>> filter = newFilter(filterForm);
        final Range range = toRange(rangeForm);
        final LimitedScanResult<List<TransactionId>> limitedScanResult = filteredMapService.selectTraceIdsFromApplicationTraceIndex(applicationName, range, limit);

        final long lastScanTime = limitedScanResult.limitedTime();
        // original range: needed for visual chart data sampling
        final Range originalRange = Range.between(rangeForm.getFrom(), originTo);
        // needed to figure out already scanned ranged
        final Range scannerRange = Range.between(lastScanTime, range.getTo());
        logger.debug("originalRange:{} scannerRange:{} ", originalRange, scannerRange);
        final FilteredMapServiceOption option = newFilteredOption(limitedScanResult.scanData(), originalRange, groupForm, filter, useStatisticsAgentState);
        final FilterMapWithScatter map = filteredMapService.selectApplicationMapWithScatterData(option);

        if (logger.isDebugEnabled()) {
            logger.debug("getFilteredServerMapData range scan(limit:{}) range:{} lastFetchedTimestamp:{}", limit, range.prettyToString(), DateTimeFormatUtils.format(lastScanTime));
        }

        TimeWindow timeWindow = new TimeWindow(scannerRange);
        ApplicationMapViewV3 applicationMapView = new ApplicationMapViewV3(map.getApplicationMap(), timeWindow, MapViews.ofDetailed(), hyperLinkFactory);
        ScatterDataMapView scatterDataMapView = new ScatterDataMapView(map.getScatterDataMap());
//        FilteredHistogramView filteredHistogramView = new FilteredHistogramView(map.getApplicationMap(), timeWindow, hyperLinkFactory);
        return new FilterMapViewV3(applicationMapView, scatterDataMapView, null, lastScanTime);
    }
@author emeroad
@author netspider
@author jaehong.kim
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/FilteredMapController.java