Skip to content

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

turned back NURL usage of kelondroTree, kelondroFlexTable has still problems with deleted entries

orbiterc26da4893b32
diff --git a/source/de/anomic/kelondro/kelondroRecords.java b/source/de/anomic/kelondro/kelondroRecords.java
index ff2595370..c6adccd56 100644
--- a/source/de/anomic/kelondro/kelondroRecords.java
+++ b/source/de/anomic/kelondro/kelondroRecords.java
@@ -176,6 +176,7 @@ public class kelondroRecords {
entryFile.writeInt(POS_USEDC, USEDC);
entryFile.writeInt(POS_FREEC, FREEC);
entryFile.writeInt(POS_FREEH, FREEH.index);
+ entryFile.commit();
}
}
@@ -777,6 +778,8 @@ public class kelondroRecords {
entryFile.write(seekpos(this.handle) + headchunksize, this.tailChunk);
this.tailChanged = false;
}
+
+ entryFile.commit();
}
public synchronized void collapse() {
diff --git a/source/de/anomic/plasma/plasmaCrawlNURL.java b/source/de/anomic/plasma/plasmaCrawlNURL.java
index 88c0e8d06..ed9cf404b 100644
--- a/source/de/anomic/plasma/plasmaCrawlNURL.java
+++ b/source/de/anomic/plasma/plasmaCrawlNURL.java
@@ -55,10 +55,10 @@ import java.util.Iterator;
import de.anomic.index.indexURL;
import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroException;
-import de.anomic.kelondro.kelondroFlexTable;
import de.anomic.kelondro.kelondroRecords;
import de.anomic.kelondro.kelondroStack;
import de.anomic.kelondro.kelondroRow;
+import de.anomic.kelondro.kelondroTree;
import de.anomic.server.logging.serverLog;
import de.anomic.tools.bitfield;
@@ -147,6 +147,7 @@ public class plasmaCrawlNURL extends indexURL {
}
private void openHashCache() {
+ /*
String newCacheName = "urlNotice3.table";
cacheStacksPath.mkdirs();
try {
@@ -155,22 +156,12 @@ public class plasmaCrawlNURL extends indexURL {
e.printStackTrace();
System.exit(-1);
}
- /*
+ */
+
File oldCacheFile = new File(cacheStacksPath, "urlNotice1.db");
- if (oldCacheFile.exists()) try {
- // open existing cache
- kelondroTree tree = new kelondroTree(oldCacheFile, bufferkb * 0x400, preloadTime, kelondroTree.defaultObjectCachePercent);
- tree.assignRowdef(rowdef);
- urlHashCache = tree;
- } catch (IOException e) {
- oldCacheFile.delete();
- urlHashCache = new kelondroTree(oldCacheFile, bufferkb * 0x400, preloadTime, kelondroTree.defaultObjectCachePercent, rowdef, true);
- } else {
- // create new cache
- oldCacheFile.getParentFile().mkdirs();
- urlHashCache = new kelondroTree(oldCacheFile, bufferkb * 0x400, preloadTime, kelondroTree.defaultObjectCachePercent, rowdef, true);
- }
- */
+ oldCacheFile.getParentFile().mkdirs();
+ urlHashCache = kelondroTree.open(oldCacheFile, bufferkb * 0x400, preloadTime, kelondroTree.defaultObjectCachePercent, rowdef);
+
}
private void resetHashCache() {
@@ -387,7 +378,9 @@ public class plasmaCrawlNURL extends indexURL {
private Entry pop(plasmaCrawlBalancer balancer) throws IOException {
// this is a filo - pop
if (balancer.size() > 0) {
- Entry e = new Entry(new String(balancer.get()));
+ String hash = new String(balancer.get());
+ if (hash == null) throw new IOException("hash is null");
+ Entry e = new Entry(hash);
stackIndex.remove(e.hash);
return e;
} else {
@@ -480,6 +473,7 @@ public class plasmaCrawlNURL extends indexURL {
// - look into the filed properties
// if the url cannot be found, this returns null
this.hash = hash;
+ if (hash == null) throw new IOException("hash is null");
kelondroRow.Entry entry = urlHashCache.get(hash.getBytes());
if (entry != null) {
insertEntry(entry);
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 2e838ce9a..891ef2057 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -988,7 +988,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
synchronized (sbQueue) {
if (sbQueue.size() == 0) {
- log.logFine("deQueue: nothing to do, queue is emtpy");
+ //log.logFine("deQueue: nothing to do, queue is emtpy");
return doneSomething; // nothing to do
}