private void filterAndUpdateTSInsertRecordsReq(
      TSInsertRecordsReq request,
      String deviceId,
      Long time,
      List<String> measurements,
      List<TSDataType> types,
      List<Object> values)
      throws IoTDBConnectionException {
    if (hasNull(values)) {
      measurements = new ArrayList<>(measurements);
      types = new ArrayList<>(types);
      values = new ArrayList<>(values);
      boolean isAllValuesNull =
          filterNullValueAndMeasurement(deviceId, measurements, types, values);
      if (isAllValuesNull) {
        throw new NoValidValueException(ALL_INSERT_DATA_IS_NULL);
      }
    }
    updateTSInsertRecordsReq(request, deviceId, time, measurements, types, values);
  }
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