From 38f04ab5a1be4d130b3423703cec2779040a36ee Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:33:04 +1000 Subject: [PATCH] 7311: Reword PeerSelector javadoc to avoid implementation details Signed-off-by: Matilda Clerke --- .../ethereum/eth/manager/peertask/DefaultPeerSelector.java | 7 +++++++ .../besu/ethereum/eth/manager/peertask/PeerSelector.java | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java index f399963173..5d32a37bc8 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java @@ -38,6 +38,13 @@ public class DefaultPeerSelector implements PeerSelector { private final Map ethPeersByPeerId = 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 public EthPeer getPeer(final Predicate filter) throws NoAvailablePeerException { LOG.trace("Getting peer from pool of {} peers", ethPeersByPeerId.size()); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java index 73af26ec4c..3f5589f93b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java @@ -24,10 +24,10 @@ import java.util.function.Predicate; 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 - * @return the highest reputation peer matching the supplies filter + * @return a peer matching the supplied filter * @throws NoAvailablePeerException If there are no suitable peers */ EthPeer getPeer(final Predicate filter) throws NoAvailablePeerException;