diff --git a/source/de/anomic/kelondro/kelondroCollectionIndex.java b/source/de/anomic/kelondro/kelondroCollectionIndex.java index 592beb839..d44a1570e 100644 --- a/source/de/anomic/kelondro/kelondroCollectionIndex.java +++ b/source/de/anomic/kelondro/kelondroCollectionIndex.java @@ -315,8 +315,18 @@ public class kelondroCollectionIndex { // read the row and define a collection kelondroRowSet collection = new kelondroRowSet(this.rowdef, arrayrow.getColBytes(1)); // FIXME: this does not yet work with different rowdef in case of several rowdef.objectsize() if (index.order().compare(arrayrow.getColBytes(0), indexrow.getColBytes(idx_col_key)) != 0) { - // check if we got the right row; this row is wrong - throw new kelondroException(arrayFile(this.path, this.filenameStub, this.loadfactor, chunksize, partitionnumber, serialnumber).toString(), "array contains wrong row '" + new String(arrayrow.getColBytes(0)) + "', expected is '" + new String(indexrow.getColBytes(idx_col_key)) + "'"); + // check if we got the right row; this row is wrong. Fix it: + index.remove(indexrow.getColBytes(idx_col_key)); // the wrong row cannot be fixed + // store the row number in the index; this may be a double-entry, but better than nothing + kelondroRow.Entry indexEntry = index.row().newEntry(); + indexEntry.setCol(idx_col_key, arrayrow.getColBytes(0)); + indexEntry.setColLongB256(idx_col_chunksize, this.rowdef.objectsize()); + indexEntry.setColLongB256(idx_col_chunkcount, collection.size()); + indexEntry.setColLongB256(idx_col_indexpos, (long) rownumber); + indexEntry.setColLongB256(idx_col_lastread, kelondroRowCollection.daysSince2000(System.currentTimeMillis())); + indexEntry.setColLongB256(idx_col_lastwrote, kelondroRowCollection.daysSince2000(System.currentTimeMillis())); + index.put(indexEntry); + throw new kelondroException(arrayFile(this.path, this.filenameStub, this.loadfactor, chunksize, partitionnumber, serialnumber).toString(), "array contains wrong row '" + new String(arrayrow.getColBytes(0)) + "', expected is '" + new String(indexrow.getColBytes(idx_col_key)) + "', the row has been fixed"); } int chunkcountInArray = collection.size(); if (chunkcountInArray != chunkcount) { diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index f29970ec3..9cd5b5d78 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -379,7 +379,12 @@ public final class plasmaWordIndex extends indexAbstractRI implements indexRI { } public int size() { - return java.lang.Math.max(assortmentCluster.size(), + if (useCollectionIndex) + return java.lang.Math.max(collections.size(), + java.lang.Math.max(assortmentCluster.size(), + java.lang.Math.max(backend.size(), ramCache.size()))); + else + return java.lang.Math.max(assortmentCluster.size(), java.lang.Math.max(backend.size(), ramCache.size())); } diff --git a/yacy.init b/yacy.init index 322d3ce7c..3150e6b64 100644 --- a/yacy.init +++ b/yacy.init @@ -484,7 +484,7 @@ xpstopw=true 80_indexing_busysleep=100 80_indexing_memprereq=2097152 82_crawlstack_idlesleep=5000 -82_crawlstack_busysleep=0 +82_crawlstack_busysleep=10 82_crawlstack_memprereq=1048576 90_cleanup_idlesleep=300000 90_cleanup_busysleep=300000