@Override
  public void addAlignedMeasurementsInTemplate(
      String templateName,
      List<String> measurementsPath,
      List<TSDataType> dataTypes,
      List<TSEncoding> encodings,
      List<CompressionType> compressors)
      throws IOException, IoTDBConnectionException, StatementExecutionException {
    for (int i = 0; i < RETRY; i++) {
      ISession session = getSession();
      try {
        session.addAlignedMeasurementsInTemplate(
            templateName, measurementsPath, dataTypes, encodings, compressors);
        putBack(session);
        return;
      } catch (IoTDBConnectionException e) {
        // TException means the connection is broken, remove it and get a new one.
        LOGGER.warn("addAlignedMeasurementsInTemplate failed", e);
        cleanSessionAndMayThrowConnectionException(session, i, e);
      } catch (StatementExecutionException | RuntimeException e) {
        putBack(session);
        throw e;
      } catch (Throwable e) {
        LOGGER.error("unexpected error in addAlignedMeasurementsInTemplate", e);
        putBack(session);
        throw new RuntimeException(e);
      }
    }
  }
Compatible for rel/0.12, this method will create an unaligned flat template as a result. Notice
that there is no aligned concept in 0.12, so only the first measurement in each nested list
matters.

@param name name of the template
@param schemaNames it works as a virtual layer inside template in 0.12, and makes no difference
    after 0.13
@param measurements the first measurement in each nested list will constitute the final flat
    template
@param dataTypes the data type of each measurement, only the first one in each nested list
    matters as above
@param encodings the encoding of each measurement, only the first one in each nested list
    matters as above
@param compressors the compressor of each measurement
@throws IoTDBConnectionException
@throws StatementExecutionException
@deprecated
iotdb-client/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java