public TConfigNodeLocation getLeaderLocation() {
    Peer leaderPeer = getLeaderPeer();
    if (leaderPeer != null) {
      return getNodeManager().getRegisteredConfigNodes().stream()
          .filter(leader -> leader.getConfigNodeId() == leaderPeer.getNodeId())
          .findFirst()
          .orElse(null);
    }
    return null;
  }
@return ConfigNode-leader's location if leader exists, null otherwise.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java