public PageDataVO fetchDataByDeviceAndMeasurement()

in tsfile-viewer-web/src/main/java/org/apache/iotdb/ui/service/TsfileViewerService.java [771:797]


  public PageDataVO fetchDataByDeviceAndMeasurement(
      String filePath, PageModel pageModel, SearchDataReq dataReq)
      throws IOException, InterruptedException, TsfileViewerException {
    filePath = getFullPath(filePath);
    TsFileAnalyserV13 parse = tsfileViewerContainer.getTsfileParser(filePath);
    long startTime = dataReq.getBeginDate();
    long endTime = dataReq.getEndDate();
    QueryDataSet queryDataSet =
        parse.queryResult(
            startTime, endTime, dataReq.getDevice(), dataReq.getMeasurement(), "", 0, 0);

    PageDataVO pageDataVO = new PageDataVO();
    pageDataVO.setTitle(Arrays.asList("timestamp", "value"));

    while (queryDataSet.hasNext()) {
      List<String> col = new ArrayList<>();
      RowRecord next = queryDataSet.next();
      long timestamp = next.getTimestamp();
      col.add(timestamp + "");
      for (Field f : next.getFields()) {
        col.add(f.getStringValue());
      }
      pageDataVO.getValues().add(col);
    }

    return pageDataVO;
  }