@Override
  public void insertRecordsOfOneDevice(
      String deviceId,
      List<Long> times,
      List<List<String>> measurementsList,
      List<List<TSDataType>> typesList,
      List<List<Object>> valuesList,
      boolean haveSorted)
      throws IoTDBConnectionException, StatementExecutionException {
    ISession session = getSession();
    try {
      session.insertRecordsOfOneDevice(
          deviceId, times, measurementsList, typesList, valuesList, haveSorted);
      putBack(session);
    } catch (IoTDBConnectionException e) {
      // TException means the connection is broken, remove it and get a new one.
      LOGGER.warn(INSERT_RECORDS_OF_ONE_DEVICE_FAIL, e);
      cleanSessionAndMayThrowConnectionException(session, FINAL_RETRY, e);
    } catch (StatementExecutionException | RuntimeException e) {
      putBack(session);
      throw e;
    } catch (Throwable e) {
      LOGGER.error(INSERT_RECORDS_OF_ONE_DEVICE_ERROR_MSG, e);
      putBack(session);
      throw new RuntimeException(e);
    }
  }
Insert data that belong to the same device in batch format, which can reduce the overhead of
network. This method is just like jdbc batch insert, we pack some insert request in batch and
send them to server If you want improve your performance, please see insertTablet method

@param haveSorted whether the times list has been ordered.
@see Session#insertTablet(Tablet)
iotdb-client/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java