Package net.i2p.router.peermanager
Class PeerManager
java.lang.Object
net.i2p.router.peermanager.PeerManager
Manage the current state of the statistics
Also maintain Sets for each of the capabilities in TRACKED_CAPS.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final longWe don't want this much longer than the average connect time, as the CapacityCalculator now includes connection as a factor.(package private) static final intAfter first two hours of uptime ~= 246static final String -
Constructor Summary
ConstructorsConstructorDescriptionPeerManager(RouterContext context) Profiles are now loaded in a separate thread, so this should return quickly. -
Method Summary
Modifier and TypeMethodDescription(package private) voidintcountPeersByCapability(char capability) getPeersByCapability(char capability) (package private) voidThis may take a long time - 30 seconds or morevoidremoveCapabilities(Hash peer) selectPeers(PeerSelectionCriteria criteria) Find some peers that meet the criteria and we have the netDb info for locally.voidsetCapabilities(Hash peer, String caps) (package private) void
-
Field Details
-
REORGANIZE_TIME_LONG
static final long REORGANIZE_TIME_LONGWe don't want this much longer than the average connect time, as the CapacityCalculator now includes connection as a factor. This must also be less than 10 minutes, which is the shortest Rate contained in the profile, as the Rates must be coalesced.- See Also:
-
REORGANIZES_PER_DAY
static final int REORGANIZES_PER_DAYAfter first two hours of uptime ~= 246- See Also:
-
TRACKED_CAPS
- See Also:
-
-
Constructor Details
-
PeerManager
Profiles are now loaded in a separate thread, so this should return quickly.
-
-
Method Details
-
storeProfiles
void storeProfiles() -
clearProfiles
void clearProfiles()- Since:
- 0.8.8
-
selectPeers
-
loadProfiles
void loadProfiles()This may take a long time - 30 seconds or more -
selectPeers
Find some peers that meet the criteria and we have the netDb info for locally. Returned list will not include ourselves. Only used by PeerTestJob (PURPOSE_TEST) -
setCapabilities
- Parameters:
caps- non-null, case is ignored
-
removeCapabilities
-
getPeersByCapability
- Parameters:
capability- case-insensitive- Returns:
- non-null unmodifiable set
-
countPeersByCapability
public int countPeersByCapability(char capability) - Parameters:
capability- case-insensitive- Returns:
- how many
- Since:
- 0.9.45
-