@Override
  public void terminate(PointCollector collector) throws Exception {
    if (consUtil.getGap() == 0) {
      consUtil.calculateGap();
      consUtil.cleanWindow(collector);
    }
    for (;
        consUtil.getFirst() + len <= consUtil.getLast();
        consUtil.setFirst(consUtil.getFirst() + consUtil.getGap())) {
      collector.putInt(consUtil.getFirst(), consUtil.getCount());
    }
  }
This function searches for consecutive subsequences of given length of input sereis.
library-udf/src/main/java/org/apache/iotdb/library/series/UDTFConsecutiveWindows.java