| Package | Description |
|---|---|
| net.i2p.router.peermanager | Peer management, profiling, and capacity calculation for I2P network optimization. |
| net.i2p.router.tunnel.pool | Tunnel pool management, creation, and peer selection for I2P's anonymous routing system. |
| Modifier and Type | Method and Description |
|---|---|
PeerProfile | ProfileOrganizer.addProfile(PeerProfile profile)Insert a fully-constructed profile into the organizer. |
PeerProfile | ProfileOrganizer.getOrCreateProfileNonblocking(Hash peer)Retrieve an existing profile or create a new one, without blocking on contention. |
PeerProfile | ProfileOrganizer.getProfile(Hash peer)Retrieve the profile for a peer, or null if unknown. |
PeerProfile | ProfileOrganizer.getProfileNonblocking(Hash peer)Retrieve the profile for a peer without blocking. |
PeerProfile | ProfilePersistenceHelper.readProfile(File file,
long cutoff)Read and parse a single stored profile. |
| Modifier and Type | Method and Description |
|---|---|
List<PeerProfile> | ProfilePersistenceHelper.readProfiles()Load all existing profiles from the profile directory. |
| Modifier and Type | Method and Description |
|---|---|
PeerProfile | ProfileOrganizer.addProfile(PeerProfile profile)Insert a fully-constructed profile into the organizer. |
static double | SpeedCalculator.calc(PeerProfile profile)Calculate the estimated speed score for the given peer. |
static double | IntegrationCalculator.calc(PeerProfile profile)How well integrated the peer is, as a weighted count of recent db introductions
plus the integration bonus. |
static double | CapacityCalculator.calc(PeerProfile profile)Calculate the capacity for the given peer profile. |
int | InverseCapacityComparator.compare(PeerProfile left,
PeerProfile right)Compare the two objects backwards. |
int | SpeedComparator.compare(PeerProfile left,
PeerProfile right) |
(package private) static boolean | ProfileOrganizer.hasRecentProofOfLife(PeerProfile profile,
long now)True if the peer has shown proof of life within
ProfileOrganizer.PROOF_OF_LIFE_WINDOW_MS: a successful send, heard-from, or
heard-about within the last hour. |
(package private) static boolean | ProfileOrganizer.hasRecentTierActivity(PeerProfile profile,
long activeCutoff)True if the peer showed recent activity within the given cutoff: a
heard-from or successful send at or after the cutoff. |
(package private) static boolean | ProfileOrganizer.isEvictable(PeerProfile profile,
Map<Hash,PeerProfile> fastPeers,
Map<Hash,PeerProfile> highCapPeers,
long activeThreshold,
int fastPeerLimit,
int highCapacityLimit)Whether a profile is eligible for eviction under the profile cap:
not protected by a fast/high-cap tier slot that still has room below
its limit, and no send or heard-from activity within the active window. |
(package private) static boolean | ProfileOrganizer.isExpiredProfile(PeerProfile profile,
long now,
long expireActive,
long expirePassive,
long expireGossip,
long expireUntracked)Whether a profile has expired from its activity tier and should be
purged: no activity (send/heard/heard-about) within the tier's
expiration window. |
(package private) static boolean | ProfileOrganizer.isReliableBandwidthPeer(PeerProfile profile,
long now,
boolean established)Reliability gate for high-bandwidth (O/P/X tier) selection: the peer
must show a tunnel acceptance ratio of at least 0.3 AND evidence of
recent activity — a successful peer test within 10 minutes, a heard-
from/send-success within 30 minutes, or an established commSystem
connection. |
(package private) static boolean | ProfileOrganizer.isStaleAbsentPeer(PeerProfile profile,
long now,
long absentThreshold)Whether the peer's last activity (send, heard-from, or heard-about)
is older than the absent threshold — i.e. |
(package private) boolean | ProfileOrganizer.passesTierGates(PeerProfile profile,
double buildSuccess,
long now)Common gate for fast/high-cap tier fill passes: the peer must be
selectable, have acceptable tunnel acceptance, no recent tunnel
failures, and not be in loss probation. |
(package private) boolean | ProfileOrganizer.skipsPromotion(PeerProfile profile,
Hash peer,
double buildSuccess)Whether the peer should be skipped for tier promotion: not selectable,
in a strict country, low tunnel acceptance, high-latency penalty,
congested, or in loss probation. |
void | ProfileOrganizer.writeProfile(PeerProfile profile)Persist the given profile to disk. |
boolean | ProfilePersistenceHelper.writeProfile(PeerProfile profile)Write the data from the profile to the file |
void | ProfilePersistenceHelper.writeProfile(PeerProfile profile,
OutputStream out)Write the data from the profile to the stream
includes comments |
void | ProfilePersistenceHelper.writeProfile(PeerProfile profile,
OutputStream out,
boolean addComments)Write the data from the profile to the stream |
| Modifier and Type | Method and Description |
|---|---|
(package private) static boolean | ProfileOrganizer.isEvictable(PeerProfile profile,
Map<Hash,PeerProfile> fastPeers,
Map<Hash,PeerProfile> highCapPeers,
long activeThreshold,
int fastPeerLimit,
int highCapacityLimit)Whether a profile is eligible for eviction under the profile cap:
not protected by a fast/high-cap tier slot that still has room below
its limit, and no send or heard-from activity within the active window. |
(package private) static boolean | ProfileOrganizer.isEvictable(PeerProfile profile,
Map<Hash,PeerProfile> fastPeers,
Map<Hash,PeerProfile> highCapPeers,
long activeThreshold,
int fastPeerLimit,
int highCapacityLimit)Whether a profile is eligible for eviction under the profile cap:
not protected by a fast/high-cap tier slot that still has room below
its limit, and no send or heard-from activity within the active window. |
| Modifier and Type | Method and Description |
|---|---|
(package private) static int | ClientPeerSelector.compareAcceptance(PeerProfile prof1,
PeerProfile prof2)Acceptance ratio tiers: good (> 0.3) ranks above low (< 0.3), which
ranks above dead (<= 0). |
(package private) static int | ClientPeerSelector.compareActivity(PeerProfile prof1,
PeerProfile prof2,
long now,
long thirtyMinutes)Peers active within the activity window sort first. |
(package private) static int | ClientPeerSelector.compareQuality(Hash p1,
Hash p2,
Set<Hash> exclude,
PeerProfile prof1,
PeerProfile prof2,
long now,
long thirtyMinutes)Full quality comparison cascade. |
(package private) static boolean | TunnelPeerSelector.hasConnectivitySignal(PeerProfile profile,
long now,
long activityWindow)Pre-qualification signal check: does the peer profile show recent
connectivity evidence? Heard from or successfully sent to within the
last 30 minutes, a successful tunnel test within the activity window,
or any test history at all with a >50% acceptance ratio. |
(package private) boolean | ClientPeerSelector.isReliable(PeerProfile profile,
long now,
long tenMinutes,
long thirtyMinutes)Reliability gate: the acceptance ratio must be at least 0.3, and the
peer must show a recent tunnel-test success, recent activity, or an
established connection. |