Source:
public TmfModelResponse<ITmfVirtualTableModel> fetch(VirtualTableQueryFilter queryFilter) { @Nullable ITmfFilter filter = extractFilter(queryFilter); List<ITmfEventAspect<?>> aspects = getAspectsFromColumnsName(queryFilter.getColumns()); int count = queryFilter.getCount(); long index = queryFilter.getIndex(); List<List<String>> events = new ArrayList<>(count); long requestIndex = filter == null ? index : 0L; int requestCount = filter == null ? count : ITmfEventRequest.ALL_DATA; TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, TmfTimeRange.ETERNITY, requestIndex, requestCount, ExecutionType.FOREGROUND) { @Override public void handleData(ITmfEvent event) { if (filter == null || filter.matches(event)) { super.handleData(event); if (events.size() < count) { List<String> entry = buildTableEntry(event, aspects); if (!entry.isEmpty()) { events.add(buildTableEntry(event, aspects)); } } } } }; getTrace().sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, e.getMessage()); } long totalEntries = filter == null ? getTrace().getNbEvents() : request.getNbRead(); List<String> columnsName = extractColumnsNameFromAspects(aspects); ITmfVirtualTableModel model = new TmfVirtualTableModel(columnsName, events, index, totalEntries); return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }

Target:
public TmfModelResponse<ITmfVirtualTableModel> fetch(VirtualTableQueryFilter queryFilter) { @Nullable ITmfFilter filter = extractFilter(queryFilter); List<ITmfEventAspect<?>> aspects = getAspectsFromColumnsName(queryFilter.getColumns()); int count = queryFilter.getCount(); long index = queryFilter.getIndex(); if (aspects.isEmpty()) { return new TmfModelResponse<>(new TmfVirtualTableModel(Collections.emptyList(), Collections.emptyList(), index, 0), ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); } List<List<String>> events = new ArrayList<>(count); long requestIndex = filter == null ? index : 0L; int requestCount = filter == null ? count : ITmfEventRequest.ALL_DATA; TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, TmfTimeRange.ETERNITY, requestIndex, requestCount, ExecutionType.FOREGROUND) { private long currentIndex = getIndex(); @Override public void handleData(ITmfEvent event) { if (filter == null || filter.matches(event)) { super.handleData(event); currentIndex += getNbRead(); if (events.size() < count && index <= currentIndex) { List<String> entry = Objects.requireNonNull(Lists.transform(aspects, a -> a.resolve(event) == null ? StringUtils.EMPTY : String.valueOf(a.resolve(event)))); if (!entry.isEmpty()) { events.add(entry); } } } } }; getTrace().sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, e.getMessage()); } long totalEntries = filter == null ? getTrace().getNbEvents() : request.getNbRead(); List<String> columnsName = Objects.requireNonNull(Lists.transform(aspects, ITmfEventAspect<?>::getName)); ITmfVirtualTableModel model = new TmfVirtualTableModel(columnsName, events, index, totalEntries); return new TmfModelResponse<>(model, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); }