7311: Reword PeerSelector javadoc to avoid implementation details

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
pull/7628/head
Matilda Clerke 2 months ago
parent ad86ae6e71
commit 38f04ab5a1
  1. 7
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java
  2. 4
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java

@ -38,6 +38,13 @@ public class DefaultPeerSelector implements PeerSelector {
private final Map<PeerId, EthPeer> ethPeersByPeerId = private final Map<PeerId, EthPeer> ethPeersByPeerId =
Collections.synchronizedMap(new HashMap<>()); Collections.synchronizedMap(new HashMap<>());
/**
* Gets the highest reputation peer matching the supplied filter
*
* @param filter a filter to match prospective peers with
* @return the highest reputation peer matching the supplies filter
* @throws NoAvailablePeerException If there are no suitable peers
*/
@Override @Override
public EthPeer getPeer(final Predicate<EthPeer> filter) throws NoAvailablePeerException { public EthPeer getPeer(final Predicate<EthPeer> filter) throws NoAvailablePeerException {
LOG.trace("Getting peer from pool of {} peers", ethPeersByPeerId.size()); LOG.trace("Getting peer from pool of {} peers", ethPeersByPeerId.size());

@ -24,10 +24,10 @@ import java.util.function.Predicate;
public interface PeerSelector { public interface PeerSelector {
/** /**
* Gets the highest reputation peer matching the supplied filter * Gets a peer matching the supplied filter
* *
* @param filter a filter to match prospective peers with * @param filter a filter to match prospective peers with
* @return the highest reputation peer matching the supplies filter * @return a peer matching the supplied filter
* @throws NoAvailablePeerException If there are no suitable peers * @throws NoAvailablePeerException If there are no suitable peers
*/ */
EthPeer getPeer(final Predicate<EthPeer> filter) throws NoAvailablePeerException; EthPeer getPeer(final Predicate<EthPeer> filter) throws NoAvailablePeerException;

Loading…
Cancel
Save