net.i2p.router.networkdb.kademlia
class FloodfillPeerSelector extends PeerSelector
_context, _log
Constructor and Description |
---|
FloodfillPeerSelector(RouterContext ctx) |
Modifier and Type | Method and Description |
---|---|
(package private) List<Hash> |
selectFloodfillParticipants(Hash key,
int maxNumRouters,
KBucketSet kbuckets)
Sort the floodfills.
|
(package private) List<Hash> |
selectFloodfillParticipants(Hash key,
int howMany,
Set<Hash> toIgnore,
KBucketSet kbuckets)
See above for description
List will not include our own hash
|
(package private) List<Hash> |
selectFloodfillParticipants(KBucketSet kbuckets) |
(package private) List<Hash> |
selectMostReliablePeers(Hash key,
int maxNumRouters,
Set<Hash> peersToIgnore,
KBucketSet kbuckets)
Pick out peers with the floodfill capacity set, returning them first, but then
after they're complete, sort via kademlia.
|
(package private) List<Hash> |
selectNearest(Hash key,
int maxNumRouters,
Set<Hash> peersToIgnore,
KBucketSet kbuckets)
Floodfill peers only.
|
(package private) List<Hash> |
selectNearestExplicitThin(Hash key,
int maxNumRouters,
Set<Hash> peersToIgnore,
KBucketSet kbuckets)
Pick out peers with the floodfill capacity set, returning them first, but then
after they're complete, sort via kademlia.
|
(package private) List<Hash> |
selectNearestExplicitThin(Hash key,
int maxNumRouters,
Set<Hash> peersToIgnore,
KBucketSet kbuckets,
boolean preferConnected)
Pick out peers with the floodfill capacity set, returning them first, but then
after they're complete, sort via kademlia.
|
selectNearestExplicit
public FloodfillPeerSelector(RouterContext ctx)
List<Hash> selectMostReliablePeers(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet kbuckets)
selectMostReliablePeers
in class PeerSelector
peersToIgnore
- can be nullList<Hash> selectNearestExplicitThin(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet kbuckets)
selectNearestExplicitThin
in class PeerSelector
peersToIgnore
- can be nullList<Hash> selectNearestExplicitThin(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet kbuckets, boolean preferConnected)
peersToIgnore
- can be nullList<Hash> selectFloodfillParticipants(KBucketSet kbuckets)
List<Hash> selectFloodfillParticipants(Hash key, int maxNumRouters, KBucketSet kbuckets)
key
- the routing keymaxNumRouters
- max to return
Sorted by closest to the key if > maxNumRouters, otherwise not
The list is in 3 groups - sorted by routing key within each group.
Group 1: No store or lookup failure in a long time, and
lookup fail rate no more than 1.5 * average
Group 2: No store or lookup failure in a little while or
success newer than failure
Group 3: All othersList<Hash> selectFloodfillParticipants(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet kbuckets)
toIgnore
- can be nullList<Hash> selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet kbuckets)
selectNearest
in class PeerSelector
key
- the original key (NOT the routing key)peersToIgnore
- can be null