Removing unnecessary and possibly dangerous synchronization of the wordIndex

when deleting transferred indexes



git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2058 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hermens 19 years ago
parent 799c04091d
commit 0cfba8950f

@ -261,20 +261,18 @@ public class plasmaDHTChunk {
plasmaWordIndexEntry indexEntry;
String[] urlHashes;
int count = 0;
synchronized (wordIndex) {
for (int i = 0; i < this.indexContainers.length; i++) {
// delete entries separately
int c = 0;
urlHashes = new String[this.indexContainers[i].size()];
urlIter = this.indexContainers[i].entries();
while (urlIter.hasNext()) {
indexEntry = (plasmaWordIndexEntry) urlIter.next();
urlHashes[c++] = indexEntry.getUrlHash();
}
count += wordIndex.removeEntries(this.indexContainers[i].wordHash(), urlHashes, true);
log.logFine("Deleted partial index (" + c + " URLs) for word " + this.indexContainers[i].wordHash() + "; " + this.wordIndex.indexSize(indexContainers[i].wordHash()) + " entries left");
this.indexContainers[i] = null;
for (int i = 0; i < this.indexContainers.length; i++) {
// delete entries separately
int c = 0;
urlHashes = new String[this.indexContainers[i].size()];
urlIter = this.indexContainers[i].entries();
while (urlIter.hasNext()) {
indexEntry = (plasmaWordIndexEntry) urlIter.next();
urlHashes[c++] = indexEntry.getUrlHash();
}
count += wordIndex.removeEntries(this.indexContainers[i].wordHash(), urlHashes, true);
log.logFine("Deleted partial index (" + c + " URLs) for word " + this.indexContainers[i].wordHash() + "; " + this.wordIndex.indexSize(indexContainers[i].wordHash()) + " entries left");
this.indexContainers[i] = null;
}
return count;
}

Loading…
Cancel
Save