Skip to content

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

- fixed dht selction problem: the seed tables used a wrong ordering - cleaned some code

orbiter139c59ebbd41
diff --git a/htroot/IndexImport_p.java b/htroot/IndexImport_p.java
index 36de0a4af..6d2c30950 100644
--- a/htroot/IndexImport_p.java
+++ b/htroot/IndexImport_p.java
@@ -48,7 +48,6 @@
//javac -classpath .:../Classes IndexControl_p.java
//if the shell's current path is HTROOT
-import java.io.File;
import java.io.PrintStream;
import java.util.Date;
import java.util.HashMap;
@@ -75,8 +74,8 @@ public final class IndexImport_p {
try {
// getting the import path
String importPlasmaPath = (String) post.get("importPlasmaPath");
- String importIndexPrimaryPath = (String) post.get("importIndexPrimaryPath");
- String importIndexSecondaryPath = (String) post.get("importIndexSecondaryPath");
+ //String importIndexPrimaryPath = (String) post.get("importIndexPrimaryPath");
+ //String importIndexSecondaryPath = (String) post.get("importIndexSecondaryPath");
String importType = (String) post.get("importType");
String cacheSizeStr = (String) post.get("cacheSize");
boolean startImport = true;
diff --git a/htroot/WatchCrawler_p.java b/htroot/WatchCrawler_p.java
index f65757403..b125c67fd 100644
--- a/htroot/WatchCrawler_p.java
+++ b/htroot/WatchCrawler_p.java
@@ -35,7 +35,6 @@ import java.util.Map;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-import de.anomic.data.SitemapParser;
import de.anomic.htmlFilter.htmlFilterContentScraper;
import de.anomic.htmlFilter.htmlFilterWriter;
import de.anomic.http.httpHeader;
diff --git a/source/de/anomic/data/SitemapParser.java b/source/de/anomic/data/SitemapParser.java
index dd1cfb57e..4ce1cca75 100644
--- a/source/de/anomic/data/SitemapParser.java
+++ b/source/de/anomic/data/SitemapParser.java
@@ -47,9 +47,7 @@ package de.anomic.data;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Date;
-import java.util.Locale;
import java.util.zip.GZIPInputStream;
import javax.xml.parsers.SAXParser;
diff --git a/source/de/anomic/data/blogBoard.java b/source/de/anomic/data/blogBoard.java
index 47c4140c8..7b9124368 100644
--- a/source/de/anomic/data/blogBoard.java
+++ b/source/de/anomic/data/blogBoard.java
@@ -69,6 +69,7 @@ import org.xml.sax.SAXException;
import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
public class blogBoard {
@@ -84,7 +85,7 @@ public class blogBoard {
public blogBoard(File actpath, long preloadTime) {
new File(actpath.getParent()).mkdir();
if (datbase == null) {
- datbase = new kelondroMapObjects(new kelondroDyn(actpath, true, true, preloadTime, keyLength, recordSize, '_', true, false, false), 500);
+ datbase = new kelondroMapObjects(new kelondroDyn(actpath, true, true, preloadTime, keyLength, recordSize, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 500);
}
}
diff --git a/source/de/anomic/data/blogBoardComments.java b/source/de/anomic/data/blogBoardComments.java
index 3bcb252fc..defcc7fb4 100644
--- a/source/de/anomic/data/blogBoardComments.java
+++ b/source/de/anomic/data/blogBoardComments.java
@@ -69,6 +69,7 @@ import org.xml.sax.SAXException;
import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
public class blogBoardComments {
@@ -84,7 +85,7 @@ public class blogBoardComments {
public blogBoardComments(File actpath, long preloadTime) {
new File(actpath.getParent()).mkdir();
if (datbase == null) {
- datbase = new kelondroMapObjects(new kelondroDyn(actpath, true, true, preloadTime, keyLength, recordSize, '_', false, false, false), 500);
+ datbase = new kelondroMapObjects(new kelondroDyn(actpath, true, true, preloadTime, keyLength, recordSize, '_', kelondroNaturalOrder.naturalOrder, false, false, false), 500);
}
}
diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java
index 7ef26e96b..11f6b57ed 100644
--- a/source/de/anomic/data/bookmarksDB.java
+++ b/source/de/anomic/data/bookmarksDB.java
@@ -77,6 +77,7 @@ import de.anomic.kelondro.kelondroCloneableIterator;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroException;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
import de.anomic.kelondro.kelondroObjects;
import de.anomic.kelondro.kelondroObjectsMapEntry;
import de.anomic.net.URL;
@@ -104,17 +105,17 @@ public class bookmarksDB {
bookmarkCache=new HashMap();
bookmarksFile.getParentFile().mkdirs();
//this.bookmarksTable = new kelondroMap(kelondroDyn.open(bookmarksFile, bufferkb * 1024, preloadTime, 12, 256, '_', true, false));
- this.bookmarksTable = new kelondroObjects(new kelondroDyn(bookmarksFile, true, true, preloadTime, 12, 256, '_', true, false, false), 1000);
+ this.bookmarksTable = new kelondroObjects(new kelondroDyn(bookmarksFile, true, true, preloadTime, 12, 256, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 1000);
// tags
tagsFile.getParentFile().mkdirs();
boolean tagsFileExisted = tagsFile.exists();
- this.tagsTable = new kelondroMapObjects(new kelondroDyn(tagsFile, true, true, preloadTime, 12, 256, '_', true, false, false), 500);
+ this.tagsTable = new kelondroMapObjects(new kelondroDyn(tagsFile, true, true, preloadTime, 12, 256, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 500);
if (!tagsFileExisted) rebuildTags();
// dates
boolean datesExisted = datesFile.exists();
- this.datesTable = new kelondroMapObjects(new kelondroDyn(datesFile, true, true, preloadTime, 20, 256, '_', true, false, false), 500);
+ this.datesTable = new kelondroMapObjects(new kelondroDyn(datesFile, true, true, preloadTime, 20, 256, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 500);
if (!datesExisted) rebuildDates();
}
diff --git a/source/de/anomic/data/messageBoard.java b/source/de/anomic/data/messageBoard.java
index 663e66a00..a4dabbc16 100644
--- a/source/de/anomic/data/messageBoard.java
+++ b/source/de/anomic/data/messageBoard.java
@@ -54,6 +54,7 @@ import java.util.TimeZone;
import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
public class messageBoard {
@@ -70,7 +71,7 @@ public class messageBoard {
public messageBoard(File path, long preloadTime) {
new File(path.getParent()).mkdir();
if (database == null) {
- database = new kelondroMapObjects(new kelondroDyn(path, true, true, preloadTime, categoryLength + dateFormat.length() + 2, recordSize, '_', true, false, false), 500);
+ database = new kelondroMapObjects(new kelondroDyn(path, true, true, preloadTime, categoryLength + dateFormat.length() + 2, recordSize, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 500);
}
sn = 0;
}
diff --git a/source/de/anomic/data/userDB.java b/source/de/anomic/data/userDB.java
index fe93c5778..def4a5769 100644
--- a/source/de/anomic/data/userDB.java
+++ b/source/de/anomic/data/userDB.java
@@ -60,6 +60,7 @@ import de.anomic.kelondro.kelondroCloneableIterator;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroException;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
import de.anomic.server.serverCodings;
public final class userDB {
@@ -77,7 +78,7 @@ public final class userDB {
this.userTableFile = userTableFile;
this.preloadTime = preloadTime;
userTableFile.getParentFile().mkdirs();
- this.userTable = new kelondroMapObjects(new kelondroDyn(userTableFile, true, true, preloadTime, 128, 256, '_', true, false, false), 10);
+ this.userTable = new kelondroMapObjects(new kelondroDyn(userTableFile, true, true, preloadTime, 128, 256, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 10);
}
void resetDatabase() {
@@ -85,7 +86,7 @@ public final class userDB {
if (userTable != null) userTable.close();
if (!(userTableFile.delete())) throw new RuntimeException("cannot delete user database");
userTableFile.getParentFile().mkdirs();
- userTable = new kelondroMapObjects(new kelondroDyn(userTableFile, true, true, preloadTime, 256, 512, '_', true, false, false), 10);
+ userTable = new kelondroMapObjects(new kelondroDyn(userTableFile, true, true, preloadTime, 256, 512, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 10);
}
public void close() {
diff --git a/source/de/anomic/data/wikiBoard.java b/source/de/anomic/data/wikiBoard.java
index 80e0215eb..b87357676 100644
--- a/source/de/anomic/data/wikiBoard.java
+++ b/source/de/anomic/data/wikiBoard.java
@@ -54,6 +54,7 @@ import java.util.TimeZone;
import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
public class wikiBoard {
@@ -71,11 +72,11 @@ public class wikiBoard {
public wikiBoard(File actpath, File bkppath, long preloadTime) {
new File(actpath.getParent()).mkdirs();
if (datbase == null) {
- datbase = new kelondroMapObjects(new kelondroDyn(actpath, true, true, preloadTime, keyLength, recordSize, '_', true, false, false), 500);
+ datbase = new kelondroMapObjects(new kelondroDyn(actpath, true, true, preloadTime, keyLength, recordSize, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 500);
}
new File(bkppath.getParent()).mkdirs();
if (bkpbase == null) {
- bkpbase = new kelondroMapObjects(new kelondroDyn(bkppath, true, true, preloadTime, keyLength + dateFormat.length(), recordSize, '_', true, false, false), 500);
+ bkpbase = new kelondroMapObjects(new kelondroDyn(bkppath, true, true, preloadTime, keyLength + dateFormat.length(), recordSize, '_', kelondroNaturalOrder.naturalOrder, true, false, false), 500);
}
}
diff --git a/source/de/anomic/kelondro/kelondroDyn.java b/source/de/anomic/kelondro/kelondroDyn.java
index f5d270e7b..0f004bff6 100644
--- a/source/de/anomic/kelondro/kelondroDyn.java
+++ b/source/de/anomic/kelondro/kelondroDyn.java
@@ -70,10 +70,6 @@ public class kelondroDyn {
private kelondroObjectBuffer buffer;
private kelondroRow rowdef;
- public kelondroDyn(File file, boolean useNodeCache, boolean useObjectCache, long preloadTime, int key, int nodesize, char fillChar, boolean usetree, boolean writebuffer, boolean resetOnFail) {
- this(file, useNodeCache, useObjectCache, preloadTime, key, nodesize, fillChar, new kelondroNaturalOrder(true), usetree, writebuffer, resetOnFail);
- }
-
public kelondroDyn(File file, boolean useNodeCache, boolean useObjectCache, long preloadTime, int key,
int nodesize, char fillChar, kelondroOrder objectOrder, boolean usetree, boolean writebuffer, boolean resetOnFail) {
// creates or opens a dynamic tree
@@ -473,7 +469,7 @@ public class kelondroDyn {
if (args.length == 1) {
// open a db and list keys
try {
- kelondroDyn kd = new kelondroDyn(new File(args[0]), true, true, 0, 4 ,100, '_', false, false, true);
+ kelondroDyn kd = new kelondroDyn(new File(args[0]), true, true, 0, 4 ,100, '_', kelondroNaturalOrder.naturalOrder, false, false, true);
System.out.println(kd.sizeDyn() + " elements in DB");
Iterator i = kd.dynKeys(true, false);
while (i.hasNext())
@@ -490,7 +486,7 @@ public class kelondroDyn {
File f = new File(args[3]);
kelondroDyn kd;
try {
- kd = new kelondroDyn(db, true, true, 0, 80, 200, '_', false, false, true);
+ kd = new kelondroDyn(db, true, true, 0, 80, 200, '_', kelondroNaturalOrder.naturalOrder, false, false, true);
if (writeFile)
kd.readFile(key, f);
else
diff --git a/source/de/anomic/kelondro/kelondroDynTree.java b/source/de/anomic/kelondro/kelondroDynTree.java
index 90a7cf0e6..2d782d5b3 100644
--- a/source/de/anomic/kelondro/kelondroDynTree.java
+++ b/source/de/anomic/kelondro/kelondroDynTree.java
@@ -77,7 +77,7 @@ public class kelondroDynTree {
this.cache = new Hashtable();
//this.cycleCache = Long.MIN_VALUE;
this.cycleBuffer = Long.MIN_VALUE;
- this.table = new kelondroDyn(file, true, true, preloadTime, keylength, nodesize, fillChar, true, false, resetOnFail);
+ this.table = new kelondroDyn(file, true, true, preloadTime, keylength, nodesize, fillChar, rowdef.objectOrder, true, false, resetOnFail);
this.treeRAHandles = new Hashtable();
}
diff --git a/source/de/anomic/kelondro/kelondroMapTable.java b/source/de/anomic/kelondro/kelondroMapTable.java
index 2629d50c6..0b609eb8f 100644
--- a/source/de/anomic/kelondro/kelondroMapTable.java
+++ b/source/de/anomic/kelondro/kelondroMapTable.java
@@ -62,19 +62,19 @@ public class kelondroMapTable {
}
public void declareMaps(
- String tablename, int keysize, int nodesize, int cacheslots,
+ String tablename, int keysize, kelondroOrder objectOrder, int nodesize, int cacheslots,
char fillChar, boolean resetOnFail) throws IOException {
- declareMaps(tablename, keysize, nodesize, cacheslots, null, null, null, fillChar, resetOnFail);
+ declareMaps(tablename, keysize, objectOrder, nodesize, cacheslots, null, null, null, fillChar, resetOnFail);
}
public void declareMaps(
- String tablename, int keysize, int nodesize, int cacheslots,
+ String tablename, int keysize, kelondroOrder objectOrder, int nodesize, int cacheslots,
String[] sortfields, String[] longaccfields, String[] doubleaccfields, char fillChar, boolean resetOnFail) throws IOException {
- declareMaps(tablename, keysize, nodesize, cacheslots, sortfields, longaccfields, doubleaccfields, fillChar, 0, resetOnFail);
+ declareMaps(tablename, keysize, objectOrder, nodesize, cacheslots, sortfields, longaccfields, doubleaccfields, fillChar, 0, resetOnFail);
}
public void declareMaps(
- String tablename, int keysize, int nodesize, int cacheslots,
+ String tablename, int keysize, kelondroOrder objectOrder, int nodesize, int cacheslots,
String[] sortfields, String[] longaccfields, String[] doubleaccfields, char fillChar,
long preloadTime, boolean resetOnFail) throws IOException {
if (mTables.containsKey(tablename)) throw new RuntimeException("kelondroTables.declareMap: table '" + tablename + "' declared twice.");
@@ -82,7 +82,7 @@ public class kelondroMapTable {
File tablefile = new File(tablesPath, "table." + tablename + ".mdb");
kelondroDyn dyn;
if (!(tablefile.exists())) tablefile.getParentFile().mkdirs();
- dyn = new kelondroDyn(tablefile, true, true, preloadTime, keysize, nodesize, fillChar, true, false, resetOnFail);
+ dyn = new kelondroDyn(tablefile, true, true, preloadTime, keysize, nodesize, fillChar, objectOrder, true, false, resetOnFail);
kelondroMapObjects map = new kelondroMapObjects(dyn, cacheslots, sortfields, longaccfields, doubleaccfields, null, null);
mTables.put(tablename, map);
}
diff --git a/source/de/anomic/kelondro/kelondroRow.java b/source/de/anomic/kelondro/kelondroRow.java
index e9e235afb..0ae7495bc 100644
--- a/source/de/anomic/kelondro/kelondroRow.java
+++ b/source/de/anomic/kelondro/kelondroRow.java
@@ -46,6 +46,7 @@ public class kelondroRow {
protected Map nickref = null; // a mapping from nicknames to Object[2]{kelondroColumn, Integer(colstart)}
public kelondroRow(kelondroColumn[] row, kelondroOrder objectOrder, int primaryKey) {
+ assert objectOrder != null;
this.row = row;
assert (objectOrder != null);
this.objectOrder = objectOrder;
diff --git a/source/de/anomic/kelondro/kelondroRowSet.java b/source/de/anomic/kelondro/kelondroRowSet.java
index 1b3db4e23..410db163c 100644
--- a/source/de/anomic/kelondro/kelondroRowSet.java
+++ b/source/de/anomic/kelondro/kelondroRowSet.java
@@ -38,26 +38,39 @@ public class kelondroRowSet extends kelondroRowCollection implements kelondroInd
private kelondroProfile profile;
- public kelondroRowSet(kelondroRow rowdef, int objectCount, byte[] cache, int sortBound) {
- super(rowdef, objectCount, cache, sortBound);
- this.profile = new kelondroProfile();
- }
-
public kelondroRowSet(kelondroRowSet rs) {
super(rs);
this.profile = rs.profile;
}
+ public kelondroRowSet(kelondroRow rowdef, int objectCount, byte[] cache, int sortBound) {
+ super(rowdef, objectCount, cache, sortBound);
+ assert rowdef.objectOrder != null;
+ this.profile = new kelondroProfile();
+ }
+
public kelondroRowSet(kelondroRow rowdef, int objectCount) {
super(rowdef, objectCount);
+ assert rowdef.objectOrder != null;
this.profile = new kelondroProfile();
}
public kelondroRowSet(kelondroRow rowdef, kelondroRow.Entry exportedCollectionRowEnvironment, int columnInEnvironment) {
super(rowdef, exportedCollectionRowEnvironment, columnInEnvironment);
+ assert rowdef.objectOrder != null;
this.profile = new kelondroProfile();
}
+ public void setOrdering(kelondroOrder newOrder, int newColumn) {
+ assert newOrder != null;
+ if ((rowdef.objectOrder == null) ||
+ (!(rowdef.objectOrder.signature().equals(newOrder.signature()))) ||
+ (newColumn != rowdef.primaryKey)) {
+ rowdef.setOrdering(newOrder, newColumn);
+ this.sortBound = 0;
+ }
+ }
+
public void reset() {
super.reset();
this.profile = new kelondroProfile();
@@ -121,15 +134,6 @@ public class kelondroRowSet extends kelondroRowCollection implements kelondroInd
public kelondroRow.Entry remove(byte[] a) {
return remove(a, 0, a.length);
}
-
- public void setOrdering(kelondroOrder newOrder, int newColumn) {
- if ((rowdef.objectOrder == null) ||
- (!(rowdef.objectOrder.signature().equals(newOrder.signature()))) ||
- (newColumn != rowdef.primaryKey)) {
- rowdef.setOrdering(newOrder, newColumn);
- this.sortBound = 0;
- }
- }
private int find(byte[] a, int astart, int alength) {
// returns the chunknumber; -1 if not found
@@ -231,8 +235,8 @@ public class kelondroRowSet extends kelondroRowCollection implements kelondroInd
if (first == null) {
p = 0;
} else {
- p = binaryPosition(first, 0, first.length);
- //System.out.println("binaryposition for key " + new String(firstKey) + " is " + p);
+ p = binaryPosition(first, 0, first.length); // check this to find bug in DHT selection enumeration
+ System.out.println("binaryposition for key " + new String(firstKey) + " is " + p);
}
}
diff --git a/source/de/anomic/plasma/dbImport/ImporterException.java b/source/de/anomic/plasma/dbImport/ImporterException.java
index 18597cee5..85e8f2dcb 100644
--- a/source/de/anomic/plasma/dbImport/ImporterException.java
+++ b/source/de/anomic/plasma/dbImport/ImporterException.java
@@ -1,7 +1,10 @@
package de.anomic.plasma.dbImport;
public class ImporterException extends Exception {
- public ImporterException(String message) {
+
+ private static final long serialVersionUID = 6070972210596234670L;
+
+ public ImporterException(String message) {
super(message);
}
diff --git a/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java b/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java
index 902f75c89..a825e63c1 100644
--- a/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java
+++ b/source/de/anomic/plasma/dbImport/plasmaCrawlNURLImporter.java
@@ -11,7 +11,6 @@ import de.anomic.plasma.plasmaCrawlEntry;
import de.anomic.plasma.plasmaCrawlNURL;
import de.anomic.plasma.plasmaCrawlProfile;
import de.anomic.plasma.plasmaSwitchboard;
-import de.anomic.plasma.plasmaWordIndex;
public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImporter {
@@ -19,14 +18,12 @@ public class plasmaCrawlNURLImporter extends AbstractImporter implements dbImpor
private HashSet importProfileHandleCache = new HashSet();
private plasmaCrawlProfile importProfileDB;
private plasmaCrawlNURL importNurlDB;
- private plasmaWordIndex wi;
private int importStartSize;
private int urlCount = 0;
private int profileCount = 0;
public plasmaCrawlNURLImporter(plasmaSwitchboard theSb) {
super("NURL",theSb);
- this.wi = this.sb.wordIndex;
}
public long getEstimatedTime() {
diff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/plasma/plasmaCrawlProfile.java
index 9cf600722..f80466d8b 100644
--- a/source/de/anomic/plasma/plasmaCrawlProfile.java
+++ b/source/de/anomic/plasma/plasmaCrawlProfile.java
@@ -53,6 +53,7 @@ import de.anomic.kelondro.kelondroCloneableIterator;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroException;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
import de.anomic.server.serverCodings;
public class plasmaCrawlProfile {
@@ -68,7 +69,7 @@ public class plasmaCrawlProfile {
this.profileTableFile = file;
this.preloadTime = preloadTime;
profileTableFile.getParentFile().mkdirs();
- kelondroDyn dyn = new kelondroDyn(profileTableFile, true, true, preloadTime, crawlProfileHandleLength, 2000, '#', true, false, true);
+ kelondroDyn dyn = new kelondroDyn(profileTableFile, true, true, preloadTime, crawlProfileHandleLength, 2000, '#', kelondroNaturalOrder.naturalOrder, true, false, true);
profileTable = new kelondroMapObjects(dyn, 500);
domsCache = new HashMap();
}
@@ -78,7 +79,7 @@ public class plasmaCrawlProfile {
if (profileTable != null) profileTable.close();
if (!(profileTableFile.delete())) throw new RuntimeException("cannot delete crawl profile database");
profileTableFile.getParentFile().mkdirs();
- kelondroDyn dyn = new kelondroDyn(profileTableFile, true, true, preloadTime, crawlProfileHandleLength, 2000, '#', true, false, true);
+ kelondroDyn dyn = new kelondroDyn(profileTableFile, true, true, preloadTime, crawlProfileHandleLength, 2000, '#', kelondroNaturalOrder.naturalOrder, true, false, true);
profileTable = new kelondroMapObjects(dyn, 500);
}
diff --git a/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java b/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java
index 2a8c7e34a..d2ca9d538 100644
--- a/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java
+++ b/source/de/anomic/plasma/plasmaCrawlRobotsTxt.java
@@ -58,6 +58,7 @@ import java.util.Map;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroException;
import de.anomic.kelondro.kelondroMapObjects;
+import de.anomic.kelondro.kelondroNaturalOrder;
public class plasmaCrawlRobotsTxt {
@@ -71,7 +72,7 @@ public class plasmaCrawlRobotsTxt {
this.robotsTableFile = robotsTableFile;
this.preloadTime = preloadTime;
robotsTableFile.getParentFile().mkdirs();
- robotsTable = new kelondroMapObjects(new kelondroDyn(robotsTableFile, true, true, preloadTime, 256, 512, '_', true, false, true), 100);
+ robotsTable = new kelondroMapObjects(new kelondroDyn(robotsTableFile, true, true, preloadTime, 256, 512, '_', kelondroNaturalOrder.naturalOrder, true, false, true), 100);
}
private void resetDatabase() {
@@ -79,7 +80,7 @@ public class plasmaCrawlRobotsTxt {
if (robotsTable != null) robotsTable.close();
if (!(robotsTableFile.delete())) throw new RuntimeException("cannot delete robots.txt database");
robotsTableFile.getParentFile().mkdirs();
- robotsTable = new kelondroMapObjects(new kelondroDyn(robotsTableFile, true, true, preloadTime, 256, 512, '_', true, false, true), 100);
+ robotsTable = new kelondroMapObjects(new kelondroDyn(robotsTableFile, true, true, preloadTime, 256, 512, '_', kelondroNaturalOrder.naturalOrder, true, false, true), 100);
}
public void close() {
diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java
index 2d8469c18..964099085 100644
--- a/source/de/anomic/plasma/plasmaHTCache.java
+++ b/source/de/anomic/plasma/plasmaHTCache.java
@@ -189,15 +189,15 @@ public final class plasmaHTCache {
private void resetResponseHeaderDB() {
if (this.responseHeaderDB != null) this.responseHeaderDB.close();
- File dbfile = new File(this.cachePath, "responseHeader.db");
+ File dbfile = new File(this.cachePath, "responseHeader1.db");
if (dbfile.exists()) dbfile.delete();
openResponseHeaderDB(0);
}
private void openResponseHeaderDB(long preloadTime) {
// open the response header database
- File dbfile = new File(this.cachePath, "responseHeader.db");
- this.responseHeaderDB = new kelondroMapObjects(new kelondroDyn(dbfile, true, true, preloadTime, yacySeedDB.commonHashLength, 150, '#', true, false, true), 500);
+ File dbfile = new File(this.cachePath, "responseHeader1.db");
+ this.responseHeaderDB = new kelondroMapObjects(new kelondroDyn(dbfile, true, true, preloadTime, yacySeedDB.commonHashLength, 150, '#', kelondroBase64Order.enhancedCoder, true, false, true), 500);
}
private void deleteOldHTCache(File directory) {
diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.java
index cdcb7339f..e78dbaaeb 100644
--- a/source/de/anomic/yacy/yacyCore.java
+++ b/source/de/anomic/yacy/yacyCore.java
@@ -197,9 +197,9 @@ public class yacyCore {
long memDHT_time = Long.parseLong(switchboard.getConfig("ramCacheDHT_time", "1000"));
seedDB = new yacySeedDB(
sb,
- new File(yacyDBPath, "seed0.new.db"),
- new File(yacyDBPath, "seed0.old.db"),
- new File(yacyDBPath, "seed0.pot.db"),
+ new File(yacyDBPath, "seed1.new.db"),
+ new File(yacyDBPath, "seed1.old.db"),
+ new File(yacyDBPath, "seed1.pot.db"),
memDHT_time);
// create or init news database
diff --git a/source/de/anomic/yacy/yacyDHTAction.java b/source/de/anomic/yacy/yacyDHTAction.java
index 5ff3d38da..7b1c20c4b 100644
--- a/source/de/anomic/yacy/yacyDHTAction.java
+++ b/source/de/anomic/yacy/yacyDHTAction.java
@@ -306,7 +306,7 @@ public class yacyDHTAction implements yacyPeerAction {
double avdist, firstdist, lastdist;
Enumeration e = this.getAcceptRemoteIndexSeeds(lastKey);
Hashtable peerFilter = new Hashtable();
- int maxloop = Math.min(30, yacyCore.seedDB.sizeConnected()); // to ensure termination
+ int maxloop = Math.min(100, yacyCore.seedDB.sizeConnected()); // to ensure termination
if (log != null) log.logInfo("Collecting DHT target peers for first_hash = " + firstKey + ", last_hash = " + lastKey);
while ((e.hasMoreElements()) && (seeds.size() < (primaryPeerCount + reservePeerCount)) && (maxloop-- > 0)) {
seed = (yacySeed) e.nextElement();
diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java
index 43c074f64..1545a01ba 100644
--- a/source/de/anomic/yacy/yacySeedDB.java
+++ b/source/de/anomic/yacy/yacySeedDB.java
@@ -197,11 +197,11 @@ public final class yacySeedDB {
initializeHandlerMethod = null;
}
try {
- return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
+ return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
} catch (Exception e) {
// try again
kelondroDyn.delete(seedDBFile, usetree);
- return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
+ return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, preloadTime / 3, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
}
}
diff --git a/source/yacy.java b/source/yacy.java
index 99fd8ae31..6d3d8dd6b 100644
--- a/source/yacy.java
+++ b/source/yacy.java
@@ -72,6 +72,7 @@ import de.anomic.http.httpdProxyHandler;
import de.anomic.index.indexContainer;
import de.anomic.index.indexRWIEntry;
import de.anomic.index.indexURLEntry;
+import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroMScoreCluster;
import de.anomic.kelondro.kelondroMapObjects;
@@ -1121,7 +1122,7 @@ public final class yacy {
String[] dbFileNames = {"seed.new.db","seed.old.db","seed.pot.db"};
for (int i=0; i < dbFileNames.length; i++) {
File dbFile = new File(yacyDBPath,dbFileNames[i]);
- kelondroMapObjects db = new kelondroMapObjects(new kelondroDyn(dbFile, true, true, 3000, yacySeedDB.commonHashLength, 480, '#', true, false, true), 500, yacySeedDB.sortFields, yacySeedDB.longaccFields, yacySeedDB.doubleaccFields, null, null);
+ kelondroMapObjects db = new kelondroMapObjects(new kelondroDyn(dbFile, true, true, 3000, yacySeedDB.commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, true, false, true), 500, yacySeedDB.sortFields, yacySeedDB.longaccFields, yacySeedDB.doubleaccFields, null, null);
kelondroMapObjects.mapIterator it;
it = db.maps(true, false);