- fix for wrong DHT ordering in DHT selection

- fix for http://www.yacy-forum.de/viewtopic.php?t=3112&highlight=

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2995 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 75915502ec
commit 49a83f99d9

@ -140,7 +140,7 @@ public class yacysearch {
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
final boolean indexDistributeGranted = sb.getConfig("allowDistributeIndex", "true").equals("true");
final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true");
//if (!indexDistributeGranted || !indexReceiveGranted) { global = false; }
if (!indexDistributeGranted || !indexReceiveGranted) { global = false; }
final long searchtime = 1000 * Long.parseLong(post.get("time", "10"));
String urlmask = "";
if (post.containsKey("urlmask") && post.get("urlmask").equals("no")) {

@ -229,6 +229,10 @@ public class plasmaDHTChunk {
// iterate over indexes to fetch url entries and store them in the urlCache
while ((urlIter.hasNext()) && (maxcount > refcount) && (System.currentTimeMillis() < timeout)) {
iEntry = (indexRWIEntry) urlIter.next();
if ((iEntry == null) || (iEntry.urlHash() == null)) {
urlIter.remove();
continue;
}
lurl = lurls.load(iEntry.urlHash(), iEntry);
if ((lurl == null) || (lurl.comp().url() == null)) {
//yacyCore.log.logFine("DEBUG selectTransferContainersResource: not-bound url hash '" + iEntry.urlHash() + "' for word hash " + container.getWordHash());

@ -49,7 +49,6 @@ import de.anomic.index.indexURLEntry;
import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroException;
import de.anomic.kelondro.kelondroMergeIterator;
import de.anomic.kelondro.kelondroNaturalOrder;
import de.anomic.kelondro.kelondroOrder;
import de.anomic.kelondro.kelondroRow;
import de.anomic.net.URL;
@ -65,7 +64,7 @@ public final class plasmaWordIndex implements indexRI {
private static final kelondroRow payloadrownew = indexRWIEntryNew.urlEntryRow;
private final File oldDatabaseRoot;
private final kelondroOrder indexOrder = new kelondroNaturalOrder(true);
private final kelondroOrder indexOrder = kelondroBase64Order.enhancedCoder;
private final indexRAMRI dhtOutCache, dhtInCache;
private final indexCollectionRI collections; // new database structure to replace AssortmentCluster and FileCluster
private int assortmentBufferSize; // kb
@ -618,6 +617,8 @@ public final class plasmaWordIndex implements indexRI {
}
private Iterator wordContainers(String startWordHash, int resourceLevel) throws IOException {
kelondroOrder containerOrder = new indexContainerOrder((kelondroOrder) indexOrder.clone());
containerOrder.rotate(startWordHash.getBytes());
if (resourceLevel == plasmaWordIndex.RL_RAMCACHE) {
return dhtOutCache.wordContainers(startWordHash, false);
}
@ -625,7 +626,7 @@ public final class plasmaWordIndex implements indexRI {
return new kelondroMergeIterator(
dhtOutCache.wordContainers(startWordHash, false),
collections.wordContainers(startWordHash, false),
new indexContainerOrder(kelondroNaturalOrder.naturalOrder),
containerOrder,
indexContainer.containerMergeMethod,
true);
} else {
@ -633,7 +634,7 @@ public final class plasmaWordIndex implements indexRI {
return new kelondroMergeIterator(
dhtOutCache.wordContainers(startWordHash, false),
(assortmentCluster == null) ? null : assortmentCluster.wordContainers(startWordHash, true, false),
new indexContainerOrder(kelondroNaturalOrder.naturalOrder),
containerOrder,
indexContainer.containerMergeMethod,
true);
}
@ -642,11 +643,11 @@ public final class plasmaWordIndex implements indexRI {
new kelondroMergeIterator(
dhtOutCache.wordContainers(startWordHash, false),
(assortmentCluster == null) ? null : assortmentCluster.wordContainers(startWordHash, true, false),
new indexContainerOrder(kelondroNaturalOrder.naturalOrder),
containerOrder,
indexContainer.containerMergeMethod,
true),
backend.wordContainers(startWordHash, false),
new indexContainerOrder(kelondroNaturalOrder.naturalOrder),
containerOrder,
indexContainer.containerMergeMethod,
true);
}

Loading…
Cancel
Save