public void removeBrokenSessionConnection(SessionConnection sessionConnection) {
    // remove the cached broken leader session
    if (enableRedirection) {
      TEndPoint endPoint = null;
      if (endPointToSessionConnection != null) {
        for (Iterator<Entry<TEndPoint, SessionConnection>> it =
                endPointToSessionConnection.entrySet().iterator();
            it.hasNext(); ) {
          Entry<TEndPoint, SessionConnection> entry = it.next();
          if (entry.getValue().equals(sessionConnection)) {
            endPoint = entry.getKey();
            it.remove();
            break;
          }
        }
      }
      if (deviceIdToEndpoint != null && !deviceIdToEndpoint.isEmpty()) {
        for (Iterator<Entry<String, TEndPoint>> it = deviceIdToEndpoint.entrySet().iterator();
            it.hasNext(); ) {
          Entry<String, TEndPoint> entry = it.next();
          if (entry.getValue().equals(endPoint)) {
            it.remove();
          }
        }
      }
      if (tableModelDeviceIdToEndpoint != null && !tableModelDeviceIdToEndpoint.isEmpty()) {
        for (Iterator<Entry<IDeviceID, TEndPoint>> it =
                tableModelDeviceIdToEndpoint.entrySet().iterator();
            it.hasNext(); ) {
          Entry<IDeviceID, TEndPoint> entry = it.next();
          if (entry.getValue().equals(endPoint)) {
            it.remove();
          }
        }
      }
    }
  }
insert data in one row, if you want to improve your performance, please use insertRecords
method or insertTablet method

@see Session#insertRecords(List, List, List, List, List)
@see Session#insertTablet(Tablet)
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java