|
||||||||||
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
The network database
Field Summary | |
---|---|
static char |
CAPABILITY_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, MIN_RESEED, PROP_DB_DIR, PROP_ENFORCE_NETID, PUBLISH_JOB_DELAY |
Constructor Summary | |
---|---|
FloodfillNetworkDatabaseFacade(RouterContext context)
|
Method Summary | |
---|---|
(package private) void |
complete(Hash key)
Must be called by the search job queued by search() on success or failure |
protected void |
createHandlers()
|
protected PeerSelector |
createPeerSelector()
|
void |
flood(DatabaseEntry 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 |
isNegativeCached(Hash key)
Is the key in the negative lookup cache? |
(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. |
(package private) void |
lookupFailed(Hash key)
Increment in the negative lookup cache |
void |
publish(RouterInfo localRouterInfo)
Send our RI to the closest floodfill. |
(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) |
void |
sendStore(Hash key,
DatabaseEntry 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 |
shutdown()
If we are floodfill, turn it off and tell everybody. |
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, lookupLocally, lookupRouterInfo, lookupRouterInfoLocally, publish, queueForExploration, removeFromExploreKeys, rescan, reseedChecker, restart, searchComplete, setLastExploreNewDate, 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 CAPABILITY_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 shutdown()
shutdown
in interface Service
shutdown
in class KademliaNetworkDatabaseFacade
public void publish(RouterInfo localRouterInfo) throws IllegalArgumentException
publish
in class KademliaNetworkDatabaseFacade
IllegalArgumentException
- if the local router info is invalidpublic void sendStore(Hash key, DatabaseEntry ds, Job onSuccess, Job onFailure, long sendTimeout, Set toIgnore)
KademliaNetworkDatabaseFacade
sendStore
in class KademliaNetworkDatabaseFacade
boolean shouldThrottleFlood(Hash key)
boolean shouldThrottleLookup(Hash from, TunnelId id)
void lookupFailed(Hash key)
boolean isNegativeCached(Hash key)
public void flood(DatabaseEntry 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)
peer
- may be null, returns false if nullpublic List<RouterInfo> getKnownRouterData()
SearchJob search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease)
search
in class KademliaNetworkDatabaseFacade
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 |