Author: orbiter Date: 2008-01-23 21:18:36 +0100 (Wed, 23 Jan 2008) New Revision: 4378
Modified: trunk/source/de/anomic/kelondro/kelondroFlexTable.java trunk/source/de/anomic/kelondro/kelondroRowSet.java Log: - fixed bad sort behavior of kelondroRowSet, in this case: no sort at all! see http://forum.yacy-websuche.de/viewtopic.php?p=4841#p4841 - some memory calculation enhancements in kelondroFlex and a little bit more logging Modified: trunk/source/de/anomic/kelondro/kelondroFlexTable.java =================================================================== --- trunk/source/de/anomic/kelondro/kelondroFlexTable.java 2008-01-23 19:02:57 UTC (rev 4377) +++ trunk/source/de/anomic/kelondro/kelondroFlexTable.java 2008-01-23 20:18:36 UTC (rev 4378) @@ -59,9 +59,9 @@ e2.printStackTrace(); throw new kelondroException(e2.getMessage()); } - + minimumSpace = Math.max(minimumSpace, super.size()); try { - long neededRAM = (long) ((super.row().column(0).cellwidth + 4) * Math.max(super.size(), minimumSpace) * kelondroRowCollection.growfactor); + long neededRAM = 10 * 1024 * 104 + (long) ((super.row().column(0).cellwidth + 4) * minimumSpace * kelondroRowCollection.growfactor); File newpath = new File(path, tablename); File indexfile = new File(newpath, "col.000.index"); @@ -72,7 +72,7 @@ System.out.println("*** Last Startup time: " + stt + " milliseconds"); long start = System.currentTimeMillis(); - if (serverMemory.request(neededRAM, true)) { + if (serverMemory.request(neededRAM, false)) { // we can use a RAM index if (indexfile.exists()) { // delete existing index file @@ -81,7 +81,7 @@ } // fill the index - System.out.print("*** Loading RAM index for " + size() + " entries from " + newpath); + System.out.print("*** Loading RAM index for " + size() + " entries from " + newpath + "; available RAM = " + (serverMemory.available() >> 20) + " MB, allocating " + (neededRAM >> 20) + " MB for index."); index = initializeRamIndex(minimumSpace); System.out.println(" -done-"); Modified: trunk/source/de/anomic/kelondro/kelondroRowSet.java =================================================================== --- trunk/source/de/anomic/kelondro/kelondroRowSet.java 2008-01-23 19:02:57 UTC (rev 4377) +++ trunk/source/de/anomic/kelondro/kelondroRowSet.java 2008-01-23 20:18:36 UTC (rev 4378) @@ -107,13 +107,13 @@ long handle = profile.startWrite(); int index = -1; kelondroRow.Entry oldentry = null; + // when reaching a specific amount of un-sorted entries, re-sort all + if ((this.chunkcount - this.sortBound) > collectionReSortLimit) { + sort(); + } index = find(entry.bytes(), (rowdef.primaryKeyIndex < 0) ? 0 :super.rowdef.colstart[rowdef.primaryKeyIndex], super.rowdef.primaryKeyLength); if (index < 0) { super.addUnique(entry); - // when reaching a specific amount of un-sorted entries, re-sort all - if ((this.chunkcount - this.sortBound) > collectionReSortLimit) { - sort(); - } } else { oldentry = get(index); set(index, entry); _______________________________________________ YaCy-svn mailing list [email protected] https://lists.berlios.de/mailman/listinfo/yacy-svn
