class Peers extends ConcurrentHashMap<Hash,Peer>
This class extends ConcurrentHashMap to provide a thread-safe mapping from peer identification (Hash) to Peer objects. It represents the complete set of known peers for a specific torrent that the DHT tracker is aware of.
The collection is used by the DHT tracker to respond to get_peer requests, providing peers that are actively participating in the torrent. The concurrent implementation ensures thread safety when multiple DHT operations are accessing or modifying the peer list simultaneously.
Each peer in the collection includes metadata such as last seen time and seed status, which can be used to prioritize responses and maintain accurate swarm statistics.
ConcurrentHashMap.KeySetView<K,V>AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
Peers()
Creates a new peer collection with initial capacity for 8 peers.
|
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, valuesclone