- tried to fix the '4217666-problem'

- removed more unused code

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4715 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 512f48e7d6
commit 2f629d20a7

@ -322,8 +322,8 @@ public class kelondroRowCollection {
assert (alength > 0);
assert (astart + alength <= a.length);
if (bugappearance(a, astart, alength)) {
System.out.println("*** DEBUG: patched wrong a = " + serverLog.arrayList(a, astart, alength));
return false; // TODO: this is temporary; remote peers may still submit bad entries
System.out.println("*** DEBUG warning: wrong a = " + serverLog.arrayList(a, astart, alength));
//return false; // TODO: this is temporary; remote peers may still submit bad entries
}
assert (!(bugappearance(a, astart, alength))) : "a = " + serverLog.arrayList(a, astart, alength);
int l = Math.min(rowdef.objectsize, Math.min(alength, a.length - astart));

@ -155,7 +155,7 @@ public class yacySeed {
public static final String NCOUNT = "NCount";
/** the number of links that the peer provides for remote crawls (ZURL's) */
public static final String RCOUNT = "RCount";
/** the number of words the peer has indexed (as it says) */
/** the number of different words the peer has indexed */
public static final String ICOUNT = "ICount";
/** the number of seeds that the peer has stored */
public static final String SCOUNT = "SCount";
@ -694,48 +694,7 @@ public class yacySeed {
final double toPos = dhtPosition(to);
return (fromPos <= toPos) ? (toPos - fromPos) : (1.0 - fromPos + toPos);
}
/*
private static String bestNewHash(yacySeedDB seedDB) {
if ((seedDB == null) || (seedDB.sizeConnected() <= 8)) {
// use random hash
return randomHash();
}
int tries = Math.max(1, Math.min(32, seedDB.sizeConnected() / 2));
String hash;
String bestHash = null;
double c, bestC = Double.MAX_VALUE;
double segmentSize = Math.min(0.9, 4.0 / seedDB.sizeConnected());
Iterator<yacySeed> i;
double d;
yacySeed s;
for (int t = 0; t < tries; t++) {
hash = randomHash();
i = seedDB.seedsConnected(true, true, hash, (float) 0.0);
c = 0.0;
while (i.hasNext()) {
s = i.next();
d = dhtDistance(hash, s.hash);
if (d > segmentSize) break;
c = c + 1.0/d;
}
System.out.println("BESTHASH " + hash + " = " + c);
if (c < bestC) {
bestC = c;
bestHash = hash;
System.out.println("BESTHASH " + hash + " is best now");
}
}
if (bestHash == null) return randomHash();
// at this point we know only the position of a peer sequence
double bestPosition = dhtPosition(bestHash) + (segmentSize / 2);
if (bestPosition > 1.0) bestPosition = bestPosition - 1.0;
bestHash = positionToHash(bestPosition);
System.out.println("BESTHASH finally is " + bestHash);
return bestHash;
}
*/
private static String bestGap(yacySeedDB seedDB) {
if ((seedDB == null) || (seedDB.sizeConnected() <= 2)) {
// use random hash

Loading…
Cancel
Save