public class PersistentDataStore extends TransientDataStore
| Modifier and Type | Field and Description |
|---|---|
(package private) static String |
DIR_PREFIX |
static FileFilter |
RI_FILTER |
_context, _log| Constructor and Description |
|---|
PersistentDataStore(RouterContext ctx,
String dbDir,
KademliaNetworkDatabaseFacade facade) |
| Modifier and Type | Method and Description |
|---|---|
net.i2p.data.DatabaseEntry |
get(net.i2p.data.Hash key) |
net.i2p.data.DatabaseEntry |
get(net.i2p.data.Hash key,
boolean persist)
Prepare for having only a partial set in memory and the rest on disk
|
static File |
getRouterInfoFile(RouterContext ctx,
net.i2p.data.Hash hash)
The persistent RI file for a hash.
|
(package private) static net.i2p.data.Hash |
getRouterInfoHash(String filename)
Package private for installer BundleRouterInfos
|
boolean |
isInitialized() |
boolean |
put(net.i2p.data.Hash key,
net.i2p.data.DatabaseEntry data) |
boolean |
put(net.i2p.data.Hash key,
net.i2p.data.DatabaseEntry data,
boolean persist)
for PersistentDataStore only - don't use here
|
net.i2p.data.DatabaseEntry |
remove(net.i2p.data.Hash key) |
net.i2p.data.DatabaseEntry |
remove(net.i2p.data.Hash key,
boolean persist)
for PersistentDataStore only - don't use here
|
void |
rescan() |
void |
restart() |
void |
stop() |
countLeaseSets, getEntries, getKeys, getMapEntries, isKnown, size, toStringstatic final String DIR_PREFIX
public static final FileFilter RI_FILTER
public PersistentDataStore(RouterContext ctx, String dbDir, KademliaNetworkDatabaseFacade facade) throws IOException
dbDir - relative pathIOExceptionpublic boolean isInitialized()
isInitialized in interface DataStoreisInitialized in class TransientDataStorepublic void stop()
stop in interface DataStorestop in class TransientDataStorepublic void restart()
restart in interface DataStorerestart in class TransientDataStorepublic void rescan()
rescan in interface DataStorerescan in class TransientDataStorepublic net.i2p.data.DatabaseEntry get(net.i2p.data.Hash key)
get in interface DataStoreget in class TransientDataStorepublic net.i2p.data.DatabaseEntry get(net.i2p.data.Hash key,
boolean persist)
get in interface DataStoreget in class TransientDataStorepersist - if false, call super only, don't access diskpublic net.i2p.data.DatabaseEntry remove(net.i2p.data.Hash key)
remove in interface DataStoreremove in class TransientDataStorepublic net.i2p.data.DatabaseEntry remove(net.i2p.data.Hash key,
boolean persist)
TransientDataStoreremove in interface DataStoreremove in class TransientDataStorepublic boolean put(net.i2p.data.Hash key,
net.i2p.data.DatabaseEntry data)
put in interface DataStoreput in class TransientDataStoredata - must be validated before herepublic boolean put(net.i2p.data.Hash key,
net.i2p.data.DatabaseEntry data,
boolean persist)
TransientDataStoreput in interface DataStoreput in class TransientDataStorepublic static File getRouterInfoFile(RouterContext ctx, net.i2p.data.Hash hash)
static net.i2p.data.Hash getRouterInfoHash(String filename)