|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.networkdb.kademlia.PeerSelector
net.i2p.router.networkdb.kademlia.FloodfillPeerSelector
class FloodfillPeerSelector
This is where we implement semi-Kademlia with the floodfills, by selecting floodfills closest to a given key for searches and stores. Warning - most methods taking a key as an argument require the routing key, not the original key.
Field Summary |
---|
Fields inherited from class net.i2p.router.networkdb.kademlia.PeerSelector |
---|
_context, _log |
Constructor Summary | |
---|---|
FloodfillPeerSelector(RouterContext ctx)
|
Method Summary | |
---|---|
(package private) List<Hash> |
selectFloodfillParticipants(Hash key,
int maxNumRouters,
KBucketSet<Hash> kbuckets)
Sort the floodfills. |
(package private) List<Hash> |
selectFloodfillParticipants(Hash key,
int howMany,
Set<Hash> toIgnore,
KBucketSet<Hash> kbuckets)
See above for description List will not include our own hash |
(package private) List<Hash> |
selectFloodfillParticipants(KBucketSet<Hash> kbuckets)
|
(package private) List<Hash> |
selectMostReliablePeers(Hash key,
int maxNumRouters,
Set<Hash> peersToIgnore,
KBucketSet<Hash> 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<Hash> kbuckets)
Floodfill peers only. |
(package private) List<Hash> |
selectNearestExplicitThin(Hash key,
int maxNumRouters,
Set<Hash> peersToIgnore,
KBucketSet<Hash> 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<Hash> kbuckets,
boolean preferConnected)
Pick out peers with the floodfill capacity set, returning them first, but then after they're complete, sort via kademlia. |
Methods inherited from class net.i2p.router.networkdb.kademlia.PeerSelector |
---|
selectNearestExplicit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FloodfillPeerSelector(RouterContext ctx)
Method Detail |
---|
List<Hash> selectMostReliablePeers(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets)
selectMostReliablePeers
in class PeerSelector
key
- the ROUTING key (NOT the original key)peersToIgnore
- can be null
List<Hash> selectNearestExplicitThin(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets)
selectNearestExplicitThin
in class PeerSelector
key
- the ROUTING key (NOT the original key)peersToIgnore
- can be null
List<Hash> selectNearestExplicitThin(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets, boolean preferConnected)
key
- the ROUTING key (NOT the original key)peersToIgnore
- can be null
List<Hash> selectFloodfillParticipants(KBucketSet<Hash> kbuckets)
kbuckets
- now unused
List<Hash> selectFloodfillParticipants(Hash key, int maxNumRouters, KBucketSet<Hash> kbuckets)
key
- the ROUTING key (NOT the original key)maxNumRouters
- max to returnkbuckets
- now unused
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 others
List<Hash> selectFloodfillParticipants(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets)
key
- the ROUTING key (NOT the original key)toIgnore
- can be nullkbuckets
- now unusedList<Hash> selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets)
selectNearest
in class PeerSelector
key
- the original key (NOT the routing key)peersToIgnore
- can be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |