net.i2p.router.networkdb.kademlia
Class PersistentDataStore
java.lang.Object
net.i2p.router.networkdb.kademlia.TransientDataStore
net.i2p.router.networkdb.kademlia.PersistentDataStore
- All Implemented Interfaces:
- DataStore
class PersistentDataStore
- extends TransientDataStore
Write out keys to disk when we get them and periodically read ones we don't know
about into memory, with newly read routers are also added to the routing table.
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
PersistentDataStore
public PersistentDataStore(RouterContext ctx,
java.lang.String dbDir,
KademliaNetworkDatabaseFacade facade)
isInitialized
public boolean isInitialized()
- Specified by:
isInitialized
in interface DataStore
- Overrides:
isInitialized
in class TransientDataStore
stop
public void stop()
- Specified by:
stop
in interface DataStore
- Overrides:
stop
in class TransientDataStore
restart
public void restart()
- Specified by:
restart
in interface DataStore
- Overrides:
restart
in class TransientDataStore
rescan
public void rescan()
- Specified by:
rescan
in interface DataStore
- Overrides:
rescan
in class TransientDataStore
get
public DataStructure get(Hash key)
- Specified by:
get
in interface DataStore
- Overrides:
get
in class TransientDataStore
get
public DataStructure get(Hash key,
boolean persist)
- Prepare for having only a partial set in memory and the rest on disk
- Specified by:
get
in interface DataStore
- Overrides:
get
in class TransientDataStore
- Parameters:
persist
- if false, call super only, don't access disk
remove
public DataStructure remove(Hash key)
- Specified by:
remove
in interface DataStore
- Overrides:
remove
in class TransientDataStore
remove
public DataStructure remove(Hash key,
boolean persist)
- Description copied from class:
TransientDataStore
- for PersistentDataStore only - don't use here
- Specified by:
remove
in interface DataStore
- Overrides:
remove
in class TransientDataStore
put
public boolean put(Hash key,
DataStructure data)
- Specified by:
put
in interface DataStore
- Overrides:
put
in class TransientDataStore
data
- must be validated before here
- Returns:
- success
put
public boolean put(Hash key,
DataStructure data,
boolean persist)
- Description copied from class:
TransientDataStore
- for PersistentDataStore only - don't use here @throws IAE always
- Specified by:
put
in interface DataStore
- Overrides:
put
in class TransientDataStore