added object cache miss-cache use for remove method

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2434 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 8f3f4ab0eb
commit 1591a55963

@ -635,6 +635,12 @@ public class kelondroTree extends kelondroRecords implements kelondroIndex {
// Removes the mapping for this key from this map if present (optional operation). // Removes the mapping for this key from this map if present (optional operation).
public kelondroRow.Entry remove(byte[] key) throws IOException { public kelondroRow.Entry remove(byte[] key) throws IOException {
// check with miss cache of object cache
// if we know that the object does not exist, then we don't need to lookup in the file
if ((objectCache != null) && (objectCache.has(key) == -1)) return null;
// delete from database
synchronized(writeSearchObj) { synchronized(writeSearchObj) {
if (objectCache != null) objectCache.remove(key); if (objectCache != null) objectCache.remove(key);
writeSearchObj.process(key); writeSearchObj.process(key);
@ -644,6 +650,7 @@ public class kelondroTree extends kelondroRecords implements kelondroIndex {
remove(result, writeSearchObj.getParent()); remove(result, writeSearchObj.getParent());
return values; return values;
} else { } else {
if (objectCache != null) objectCache.hasnot(key);
return null; return null;
} }
} }

Loading…
Cancel
Save