public static List<Pair<String, TEndPoint>> parseRecommendedRedirections(TSStatus status) {
    // If there is no exception, there should be 2 sub-statuses, one for InsertRowsStatement and one
    // for InsertMultiTabletsStatement (see IoTDBDataNodeReceiver#handleTransferTabletBatch).
    final List<Pair<String, TEndPoint>> redirectList = new ArrayList<>();

    if (status.getSubStatusSize() != 2) {
      return redirectList;
    }

    for (final TSStatus subStatus : status.getSubStatus()) {
      if (subStatus.getCode() != TSStatusCode.REDIRECTION_RECOMMEND.getStatusCode()) {
        continue;
      }

      for (final TSStatus innerSubStatus : subStatus.getSubStatus()) {
        if (innerSubStatus.isSetRedirectNode()) {
          // We assume that innerSubStatus.getMessage() is a device path.
          // The message field should be a device path.
          redirectList.add(
              new Pair<>(innerSubStatus.getMessage(), innerSubStatus.getRedirectNode()));
        }
      }
    }

    return redirectList;
  }
Get all redirection recommends after transferring a batch event to update leader cache.

@param status is the returned status after transferring a batch event.
@return a list of pairs, each pair contains a device path and its redirect endpoint.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/util/cacher/LeaderCacheUtils.java