|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.NetworkDatabaseFacade
net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade
net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade
public class FloodfillNetworkDatabaseFacade
Field Summary | |
---|---|
static char |
CAPACITY_FLOODFILL
|
protected static int |
MIN_ACTIVE_PEERS
NTCP cons drop quickly but SSU takes a while, so it's prudent to keep this a little higher than 1 or 2. |
(package private) static long |
PUBLISH_TIMEOUT
This maybe could be shorter than RepublishLeaseSetJob.REPUBLISH_LEASESET_TIMEOUT, because we are sending direct, but unresponsive floodfills may take a while due to timeouts. |
Fields inherited from class net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade |
---|
_context, _log, _peerSelector, DEFAULT_DB_DIR, DONT_FAIL_PERIOD, MAX_LEASE_FUTURE, MIN_REMAINING_ROUTERS, PROP_DB_DIR, PROP_ENFORCE_NETID, PUBLISH_JOB_DELAY |
Constructor Summary | |
---|---|
FloodfillNetworkDatabaseFacade(RouterContext context)
|
Method Summary | |
---|---|
(package private) void |
complete(Hash key)
|
protected void |
createHandlers()
|
protected PeerSelector |
createPeerSelector()
|
void |
flood(DataStructure ds)
Send to a subset of all floodfill peers. |
boolean |
floodfillEnabled()
|
static boolean |
floodfillEnabled(RouterContext ctx)
|
List<Hash> |
getFloodfillPeers()
list of the Hashes of currently known floodfill peers; Returned list will not include our own hash. |
List<RouterInfo> |
getKnownRouterData()
|
static boolean |
isFloodfill(RouterInfo peer)
|
(package private) boolean |
isVerifyInProgress(Hash h)
|
protected void |
lookupBeforeDropping(Hash peer,
RouterInfo info)
Search for a newer router info, drop it from the db if the search fails, unless just started up or have bigger problems. |
void |
publish(RouterInfo localRouterInfo)
Stores to local db only. |
(package private) SearchJob |
search(Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs,
boolean isLease)
Begin a kademlia style search for the key specified, which can take up to timeoutMs and will fire the appropriate jobs on success or timeout (or if the kademlia search completes without any match) |
(package private) void |
searchFull(Hash key,
List<Job> onFind,
List<Job> onFailed,
long timeoutMs,
boolean isLease)
Ok, the initial set of searches to the floodfill peers timed out, lets fall back on the wider kademlia-style searches Unused - called only by FloodSearchJob which is overridden - don't use this. |
void |
sendStore(Hash key,
DataStructure ds,
Job onSuccess,
Job onFailure,
long sendTimeout,
Set toIgnore)
unused (overridden in FNDF) |
(package private) void |
setFloodfillEnabled(boolean yes)
|
(package private) boolean |
shouldThrottleFlood(Hash key)
Increments and tests. |
(package private) boolean |
shouldThrottleLookup(Hash from,
TunnelId id)
Increments and tests. |
void |
startup()
Instruct the service that it should start normal operation. |
(package private) void |
verifyFinished(Hash h)
|
(package private) void |
verifyStarted(Hash h)
|
Methods inherited from class net.i2p.router.networkdb.kademlia.KademliaNetworkDatabaseFacade |
---|
dropAfterLookupFailed, fail, findNearestRouters, getAllRouters, getDataStore, getDbDir, getExploreKeys, getKBuckets, getKBucketSetSize, getKnownLeaseSets, getKnownRouters, getLastExploreNewDate, getLeases, getPeerSelector, getPeerTimeout, getRouters, isInitialized, lookupLeaseSet, lookupLeaseSetLocally, lookupRouterInfo, lookupRouterInfoLocally, publish, queueForExploration, removeFromExploreKeys, rescan, restart, searchComplete, setLastExploreNewDate, shutdown, stopPublishing, store, store, store, unpublish, validate, validate |
Methods inherited from class net.i2p.router.NetworkDatabaseFacade |
---|
renderStatusHTML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char CAPACITY_FLOODFILL
static final long PUBLISH_TIMEOUT
protected static final int MIN_ACTIVE_PEERS
Constructor Detail |
---|
public FloodfillNetworkDatabaseFacade(RouterContext context)
Method Detail |
---|
public void startup()
Service
startup
in interface Service
startup
in class KademliaNetworkDatabaseFacade
protected void createHandlers()
createHandlers
in class KademliaNetworkDatabaseFacade
public void publish(RouterInfo localRouterInfo) throws IllegalArgumentException
KademliaNetworkDatabaseFacade
publish
in class KademliaNetworkDatabaseFacade
IllegalArgumentException
- if the local router info is invalidpublic void sendStore(Hash key, DataStructure ds, Job onSuccess, Job onFailure, long sendTimeout, Set toIgnore)
KademliaNetworkDatabaseFacade
sendStore
in class KademliaNetworkDatabaseFacade
boolean shouldThrottleFlood(Hash key)
boolean shouldThrottleLookup(Hash from, TunnelId id)
public void flood(DataStructure ds)
protected PeerSelector createPeerSelector()
createPeerSelector
in class KademliaNetworkDatabaseFacade
void setFloodfillEnabled(boolean yes)
public boolean floodfillEnabled()
public static boolean floodfillEnabled(RouterContext ctx)
public static boolean isFloodfill(RouterInfo peer)
public List<RouterInfo> getKnownRouterData()
SearchJob search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease)
search
in class KademliaNetworkDatabaseFacade
void searchFull(Hash key, List<Job> onFind, List<Job> onFailed, long timeoutMs, boolean isLease)
void complete(Hash key)
public List<Hash> getFloodfillPeers()
boolean isVerifyInProgress(Hash h)
void verifyStarted(Hash h)
void verifyFinished(Hash h)
protected void lookupBeforeDropping(Hash peer, RouterInfo info)
lookupBeforeDropping
in class KademliaNetworkDatabaseFacade
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |