Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- deactivated all write buffers - fixed a storage bug

orbiter1751a799ac44
diff --git a/build.properties b/build.properties
index 866551e7c..4f1c335e2 100644
--- a/build.properties
+++ b/build.properties
@@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4
# Release Configuration
-releaseVersion=0.484
+releaseVersion=0.485
releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}
diff --git a/source/de/anomic/kelondro/kelondroCache.java b/source/de/anomic/kelondro/kelondroCache.java
index e061748c1..7ccff890f 100644
--- a/source/de/anomic/kelondro/kelondroCache.java
+++ b/source/de/anomic/kelondro/kelondroCache.java
@@ -55,6 +55,7 @@ public class kelondroCache implements kelondroIndex {
private int hasnotHit, hasnotMiss, hasnotUnique, hasnotDouble, hasnotDelete, hasnotFlush;
public kelondroCache(kelondroIndex backupIndex, long buffersize, boolean read, boolean write) throws IOException {
+ assert write == false;
this.index = backupIndex;
this.keyrow = new kelondroRow(new kelondroColumn[]{index.row().column(index.primarykey())});
this.readHitCache = (read) ? new kelondroRowSet(index.row()) : null;
diff --git a/source/de/anomic/kelondro/kelondroDyn.java b/source/de/anomic/kelondro/kelondroDyn.java
index 233712549..730e4c071 100644
--- a/source/de/anomic/kelondro/kelondroDyn.java
+++ b/source/de/anomic/kelondro/kelondroDyn.java
@@ -81,7 +81,7 @@ public class kelondroDyn {
// creates or opens a dynamic tree
rowdef = new kelondroRow("byte[] key-" + (key + counterlen) + ", byte[] node-" + nodesize);
kelondroTree tree = new kelondroTree(file, buffersize / 2, preloadTime, rowdef, objectOrder, 1, 8);
- this.index = new kelondroCache(tree, buffersize / 2, true, true);
+ this.index = new kelondroCache(tree, buffersize / 2, true, false);
this.keylen = index.row().width(0) - counterlen;
this.reclen = index.row().width(1);
this.fillChar = fillChar;
diff --git a/source/de/anomic/kelondro/kelondroRow.java b/source/de/anomic/kelondro/kelondroRow.java
index 06a0830e8..5e4dc3624 100644
--- a/source/de/anomic/kelondro/kelondroRow.java
+++ b/source/de/anomic/kelondro/kelondroRow.java
@@ -252,11 +252,11 @@ public class kelondroRow {
private void setCol(int encoding, int offset, int length, byte[] cell) {
if (cell == null) {
- while (length-- >= 0) rowinstance[offset + length] = 0;
+ while (length-- > 0) rowinstance[offset + length] = 0;
} else {
if (cell.length < length) {
System.arraycopy(cell, 0, rowinstance, offset, cell.length);
- while (length-- >= cell.length) rowinstance[offset + length] = 0;
+ while (length-- > cell.length) rowinstance[offset + length] = 0;
} else {
System.arraycopy(cell, 0, rowinstance, offset, length);
}
diff --git a/source/de/anomic/kelondro/kelondroRowCollection.java b/source/de/anomic/kelondro/kelondroRowCollection.java
index 62e3fc005..a35d90e70 100644
--- a/source/de/anomic/kelondro/kelondroRowCollection.java
+++ b/source/de/anomic/kelondro/kelondroRowCollection.java
@@ -87,6 +87,10 @@ public class kelondroRowCollection {
kelondroRow.Entry exportedCollection = exportRow(chunkcachelength).newEntry(exportedCollectionRowinstance);
this.chunkcount = (int) exportedCollection.getColLong(exp_chunkcount);
assert (this.chunkcount <= chunkcachelength / rowdef.objectsize) : "chunkcount = " + this.chunkcount + ", chunkcachelength = " + chunkcachelength + ", rowdef.objectsize = " + rowdef.objectsize;
+ if ((this.chunkcount > chunkcachelength / rowdef.objectsize)) {
+ serverLog.logWarning("RowCollection", "corrected wrong chunkcount; chunkcount = " + this.chunkcount + ", chunkcachelength = " + chunkcachelength + ", rowdef.objectsize = " + rowdef.objectsize);
+ this.chunkcount = chunkcachelength / rowdef.objectsize; // patch problem
+ }
this.lastTimeRead = (exportedCollection.getColLong(exp_last_read) + 10957) * day;
this.lastTimeWrote = (exportedCollection.getColLong(exp_last_wrote) + 10957) * day;
String sortOrderKey = exportedCollection.getColString(exp_order_type, null);
diff --git a/source/de/anomic/plasma/plasmaCrawlNURL.java b/source/de/anomic/plasma/plasmaCrawlNURL.java
index 2af48b698..a3b88c45c 100644
--- a/source/de/anomic/plasma/plasmaCrawlNURL.java
+++ b/source/de/anomic/plasma/plasmaCrawlNURL.java
@@ -157,7 +157,7 @@ public class plasmaCrawlNURL extends indexURL {
String newCacheName = "urlNotice4.table";
cacheStacksPath.mkdirs();
try {
- urlIndexFile = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, bufferkb / 2 * 0x400, preloadTime, rowdef, kelondroBase64Order.enhancedCoder), bufferkb / 2 * 0x400, true, true);
+ urlIndexFile = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, bufferkb / 2 * 0x400, preloadTime, rowdef, kelondroBase64Order.enhancedCoder), bufferkb / 2 * 0x400, true, false);
} catch (IOException e) {
e.printStackTrace();
System.exit(-1);
diff --git a/source/de/anomic/plasma/plasmaCrawlStacker.java b/source/de/anomic/plasma/plasmaCrawlStacker.java
index 650425095..a4d3bebf1 100644
--- a/source/de/anomic/plasma/plasmaCrawlStacker.java
+++ b/source/de/anomic/plasma/plasmaCrawlStacker.java
@@ -688,7 +688,7 @@ public final class plasmaCrawlStacker {
String newCacheName = "urlPreNotice1.table";
cacheStacksPath.mkdirs();
try {
- this.urlEntryCache = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, bufferkb / 2 * 0x400, preloadTime, plasmaCrawlNURL.rowdef, kelondroBase64Order.enhancedCoder), bufferkb / 2 * 0x400, true, true);
+ this.urlEntryCache = new kelondroCache(new kelondroFlexTable(cacheStacksPath, newCacheName, bufferkb / 2 * 0x400, preloadTime, plasmaCrawlNURL.rowdef, kelondroBase64Order.enhancedCoder), bufferkb / 2 * 0x400, true, false);
} catch (IOException e) {
e.printStackTrace();
System.exit(-1);
diff --git a/source/de/anomic/yacy/yacyNewsDB.java b/source/de/anomic/yacy/yacyNewsDB.java
index d41ae2824..b9894e1e9 100644
--- a/source/de/anomic/yacy/yacyNewsDB.java
+++ b/source/de/anomic/yacy/yacyNewsDB.java
@@ -69,13 +69,13 @@ public class yacyNewsDB {
this.path = path;
this.bufferkb = bufferkb;
this.preloadTime = preloadTime;
- this.news = new kelondroCache(kelondroTree.open(path, bufferkb / 2 * 0x400, preloadTime, yacyNewsRecord.rowdef), bufferkb / 2 * 0x400, true, true);
+ this.news = new kelondroCache(kelondroTree.open(path, bufferkb / 2 * 0x400, preloadTime, yacyNewsRecord.rowdef), bufferkb / 2 * 0x400, true, false);
}
private void resetDB() throws IOException {
try {close();} catch (Exception e) {}
if (path.exists()) path.delete();
- this.news = new kelondroCache(kelondroTree.open(path, bufferkb / 2 * 0x400, preloadTime, yacyNewsRecord.rowdef), bufferkb / 2 * 0x400, true, true);
+ this.news = new kelondroCache(kelondroTree.open(path, bufferkb / 2 * 0x400, preloadTime, yacyNewsRecord.rowdef), bufferkb / 2 * 0x400, true, false);
}
public int cacheNodeChunkSize() {