public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacade
| Modifier and Type | Field and Description |
|---|---|
static char |
CAPABILITY_FLOODFILL |
static int |
MAX_TO_FLOOD
This is the flood redundancy.
|
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.
|
_context, _log, _networkID, _peerSelector, DEFAULT_DB_DIR, DONT_FAIL_PERIOD, MAX_EXPLORE_QUEUE, MIN_REMAINING_ROUTERS, MIN_RESEED, PROP_DB_DIR, PUBLISH_JOB_DELAY| Constructor and Description |
|---|
FloodfillNetworkDatabaseFacade(RouterContext context) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
complete(net.i2p.data.Hash key)
Must be called by the search job queued by search() on success or failure
|
protected void |
createHandlers()
unused, see override
|
protected PeerSelector |
createPeerSelector() |
void |
flood(net.i2p.data.DatabaseEntry ds)
Send to a subset of all floodfill peers.
|
boolean |
floodConditional(net.i2p.data.DatabaseEntry ds)
If we are floodfill AND the key is not throttled,
flood it, otherwise don't.
|
boolean |
floodfillEnabled()
For convenience, so users don't have to cast to FNDF, and unit tests using
Dummy NDF will work.
|
List<net.i2p.data.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(net.i2p.data.Hash h) |
protected void |
lookupBeforeDropping(net.i2p.data.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)
Send our RI to the closest floodfill.
|
(package private) SearchJob |
search(net.i2p.data.Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs,
boolean isLease)
Lookup using exploratory tunnels.
|
(package private) SearchJob |
search(net.i2p.data.Hash key,
Job onFindJob,
Job onFailedLookupJob,
long timeoutMs,
boolean isLease,
net.i2p.data.Hash fromLocalDest)
Lookup using the client's tunnels.
|
void |
sendStore(net.i2p.data.Hash key,
net.i2p.data.DatabaseEntry ds,
Job onSuccess,
Job onFailure,
long sendTimeout,
Set<net.i2p.data.Hash> toIgnore)
unused (overridden in FNDF)
|
void |
setFloodfillEnabled(boolean yes)
Public, called from console.
|
(package private) void |
setFloodfillEnabledFromMonitor(boolean yes)
Package private, called from FloodfillMonitorJob.
|
(package private) boolean |
shouldThrottleFlood(net.i2p.data.Hash key)
Increments and tests.
|
(package private) boolean |
shouldThrottleLookup(net.i2p.data.Hash from,
net.i2p.data.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(net.i2p.data.Hash h) |
(package private) void |
verifyStarted(net.i2p.data.Hash h) |
dropAfterLookupFailed, fail, failPermanently, findNearestRouters, getAllRouters, getBlindData, getBlindData, getDataStore, getDbDir, getExploreKeys, getKBuckets, getKBucketSetSize, getKnownLeaseSets, getKnownRouters, getLastExploreNewDate, getLastRouterInfoPublishTime, getLeases, getPeerSelector, getPeerTimeout, getRouters, isInitialized, isNegativeCached, isNegativeCachedForever, lookupDestination, lookupDestinationLocally, lookupFailed, lookupLeaseSet, lookupLeaseSet, lookupLeaseSetLocally, lookupLeaseSetRemotely, lookupLeaseSetRemotely, lookupLocally, lookupLocallyWithoutValidation, lookupRouterInfo, lookupRouterInfoLocally, publish, queueForExploration, removeBlindData, removeFromExploreKeys, renderStatusHTML, rescan, reseedChecker, restart, routerInfoPublishSuccessful, searchComplete, setBlindData, setLastExploreNewDate, stopPublishing, store, store, store, unpublish, validatestorepublic static final char CAPABILITY_FLOODFILL
public static final int MAX_TO_FLOOD
static final long PUBLISH_TIMEOUT
protected static final int MIN_ACTIVE_PEERS
public FloodfillNetworkDatabaseFacade(RouterContext context)
public void startup()
Servicestartup in interface Servicestartup in class KademliaNetworkDatabaseFacadeprotected void createHandlers()
KademliaNetworkDatabaseFacadecreateHandlers in class KademliaNetworkDatabaseFacadepublic void shutdown()
shutdown in interface Serviceshutdown in class KademliaNetworkDatabaseFacadepublic void publish(RouterInfo localRouterInfo) throws IllegalArgumentException
publish in class KademliaNetworkDatabaseFacadeIllegalArgumentException - if the local router info is invalidpublic void sendStore(net.i2p.data.Hash key,
net.i2p.data.DatabaseEntry ds,
Job onSuccess,
Job onFailure,
long sendTimeout,
Set<net.i2p.data.Hash> toIgnore)
KademliaNetworkDatabaseFacadesendStore in class KademliaNetworkDatabaseFacadeboolean shouldThrottleFlood(net.i2p.data.Hash key)
boolean shouldThrottleLookup(net.i2p.data.Hash from,
net.i2p.data.TunnelId id)
public boolean floodConditional(net.i2p.data.DatabaseEntry ds)
public void flood(net.i2p.data.DatabaseEntry ds)
protected PeerSelector createPeerSelector()
createPeerSelector in class KademliaNetworkDatabaseFacadepublic void setFloodfillEnabled(boolean yes)
void setFloodfillEnabledFromMonitor(boolean yes)
public boolean floodfillEnabled()
NetworkDatabaseFacadefloodfillEnabled in class NetworkDatabaseFacadepublic static boolean isFloodfill(RouterInfo peer)
peer - may be null, returns false if nullpublic List<RouterInfo> getKnownRouterData()
SearchJob search(net.i2p.data.Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease)
search in class KademliaNetworkDatabaseFacadeSearchJob search(net.i2p.data.Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease, net.i2p.data.Hash fromLocalDest)
search in class KademliaNetworkDatabaseFacadefromLocalDest - use these tunnels for the lookup, or null for exploratoryvoid complete(net.i2p.data.Hash key)
public List<net.i2p.data.Hash> getFloodfillPeers()
boolean isVerifyInProgress(net.i2p.data.Hash h)
void verifyStarted(net.i2p.data.Hash h)
void verifyFinished(net.i2p.data.Hash h)
protected void lookupBeforeDropping(net.i2p.data.Hash peer,
RouterInfo info)
lookupBeforeDropping in class KademliaNetworkDatabaseFacade