private void insertRelationalTabletWithLeaderCache(Tablet tablet)
      throws IoTDBConnectionException, StatementExecutionException {
    Map<SessionConnection, Tablet> relationalTabletGroup = new HashMap<>();
    if (tableModelDeviceIdToEndpoint.isEmpty()) {
      relationalTabletGroup.put(defaultSessionConnection, tablet);
    } else if (SessionUtils.isTabletContainsSingleDevice(tablet)) {
      relationalTabletGroup.put(getSessionConnection(tablet.getDeviceID(0)), tablet);
    } else {
      for (int i = 0; i < tablet.getRowSize(); i++) {
        IDeviceID iDeviceID = tablet.getDeviceID(i);
        final SessionConnection connection = getSessionConnection(iDeviceID);
        int finalI = i;
        relationalTabletGroup.compute(
            connection,
            (k, v) -> {
              if (v == null) {
                List<String> measurements = new ArrayList<>(tablet.getSchemas().size());
                List<TSDataType> dataTypes = new ArrayList<>();
                tablet
                    .getSchemas()
                    .forEach(
                        schema -> {
                          measurements.add(schema.getMeasurementName());
                          dataTypes.add(schema.getType());
                        });
                v =
                    new Tablet(
                        tablet.getTableName(),
                        measurements,
                        dataTypes,
                        tablet.getColumnTypes(),
                        tablet.getRowSize());
              }
              for (int j = 0; j < v.getSchemas().size(); j++) {
                v.addValue(
                    v.getSchemas().get(j).getMeasurementName(),
                    v.getRowSize(),
                    tablet.getValue(finalI, j));
              }
              v.addTimestamp(v.getRowSize(), tablet.getTimestamp(finalI));
              return v;
            });
      }
    }
    if (relationalTabletGroup.size() == 1) {
      insertRelationalTabletOnce(relationalTabletGroup);
    } else {
      insertRelationalTabletByGroup(relationalTabletGroup);
    }
  }
insert a relational Tablet. Note: This method is for internal use only, we do not guarantee
compatibility with subsequent versions.

@param tablet data batch
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java