Commit ed221821 authored by amir.yosef's avatar amir.yosef

Update logging for Storage class

parent 550d8911
package storage; package storage;
import model.RdbFile;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
public class Storage { public class Storage {
private final int capacity = 10000; private final int capacity = 10000;
private static final Logger logger = Logger.getLogger(Storage.class.getName());
private final CachePolicy<String, String> storage; private final CachePolicy<String, String> storage;
private final Map<String, Long> timeToExpiration = new ConcurrentHashMap<>(capacity); private final Map<String, Long> timeToExpiration = new ConcurrentHashMap<>(capacity);
private final Map<String, Long> currentTimeForKey = new ConcurrentHashMap<>(capacity); private final Map<String, Long> currentTimeForKey = new ConcurrentHashMap<>(capacity);
...@@ -49,7 +49,7 @@ public class Storage { ...@@ -49,7 +49,7 @@ public class Storage {
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
long expirationTime = timeToExpiration.get(key); long expirationTime = timeToExpiration.get(key);
if (currentTime > expirationTime) { if (currentTime > expirationTime) {
System.out.println("Key expired: " + key); logger.info("Key expired: " + key);
return true; return true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment