private <T> void insertOnce(
      Map<SessionConnection, T> insertGroup, InsertConsumer<T> insertConsumer)
      throws IoTDBConnectionException, StatementExecutionException {
    Map.Entry<SessionConnection, T> entry = insertGroup.entrySet().iterator().next();
    SessionConnection connection = entry.getKey();
    T insertReq = entry.getValue();
    try {
      insertConsumer.insert(connection, insertReq);
    } catch (RedirectException e) {
      e.getDeviceEndPointMap().forEach(this::handleRedirection);
    } catch (IoTDBConnectionException e) {
      if (endPointToSessionConnection != null && endPointToSessionConnection.size() > 1) {
        // remove the broken session
        removeBrokenSessionConnection(connection);
        try {
          insertConsumer.insert(defaultSessionConnection, insertReq);
        } catch (RedirectException ignored) {
        }
      } else {
        throw e;
      }
    }
  }
Create timeseries represented by device template under given device paths.

@param devicePathList the target device paths used for timeseries creation
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java