net.i2p.router.networkdb.kademlia
Class PersistentDataStore

java.lang.Object
  extended by net.i2p.router.networkdb.kademlia.TransientDataStore
      extended by 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.


Field Summary
 
Fields inherited from class net.i2p.router.networkdb.kademlia.TransientDataStore
_context
 
Constructor Summary
PersistentDataStore(RouterContext ctx, java.lang.String dbDir, KademliaNetworkDatabaseFacade facade)
           
 
Method Summary
 int countLeaseSets()
           
 void put(Hash key, DataStructure data)
           
 DataStructure remove(Hash key)
           
 void restart()
           
 
Methods inherited from class net.i2p.router.networkdb.kademlia.TransientDataStore
equals, get, getKeys, hashCode, isKnown, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentDataStore

public PersistentDataStore(RouterContext ctx,
                           java.lang.String dbDir,
                           KademliaNetworkDatabaseFacade facade)
Method Detail

restart

public void restart()
Specified by:
restart in interface DataStore
Overrides:
restart in class TransientDataStore

remove

public DataStructure remove(Hash key)
Specified by:
remove in interface DataStore
Overrides:
remove in class TransientDataStore

put

public void put(Hash key,
                DataStructure data)
Specified by:
put in interface DataStore
Overrides:
put in class TransientDataStore

countLeaseSets

public int countLeaseSets()
Specified by:
countLeaseSets in interface DataStore
Overrides:
countLeaseSets in class TransientDataStore