java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.networkdb.kademlia.PersistentDataStore.ReadRouterJob
- All Implemented Interfaces:
Job
- Enclosing class:
PersistentDataStore
Reads a single RouterInfo file from disk and stores it in memory.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionReadRouterJob(File routerFile, Hash key) Creates a job to read a RouterInfo from disk.Method Summary
Methods inherited from class JobImpl
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionvoiddropped()Default implementation does nothing.final RouterContextThe router context that this job belongs to.longgetJobId()The unique job ID for this job.longThe timestamp when this job was last made ready for execution.The timing object for this job.voidmadeReady(long now) For JobQueue only, not for external use.protected voidrequeue(long delayMs) Requeue this job to run after the specified delay.toString()
Field Details
_routerFile
Router file to read._key
Hash key of the router._knownDate
private long _knownDatePublished date of the cached entry.
Constructor Details
ReadRouterJob
Method Details
getName
shouldRead
private boolean shouldRead()Whether the file is newer than the cached entry.- Returns:
- true if the file is newer than the cached entry
runJob
public void runJob()Read a RouterInfo from disk and load it into memory.read
public boolean read()Reads the RouterInfo from disk.- Returns:
- true if the RouterInfo was read and stored successfully