mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
In DHT selection delete only those references that were actually selected
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5693 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
60078cf322
commit
8c60d6d117
|
@ -28,6 +28,7 @@ package de.anomic.yacy.dht;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -188,7 +189,17 @@ public class Dispatcher {
|
||||||
containers.add(container);
|
containers.add(container);
|
||||||
}
|
}
|
||||||
// then remove the container from the backend
|
// then remove the container from the backend
|
||||||
for (ReferenceContainer c: containers) this.backend.deleteAllReferences(c.getWordHash());
|
HashSet<String> urlHashes = new HashSet<String>();
|
||||||
|
Iterator<ReferenceRow> it;
|
||||||
|
for (ReferenceContainer c: containers) {
|
||||||
|
urlHashes.clear();
|
||||||
|
it = c.entries();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
urlHashes.add(it.next().urlHash());
|
||||||
|
}
|
||||||
|
if (this.log.isFine()) this.log.logFine("selected " + urlHashes.size() + " urls for word '" + c.getWordHash() + "'");
|
||||||
|
if (urlHashes.size() > 0) this.backend.removeReferences(c.getWordHash(), urlHashes);
|
||||||
|
}
|
||||||
|
|
||||||
// finished. The caller must take care of the containers and must put them back if not needed
|
// finished. The caller must take care of the containers and must put them back if not needed
|
||||||
return containers;
|
return containers;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user