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 |
_log
Logger for this class
|
protected StoreState |
_state
Current state of the store operation
|
static String |
MIN_STORE_ENCLS2_VERSION
Was supported in 38, but they're now sigtype 11 which wasn't added until 39
|
static String |
MIN_STORE_LS2_VERSION |
static String |
MIN_STORE_VERSION
Short 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) |
| 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)
public StoreJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs, Set<Hash> toSkip)
toSkip - 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)
static boolean shouldStoreLS2To(RouterInfo ri)
static boolean shouldStoreTo(RouterInfo ri)
protected void succeed()