mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
* added another auto-fix for collection index inconsitency check
* fixed words size computation for collection index git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2368 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
0bbbd129ef
commit
61b151b083
|
@ -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) {
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user