abstract class StoreJob extends JobImpl
Handles the process of storing database entries (RouterInfo or LeaseSet) to floodfill peers with configurable parallelization, redundancy, and timeout handling. Supports both direct and tunnel-based delivery with garlic encryption for client data.
All store operations through this class request a reply to confirm successful delivery. Unused directly - see FloodfillStoreJob for the concrete implementation.
| Modifier and Type | Field and Description |
|---|---|
protected Log | _logLogger for this class |
protected StoreState | _stateCurrent state of the store operation |
static String | MIN_STORE_ENCLS2_VERSIONWas supported in 38, but they're now sigtype 11 which wasn't added until 39 |
static String | MIN_STORE_LS2_VERSIONMinimum version for LS2 stores |
static String | MIN_STORE_VERSIONShort ECIES tunnel build messages (1.5.0) |
| Constructor and Description |
|---|
StoreJob(RouterContext context,
KademliaNetworkDatabaseFacade facade,
Hash key,
DatabaseEntry data,
Job onSuccess,
Job onFailure,
long timeoutMs)Send a data structure to the floodfills |
StoreJob(RouterContext context,
KademliaNetworkDatabaseFacade facade,
Hash key,
DatabaseEntry data,
Job onSuccess,
Job onFailure,
long timeoutMs,
Set<Hash> toSkip)Send a data structure to the floodfills, skipping certain peers |
| Modifier and Type | Method and Description |
|---|---|
protected void | fail()Handle failed completion of the store operation. |
String | getName()Get the name of this job for logging and debugging. |
protected int | getParallelization()Get the maximum number of parallel store operations. |
protected int | getRedundancy()Get the required redundancy level for successful store. |
void | runJob()Execute the job to start sending to the next batch of peers. |
(package private) static boolean | shouldStoreEncLS2To(RouterInfo ri)Is it new enough? |
(package private) static boolean | shouldStoreLS2To(RouterInfo ri)Is it new enough? |
(package private) static boolean | shouldStoreTo(RouterInfo ri)Is it new enough? |
protected void | succeed()Handle successful completion of the store operation. |
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringprotected final Log _log
protected final StoreState _state
public static final String MIN_STORE_ENCLS2_VERSION
public static final String MIN_STORE_LS2_VERSION
public static final String MIN_STORE_VERSION
public StoreJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs)
context - the router contextfacade - the network database facadekey - the keydata - the data to storeonSuccess - job to run on successonFailure - job to run on failuretimeoutMs - timeout in millisecondspublic StoreJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs, Set<Hash> toSkip)
context - the router contextfacade - the network database facadekey - the keydata - the data to storeonSuccess - job to run on successonFailure - job to run on failuretimeoutMs - timeout in millisecondstoSkip - set of peer hashes of people we don't want to send the data to (e.g. we
already know they have it). This can be null.protected void fail()
public String getName()
protected int getParallelization()
protected int getRedundancy()
public void runJob()
static boolean shouldStoreEncLS2To(RouterInfo ri)
ri - the router info to checkstatic boolean shouldStoreLS2To(RouterInfo ri)
ri - the router info to checkstatic boolean shouldStoreTo(RouterInfo ri)
ri - the router info to checkprotected void succeed()