private TSInsertRecordsReq filterAndGenTSInsertRecordsReq(
      List<String> deviceIds,
      List<Long> times,
      List<List<String>> measurementsList,
      List<List<TSDataType>> typesList,
      List<List<Object>> valuesList,
      boolean isAligned)
      throws IoTDBConnectionException {
    if (hasNull(valuesList)) {
      measurementsList = changeToArrayListWithStringType(measurementsList);
      valuesList = changeToArrayList(valuesList);
      deviceIds = new ArrayList<>(deviceIds);
      times = new ArrayList<>(times);
      typesList = changeToArrayListWithTSDataType(typesList);
      filterNullValueAndMeasurement(deviceIds, times, measurementsList, valuesList, typesList);
    }
    return genTSInsertRecordsReq(
        deviceIds, times, measurementsList, typesList, valuesList, isAligned);
  }
Sort the input source list.

<p>e.g. source: [1,2,3,4,5], index:[1,0,3,2,4], return : [2,1,4,3,5]

@param source Input list
@param index return order
@param <T> Input type
@return ordered list
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java