Package org.klomp.snark.dht
Class DHTNodes
java.lang.Object
org.klomp.snark.dht.DHTNodes
All the nodes we know about, stored as a mapping from
node ID to a Destination and Port.
And a real Kademlia routing table, which stores node IDs only.
- Since:
- 0.9.2
- Author:
- zzz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
findClosest
(SHA1Hash h, int numWant) DHTDHT - get random keys to exploreputIfAbsent
(NodeInfo nInfo) void
Debug info, HTML formattedint
size()
void
start()
void
stop()
values()
-
Constructor Details
-
DHTNodes
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
size
public int size()- Returns:
- known nodes, not total net size
-
clear
public void clear() -
get
-
putIfAbsent
- Returns:
- the old value if present, else null
-
remove
-
values
-
findClosest
DHT- Parameters:
h
- either a InfoHash or a NID
-
getExploreKeys
DHT - get random keys to explore -
renderStatusHTML
Debug info, HTML formatted- Since:
- 0.9.4
-