Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
renamed new index class to old name
orbiter9183d21f2586
diff --git a/htroot/yacy/transferRWI.java b/htroot/yacy/transferRWI.javaindex 126628761..273e23873 100644--- a/htroot/yacy/transferRWI.java+++ b/htroot/yacy/transferRWI.java@@ -52,7 +52,7 @@ import java.util.LinkedList;import de.anomic.http.httpHeader;import de.anomic.index.indexEntry;-import de.anomic.index.indexURLEntryNew;+import de.anomic.index.indexURLEntry;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverCore;import de.anomic.server.serverObjects;@@ -146,7 +146,7 @@ public final class transferRWI {if (p > 0) {wordHash = estring.substring(0, p);wordhashes[received] = wordHash;- iEntry = new indexURLEntryNew(estring.substring(p));+ iEntry = new indexURLEntry(estring.substring(p));sb.wordIndex.addEntry(wordHash, iEntry, System.currentTimeMillis(), true);serverCore.checkInterruption();diff --git a/source/de/anomic/index/indexRAMCacheRI.java b/source/de/anomic/index/indexRAMCacheRI.javaindex 8f5532566..1a7c9b37a 100644--- a/source/de/anomic/index/indexRAMCacheRI.java+++ b/source/de/anomic/index/indexRAMCacheRI.java@@ -193,7 +193,7 @@ public final class indexRAMCacheRI extends indexAbstractRI implements indexRI {if ((row == null) || (row.empty(0)) || (row.empty(3)) || (row.empty(4))) continue;wordHash = row.getColString(0, "UTF-8");//creationTime = kelondroRecords.bytes2long(row[2]);- wordEntry = new indexURLEntryNew(row.getColString(3, null), row.getColString(4, null));+ wordEntry = new indexURLEntry(row.getColString(3, null), row.getColString(4, null));// store to cacheaddEntry(wordHash, wordEntry, startTime, false);urlCount++;diff --git a/source/de/anomic/index/indexRowSetContainer.java b/source/de/anomic/index/indexRowSetContainer.javaindex eb1eba4a7..c66ada562 100644--- a/source/de/anomic/index/indexRowSetContainer.java+++ b/source/de/anomic/index/indexRowSetContainer.java@@ -97,7 +97,7 @@ public class indexRowSetContainer extends kelondroRowSet implements indexContainprivate boolean addi(indexEntry entry) {// returns true if the new entry was added, false if it already existed- indexEntry oldEntry = new indexURLEntryNew(this.put(entry.toKelondroEntry())); // FIXME: see if cloning is necessary+ indexEntry oldEntry = new indexURLEntry(this.put(entry.toKelondroEntry())); // FIXME: see if cloning is necessaryif ((oldEntry != null) && (entry.isOlder(oldEntry))) { // A more recent Entry is already in this containerthis.put(oldEntry.toKelondroEntry()); // put it backreturn false;diff --git a/source/de/anomic/index/indexURLEntryNew.java b/source/de/anomic/index/indexURLEntry.javasimilarity index 95%rename from source/de/anomic/index/indexURLEntryNew.javarename to source/de/anomic/index/indexURLEntry.javaindex b16128ec7..6ef6c63e8 100644--- a/source/de/anomic/index/indexURLEntryNew.java+++ b/source/de/anomic/index/indexURLEntry.java@@ -32,7 +32,7 @@ import de.anomic.kelondro.kelondroRow;import de.anomic.kelondro.kelondroRow.Entry;import de.anomic.plasma.plasmaWordIndex;-public class indexURLEntryNew implements Cloneable, indexEntry {+public class indexURLEntry implements Cloneable, indexEntry {public static kelondroRow urlEntryRow = new kelondroRow(new kelondroColumn[]{new kelondroColumn("h", kelondroColumn.celltype_string, kelondroColumn.encoder_bytes, indexURL.urlHashLength, "urlhash"),@@ -67,7 +67,7 @@ public class indexURLEntryNew implements Cloneable, indexEntry {private kelondroRow.Entry entry;- public indexURLEntryNew(String urlHash,+ public indexURLEntry(String urlHash,int urlLength, // byte-length of complete URLint urlComps, // number of path componentsint titleLength, // length of description/length (longer are better?)@@ -110,20 +110,20 @@ public class indexURLEntryNew implements Cloneable, indexEntry {this.entry.setColLong(col_phrasecount, phrasecount);}- public indexURLEntryNew(String urlHash, String code) {+ public indexURLEntry(String urlHash, String code) {// the code is the external form of the row minus the leading urlHash entrythis.entry = urlEntryRow.newEntry((urlHash + code).getBytes());}- public indexURLEntryNew(String external) {+ public indexURLEntry(String external) {this.entry = urlEntryRow.newEntry(external);}- public indexURLEntryNew(byte[] row) {+ public indexURLEntry(byte[] row) {this.entry = urlEntryRow.newEntry(row);}- public indexURLEntryNew(kelondroRow.Entry rentry) {+ public indexURLEntry(kelondroRow.Entry rentry) {// FIXME: see if cloning is necessarythis.entry = rentry;}@@ -131,7 +131,7 @@ public class indexURLEntryNew implements Cloneable, indexEntry {public Object clone() {byte[] b = new byte[urlEntryRow.objectsize()];System.arraycopy(entry.bytes(), 0, b, 0, urlEntryRow.objectsize());- return new indexURLEntryNew(b);+ return new indexURLEntry(b);}public static int encodedByteArrayFormLength(boolean includingHeader) {@@ -206,7 +206,7 @@ public class indexURLEntryNew implements Cloneable, indexEntry {return this.entry.getColByte(col_localflag) == indexEntryAttribute.LT_LOCAL;}- public static indexURLEntryNew combineDistance(indexURLEntryNew ie1, indexEntry ie2) {+ public static indexURLEntry combineDistance(indexURLEntry ie1, indexEntry ie2) {// returns a modified entry of the first argumentie1.entry.setColLong(col_worddistance, ie1.worddistance() + ie2.worddistance() + Math.abs(ie1.posintext() - ie2.posintext()));ie1.entry.setColLong(col_posintext, Math.min(ie1.posintext(), ie2.posintext()));@@ -224,7 +224,7 @@ public class indexURLEntryNew implements Cloneable, indexEntry {return (int) this.entry.getColLong(col_worddistance);}- public static final void min(indexURLEntryNew t, indexEntry other) {+ public static final void min(indexURLEntry t, indexEntry other) {if (t.hitcount() > other.hitcount()) t.entry.setColLong(col_hitcount, other.hitcount());if (t.wordcount() > other.wordcount()) t.entry.setColLong(col_wordcount, other.wordcount());if (t.phrasecount() > other.phrasecount()) t.entry.setColLong(col_phrasecount, other.phrasecount());@@ -236,7 +236,7 @@ public class indexURLEntryNew implements Cloneable, indexEntry {if (t.quality() > other.quality()) t.entry.setColLong(col_quality, other.quality());}- public static final void max(indexURLEntryNew t, indexEntry other) {+ public static final void max(indexURLEntry t, indexEntry other) {if (t.hitcount() < other.hitcount()) t.entry.setColLong(col_hitcount, other.hitcount());if (t.wordcount() < other.wordcount()) t.entry.setColLong(col_wordcount, other.wordcount());if (t.phrasecount() < other.phrasecount()) t.entry.setColLong(col_phrasecount, other.phrasecount());@@ -257,7 +257,7 @@ public class indexURLEntryNew implements Cloneable, indexEntry {max(this, other);}- static void normalize(indexURLEntryNew t, indexEntry min, indexEntry max) {+ static void normalize(indexURLEntry t, indexEntry min, indexEntry max) {t.entry.setColLong(col_hitcount , (t.hitcount() == 0) ? 0 : 1 + 255 * (t.hitcount() - min.hitcount() ) / (1 + max.hitcount() - min.hitcount()));t.entry.setColLong(col_wordcount , (t.wordcount() == 0) ? 0 : 1 + 255 * (t.wordcount() - min.wordcount() ) / (1 + max.wordcount() - min.wordcount()));t.entry.setColLong(col_phrasecount , (t.phrasecount() == 0) ? 0 : 1 + 255 * (t.phrasecount() - min.phrasecount() ) / (1 + max.phrasecount() - min.phrasecount()));@@ -274,7 +274,7 @@ public class indexURLEntryNew implements Cloneable, indexEntry {}public indexEntry generateNormalized(indexEntry min, indexEntry max) {- indexURLEntryNew e = (indexURLEntryNew) this.clone();+ indexURLEntry e = (indexURLEntry) this.clone();e.normalize(min, max);return e;}diff --git a/source/de/anomic/plasma/plasmaCrawlLURL.java b/source/de/anomic/plasma/plasmaCrawlLURL.javaindex 7dce6bb96..72e48ee9f 100644--- a/source/de/anomic/plasma/plasmaCrawlLURL.java+++ b/source/de/anomic/plasma/plasmaCrawlLURL.java@@ -68,7 +68,7 @@ import de.anomic.http.httpc;import de.anomic.http.httpc.response;import de.anomic.index.indexEntry;import de.anomic.index.indexURL;-import de.anomic.index.indexURLEntryNew;+import de.anomic.index.indexURLEntry;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroTree;import de.anomic.kelondro.kelondroRow;@@ -523,7 +523,7 @@ public final class plasmaCrawlLURL extends indexURL {this.wordCount = Integer.parseInt(prop.getProperty("wc", "0"));this.snippet = prop.getProperty("snippet", "");if (snippet.length() == 0) snippet = null; else snippet = crypt.simpleDecode(snippet, null);- this.word = (prop.containsKey("word")) ? new indexURLEntryNew(kelondroBase64Order.enhancedCoder.decodeString(prop.getProperty("word",""))) : null;+ this.word = (prop.containsKey("word")) ? new indexURLEntry(kelondroBase64Order.enhancedCoder.decodeString(prop.getProperty("word",""))) : null;this.stored = false;//}} catch (Exception e) {diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex 6bc52e517..4b4f6f2c8 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -134,7 +134,7 @@ import de.anomic.index.indexEntry;import de.anomic.index.indexEntryAttribute;import de.anomic.index.indexTreeMapContainer;import de.anomic.index.indexURL;-import de.anomic.index.indexURLEntryNew;+import de.anomic.index.indexURLEntry;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroException;import de.anomic.kelondro.kelondroMSetTools;@@ -1488,7 +1488,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements serwordStat = (plasmaCondenser.wordStatProp) wentry.getValue();String wordHash = indexEntryAttribute.word2hash(word);indexTreeMapContainer wordIdxContainer = new indexTreeMapContainer(wordHash);- indexEntry wordIdxEntry = new indexURLEntryNew(urlHash,+ indexEntry wordIdxEntry = new indexURLEntry(urlHash,urlLength, urlComps,wordStat.count,document.longTitle.length(),diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.javaindex ad6b55c9a..9dcf3dcbd 100644--- a/source/de/anomic/plasma/plasmaWordIndex.java+++ b/source/de/anomic/plasma/plasmaWordIndex.java@@ -67,7 +67,7 @@ import de.anomic.index.indexRI;import de.anomic.index.indexAbstractRI;import de.anomic.index.indexRowSetContainer;import de.anomic.index.indexTreeMapContainer;-import de.anomic.index.indexURLEntryNew;+import de.anomic.index.indexURLEntry;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.kelondro.kelondroException;import de.anomic.kelondro.kelondroMergeIterator;@@ -263,7 +263,7 @@ public final class plasmaWordIndex extends indexAbstractRI implements indexRI {wprop = (plasmaCondenser.wordStatProp) wentry.getValue();// if ((s.length() > 4) && (c > 1)) System.out.println("# " + s + ":" + c);wordHash = indexEntryAttribute.word2hash(word);- ientry = new indexURLEntryNew(urlHash,+ ientry = new indexURLEntry(urlHash,urlLength, urlComps, (document == null) ? urlLength : document.longTitle.length(),wprop.count,condenser.RESULT_SIMI_WORDS,diff --git a/source/de/anomic/plasma/plasmaWordIndexAssortment.java b/source/de/anomic/plasma/plasmaWordIndexAssortment.javaindex 35d892073..54417f13e 100644--- a/source/de/anomic/plasma/plasmaWordIndexAssortment.java+++ b/source/de/anomic/plasma/plasmaWordIndexAssortment.java@@ -60,7 +60,7 @@ import de.anomic.index.indexContainer;import de.anomic.index.indexEntry;import de.anomic.index.indexEntryAttribute;import de.anomic.index.indexTreeMapContainer;-import de.anomic.index.indexURLEntryNew;+import de.anomic.index.indexURLEntry;import de.anomic.kelondro.kelondroException;import de.anomic.kelondro.kelondroTree;import de.anomic.kelondro.kelondroRow;@@ -75,7 +75,7 @@ public final class plasmaWordIndexAssortment {4, // occurrence counter8, // timestamp of last accessindexEntryAttribute.urlHashLength, // corresponding URL hash- indexURLEntryNew.encodedByteArrayFormLength(false) // URL attributes+ indexURLEntry.encodedByteArrayFormLength(false) // URL attributes};// class variables@@ -250,7 +250,7 @@ public final class plasmaWordIndexAssortment {int al = assortmentCapacity(row.objectsize());for (int i = 0; i < al; i++) {container.add(- new indexEntry[] { new indexURLEntryNew(+ new indexEntry[] { new indexURLEntry(new String(row.getColBytes(3 + 2 * i)), new String(row.getColBytes(4 + 2 * i))) }, updateTime);}return container;diff --git a/source/de/anomic/plasma/plasmaWordIndexFile.java b/source/de/anomic/plasma/plasmaWordIndexFile.javaindex 0b102bc9c..b0dc284b2 100644--- a/source/de/anomic/plasma/plasmaWordIndexFile.java+++ b/source/de/anomic/plasma/plasmaWordIndexFile.java@@ -51,7 +51,7 @@ import java.util.Iterator;import de.anomic.index.indexContainer;import de.anomic.index.indexEntry;import de.anomic.index.indexURL;-import de.anomic.index.indexURLEntryNew;+import de.anomic.index.indexURLEntry;import de.anomic.kelondro.kelondroTree;import de.anomic.kelondro.kelondroException;import de.anomic.kelondro.kelondroRow;@@ -96,10 +96,10 @@ public final class plasmaWordIndexFile {kt = new kelondroTree(theLocation, cacheSize, 0, kelondroTree.defaultObjectCachePercent);} catch (IOException e) {theLocation.delete();- kt = new kelondroTree(theLocation, cacheSize, 0, kelondroTree.defaultObjectCachePercent, indexURL.urlHashLength, indexURLEntryNew.encodedByteArrayFormLength(false), false);+ kt = new kelondroTree(theLocation, cacheSize, 0, kelondroTree.defaultObjectCachePercent, indexURL.urlHashLength, indexURLEntry.encodedByteArrayFormLength(false), false);} else {// create new index file- kt = new kelondroTree(theLocation, cacheSize, 0, kelondroTree.defaultObjectCachePercent, indexURL.urlHashLength, indexURLEntryNew.encodedByteArrayFormLength(false), false);+ kt = new kelondroTree(theLocation, cacheSize, 0, kelondroTree.defaultObjectCachePercent, indexURL.urlHashLength, indexURLEntry.encodedByteArrayFormLength(false), false);}return kt; // everyone who get this should close it when finished!}@@ -141,7 +141,7 @@ public final class plasmaWordIndexFile {public indexEntry getEntry(String urlhash) throws IOException {kelondroRow.Entry n = theIndex.get(urlhash.getBytes());if (n == null) return null;- return new indexURLEntryNew(n.getColString(0, null), n.getColString(1, null));+ return new indexURLEntry(n.getColString(0, null), n.getColString(1, null));}public boolean contains(String urlhash) throws IOException {@@ -238,7 +238,7 @@ public final class plasmaWordIndexFile {public Object next() {if (i == null) return null;kelondroRow.Entry n = (kelondroRow.Entry) i.next();- return new indexURLEntryNew(n.getColString(0, null), n.getColString(1, null));+ return new indexURLEntry(n.getColString(0, null), n.getColString(1, null));}public void remove() {throw new UnsupportedOperationException();diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.javaindex d280522ba..a1ae3b8c9 100644--- a/source/de/anomic/yacy/yacyClient.java+++ b/source/de/anomic/yacy/yacyClient.java@@ -57,7 +57,7 @@ import de.anomic.index.indexContainer;import de.anomic.index.indexEntry;import de.anomic.index.indexEntryAttribute;import de.anomic.index.indexTreeMapContainer;-import de.anomic.index.indexURLEntryNew;+import de.anomic.index.indexURLEntry;import de.anomic.kelondro.kelondroBase64Order;import de.anomic.plasma.plasmaCrawlLURL;import de.anomic.plasma.plasmaSearchRankingProfile;@@ -488,7 +488,7 @@ public final class yacyClient {final indexEntry entry;if (urlEntry.word() == null) {// the old way to define words- entry = new indexURLEntryNew(+ entry = new indexURLEntry(urlEntry.hash(),urlLength, urlComps,urlEntry.descr().length(),