This commit is contained in:
zzz
2013-05-07 13:49:31 +00:00
parent 67beebf859
commit dca5e9889a
2 changed files with 8 additions and 7 deletions

View File

@@ -42,7 +42,6 @@ import net.i2p.util.SecureFileOutputStream;
*
*/
class PersistentDataStore extends TransientDataStore {
private final Log _log;
private final File _dbDir;
private final KademliaNetworkDatabaseFacade _facade;
private final Writer _writer;
@@ -60,7 +59,6 @@ class PersistentDataStore extends TransientDataStore {
*/
public PersistentDataStore(RouterContext ctx, String dbDir, KademliaNetworkDatabaseFacade facade) throws IOException {
super(ctx);
_log = ctx.logManager().getLog(PersistentDataStore.class);
_flat = ctx.getBooleanProperty(PROP_FLAT);
_dbDir = getDbDir(dbDir);
_facade = facade;

View File

@@ -22,14 +22,17 @@ import net.i2p.data.RouterInfo;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
/**
* Stores in-memory only. See extension.
*/
class TransientDataStore implements DataStore {
private Log _log;
private ConcurrentHashMap<Hash, DatabaseEntry> _data;
protected RouterContext _context;
protected final Log _log;
private final ConcurrentHashMap<Hash, DatabaseEntry> _data;
protected final RouterContext _context;
public TransientDataStore(RouterContext ctx) {
_context = ctx;
_log = ctx.logManager().getLog(TransientDataStore.class);
_log = ctx.logManager().getLog(getClass());
_data = new ConcurrentHashMap(1024);
if (_log.shouldLog(Log.INFO))
_log.info("Data Store initialized");
@@ -191,7 +194,7 @@ class TransientDataStore implements DataStore {
public DatabaseEntry remove(Hash key) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Removing key " + key.toBase64());
_log.debug("Removing key " + key);
return _data.remove(key);
}
}