some fixes to bring back lulabads peer..

see also: http://forum.yacy-websuche.de/viewtopic.php?p=4772#p4772

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

@ -153,7 +153,7 @@ public class kelondroCollectionIndex {
continue; continue;
} }
} }
serverLog.logFine("STARTUP", "STARTED INITIALIZATION OF NEW COLLECTION INDEX WITH " + initialSpace + " ENTRIES. THIS WILL TAKE SOME TIME"); serverLog.logFine("STARTUP", "STARTED INITIALIZATION OF NEW COLLECTION INDEX WITH " + initialSpace + " ENTRIES. THIS WILL TAKE SOME TIME. " + (serverMemory.available() / 1024 / 1024) + "MB AVAILABLE.");
kelondroRow indexRowdef = indexRow(keyLength, indexOrder); kelondroRow indexRowdef = indexRow(keyLength, indexOrder);
long necessaryRAM4fullTable = minimumRAM4Eco + (indexRowdef.objectsize + 4) * initialSpace * 3 / 2; long necessaryRAM4fullTable = minimumRAM4Eco + (indexRowdef.objectsize + 4) * initialSpace * 3 / 2;
long necessaryRAM4fullIndex = minimumRAM4Eco + (indexRowdef.primaryKeyLength + 4) * initialSpace * 3 / 2; long necessaryRAM4fullIndex = minimumRAM4Eco + (indexRowdef.primaryKeyLength + 4) * initialSpace * 3 / 2;

@ -76,7 +76,7 @@ public class kelondroEcoTable implements kelondroIndex {
for (int i = 0; i < cols.length; i++) { for (int i = 0; i < cols.length; i++) {
cols[i] = rowdef.column(i + 1); cols[i] = rowdef.column(i + 1);
} }
this.taildef = new kelondroRow(cols, kelondroNaturalOrder.naturalOrder, rowdef.primaryKeyIndex); this.taildef = new kelondroRow(cols, kelondroNaturalOrder.naturalOrder, -1);
// initialize table file // initialize table file
if (!tablefile.exists()) { if (!tablefile.exists()) {
@ -97,11 +97,12 @@ public class kelondroEcoTable implements kelondroIndex {
// initialize index and copy table // initialize index and copy table
int records = (int) Math.max(file.size(), initialSpace); int records = (int) Math.max(file.size(), initialSpace);
long neededRAM4table = 10 * 1024 * 1024 + records * (rowdef.objectsize + 4) * 3 / 2; long neededRAM4table = 200 * 1024 * 1024 + records * (rowdef.objectsize + 4) * 3 / 2;
table = ((neededRAM4table < maxarraylength) && table = ((neededRAM4table < maxarraylength) &&
((useTailCache == tailCacheForceUsage) || ((useTailCache == tailCacheForceUsage) ||
((useTailCache == tailCacheUsageAuto) && (serverMemory.request(neededRAM4table, true))))) ? ((useTailCache == tailCacheUsageAuto) && (serverMemory.request(neededRAM4table, false))))) ?
new kelondroRowSet(taildef, records) : null; new kelondroRowSet(taildef, records) : null;
System.out.println("*** DEBUG: available RAM: " + (serverMemory.available() / 1024 / 1024) + "MB, allocating space for " + records + " entries");
index = new kelondroBytesIntMap(rowdef.primaryKeyLength, rowdef.objectOrder, records); index = new kelondroBytesIntMap(rowdef.primaryKeyLength, rowdef.objectOrder, records);
System.out.println("*** DEBUG: EcoTable " + tablefile.toString() + " has table copy " + ((table == null) ? "DISABLED" : "ENABLED")); System.out.println("*** DEBUG: EcoTable " + tablefile.toString() + " has table copy " + ((table == null) ? "DISABLED" : "ENABLED"));

@ -48,6 +48,7 @@ public class kelondroRAMIndex implements kelondroIndex {
} }
public void reset(int initialspace) { public void reset(int initialspace) {
this.index0 = null; // first flush RAM to make room
this.index0 = new kelondroRowSet(rowdef, initialspace); this.index0 = new kelondroRowSet(rowdef, initialspace);
this.index1 = null; // to show that this is the initialization phase this.index1 = null; // to show that this is the initialization phase
} }

Loading…
Cancel
Save