@Override
  public Optional<DataNodeWrapper> dataNodeIdToWrapper(final int nodeId) {
    try (final SyncConfigNodeIServiceClient leaderClient =
        (SyncConfigNodeIServiceClient) getLeaderConfigNodeConnection()) {
      final TShowDataNodesResp resp = leaderClient.showDataNodes();
      for (final TDataNodeInfo dataNodeInfo : resp.getDataNodesInfoList()) {
        if (dataNodeInfo.getDataNodeId() == nodeId) {
          return dataNodeWrapperList.stream()
              .filter(dataNodeWrapper -> dataNodeWrapper.getPort() == dataNodeInfo.getRpcPort())
              .findAny();
        }
      }
      return Optional.empty();
    } catch (final Exception e) {
      return Optional.empty();
    }
  }
Get connection to ConfigNode-Leader in ClusterIT environment

<p>Notice: The caller should always use try-with-resource to invoke this interface in order to
return client to ClientPool automatically

@return {@link SyncConfigNodeIServiceClient} that connects to the ConfigNode-Leader
integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java