private void insertTabletsWithLeaderCache(
      Map<String, Tablet> tablets, boolean sorted, boolean isAligned)
      throws IoTDBConnectionException, StatementExecutionException {
    Map<SessionConnection, TSInsertTabletsReq> tabletGroup = new HashMap<>();
    for (Entry<String, Tablet> entry : tablets.entrySet()) {
      final SessionConnection connection = getSessionConnection(entry.getKey());
      TSInsertTabletsReq request =
          tabletGroup.computeIfAbsent(connection, k -> new TSInsertTabletsReq());
      updateTSInsertTabletsReq(request, entry.getValue(), sorted, isAligned);
    }

    if (tabletGroup.size() == 1) {
      insertOnce(tabletGroup, SessionConnection::insertTablets);
    } else {
      insertByGroup(tabletGroup, SessionConnection::insertTablets);
    }
  }
insert aligned data of several devices. Given a device, for each timestamp, the number of
measurements is the same.

@param tablets data batch in multiple device
@param sorted deprecated, whether times in each Tablet are in ascending order
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java