private void insertTabletInternal(Tablet tablet, TSInsertTabletReq request)
      throws IoTDBConnectionException, StatementExecutionException {
    try {
      getSessionConnection(tablet.getDeviceId()).insertTablet(request);
    } catch (RedirectException e) {
      handleRedirection(tablet.getDeviceId(), e.getEndPoint());
    } catch (IoTDBConnectionException e) {
      if (enableRedirection
          && !deviceIdToEndpoint.isEmpty()
          && deviceIdToEndpoint.get(tablet.getDeviceId()) != null) {
        logger.warn(SESSION_CANNOT_CONNECT, deviceIdToEndpoint.get(tablet.getDeviceId()));
        deviceIdToEndpoint.remove(tablet.getDeviceId());

        // reconnect with default connection
        try {
          defaultSessionConnection.insertTablet(request);
        } catch (RedirectException ignored) {
        }
      } else {
        throw e;
      }
    }
  }
insert a Tablet

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