Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
more fixes
orbiterdfb96ecb7234
diff --git a/htroot/yacy/hello.java b/htroot/yacy/hello.javaindex 2bcd87b67..e255d2386 100644--- a/htroot/yacy/hello.java+++ b/htroot/yacy/hello.java@@ -49,10 +49,11 @@ public final class hello {// example:// http://localhost:8080/yacy/hello.html?count=1&seed=p|{Hash=sCJ6Tq8T0N9x,IPType=∅,Port=8080,IP=,Uptime=8,rI=190,Version=0.10004882,PeerType=junior,UTC=+0200,RCount=0,sI=0,LastSeen=20080605103333,Name=intratest,CCount=5.0,SCount=40,news=,USpeed=0,CRTCnt=0,CRWCnt=0,BDate=20080605081349,rU=190,LCount=187,dct=1212668923654,ICount=2,sU=0,ISpeed=0,RSpeed=0.0,NCount=0,Flags=oooo}-+ // http://localhost:8080/yacy/hello.html?count=10&seed=z|H4sIAAAAAAAAADWQW2vDMAyF_81eJork3GyGX-YxGigly2WFvZTQijbQJsHx1pWx_z7nMj1J4ug7B_2s6-GsP5q3G-G6vBz2e0iz8t6zfuBr7-5PUNanQfulhqyzTkuUCFXvmitrBJtq4ed3tkPTtRpXhIiRDAmq0uhHFIiQMduJ-NXYU9NCbrrP1vnjIdUqgk09uIK51V6rMBRIilAo2NajwzfhGcx8QUKsEIp5iCJo-eaTVUXPfPQ4k5dm4pp8NzaESsLzS-14QVNIMlA-ka2m1JuZJJWIBRwPo0GIIiYp4zCSkC5GQSLiJIah0p6X_rvlS-MTbWdhkCSBIni9jA_rfP3-Ae1Oye9dAQAApublic static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) throws InterruptedException {final plasmaSwitchboard sb = (plasmaSwitchboard) env;final serverObjects prop = new serverObjects();+ long start = System.currentTimeMillis();prop.put("message", "none");if ((post == null) || (env == null)) {prop.put("message", "no post or no enviroment");@@ -217,6 +218,7 @@ public final class hello {prop.put("seedlist", seeds.toString());// return rewrite propertiesprop.put("message", "ok " + seed.length());+ yacyCore.log.logInfo("hello: responded remote peer '" + remoteSeed.getName() + "' [" + reportedip + "] in " + (System.currentTimeMillis() - start) + " milliseconds");return prop;}diff --git a/source/de/anomic/kelondro/index/RowSet.java b/source/de/anomic/kelondro/index/RowSet.javaindex 4d3f2ebb0..f505c1b96 100644--- a/source/de/anomic/kelondro/index/RowSet.java+++ b/source/de/anomic/kelondro/index/RowSet.java@@ -77,6 +77,7 @@ public class RowSet extends RowCollection implements ObjectIndex, Iterable<Row.E}public static RowSet importRowSet(byte[] b, final Row rowdef) {+ assert b.length >= 14 : "b.length = " + b.length;final int size = (int) NaturalOrder.decodeLong(b, 0, 4);final int orderbound = (int) NaturalOrder.decodeLong(b, 10, 4);final byte[] chunkcache = new byte[size * rowdef.objectsize];diff --git a/source/de/anomic/kelondro/text/ReferenceContainer.java b/source/de/anomic/kelondro/text/ReferenceContainer.javaindex fca5aee7b..6f7546d12 100644--- a/source/de/anomic/kelondro/text/ReferenceContainer.java+++ b/source/de/anomic/kelondro/text/ReferenceContainer.java@@ -54,14 +54,14 @@ public class ReferenceContainer<ReferenceType extends Reference> extends RowSetpublic ReferenceContainer(final ReferenceFactory<ReferenceType> factory, final byte[] termHash, final RowSet collection) {super(collection);- assert termHash == null || termHash[2] != '@';+ assert termHash == null || (termHash[2] != '@' && termHash.length == this.rowdef.primaryKeyLength);this.factory = factory;this.termHash = termHash;}public ReferenceContainer(final ReferenceFactory<ReferenceType> factory, final byte[] termHash, final Row rowdef, final int objectCount) {super(rowdef, objectCount);- assert termHash == null || termHash[2] != '@';+ assert termHash == null || (termHash[2] != '@' && termHash.length == this.rowdef.primaryKeyLength);this.termHash = termHash;this.factory = factory;this.lastTimeWrote = 0;@@ -74,12 +74,12 @@ public class ReferenceContainer<ReferenceType extends Reference> extends RowSet}public static <ReferenceType extends Reference> ReferenceContainer<ReferenceType> emptyContainer(final ReferenceFactory<ReferenceType> factory, final byte[] termHash, final int elementCount) {- assert termHash == null || termHash[2] != '@';+ assert termHash == null || (termHash[2] != '@' && termHash.length == WordReferenceRow.urlEntryRow.primaryKeyLength);return new ReferenceContainer<ReferenceType>(factory, termHash, WordReferenceRow.urlEntryRow, elementCount);}public void setWordHash(final byte[] newTermHash) {- assert termHash == null || termHash[2] != '@';+ assert termHash == null || (termHash[2] != '@' && termHash.length == this.rowdef.primaryKeyLength);this.termHash = newTermHash;}diff --git a/source/de/anomic/kelondro/text/ReferenceContainerCache.java b/source/de/anomic/kelondro/text/ReferenceContainerCache.javaindex 17cebfce6..d660ec65f 100644--- a/source/de/anomic/kelondro/text/ReferenceContainerCache.java+++ b/source/de/anomic/kelondro/text/ReferenceContainerCache.java@@ -320,7 +320,7 @@ public final class ReferenceContainerCache<ReferenceType extends Reference> extepublic heapCacheIterator(byte[] startWordHash, final boolean rot) {this.rot = rot;- if (startWordHash.length == 0) startWordHash = null;+ if (startWordHash != null && startWordHash.length == 0) startWordHash = null;this.iterator = (startWordHash == null) ? cache.values().iterator() : cache.tailMap(startWordHash).values().iterator();// The collection's iterator will return the values in the order that their corresponding keys appear in the tree.}diff --git a/source/de/anomic/yacy/dht/Dispatcher.java b/source/de/anomic/yacy/dht/Dispatcher.javaindex e46d4bfbe..2e340e55e 100755--- a/source/de/anomic/yacy/dht/Dispatcher.java+++ b/source/de/anomic/yacy/dht/Dispatcher.java@@ -266,7 +266,8 @@ public class Dispatcher {// the 'new' primary target is the word hash of the last containerlastContainer = containers[vertical].get(containers[vertical].size() - 1);primaryTarget = FlatWordPartitionScheme.positionToHash(this.seeds.scheme.dhtPosition(lastContainer.getTermHash(), vertical));-+ assert primaryTarget[2] != '@';+// get or make a entry objectentry = this.transmissionCloud.get(primaryTarget); // if this is not null, the entry is extended hereArrayList<yacySeed> targets = PeerSelection.getAcceptRemoteIndexSeedsList(@@ -274,7 +275,7 @@ public class Dispatcher {primaryTarget,seeds.redundancy() * 3,true);- this.log.logInfo("enqueueContainers: selected " + targets.size() + " targets for primary target key " + primaryTarget + "/" + vertical + " with " + containers[vertical].size() + " index containers.");+ this.log.logInfo("enqueueContainers: selected " + targets.size() + " targets for primary target key " + new String(primaryTarget) + "/" + vertical + " with " + containers[vertical].size() + " index containers.");if (entry == null) entry = transmission.newChunk(primaryTarget, targets, lastContainer.row());// fill the entry with the containers@@ -353,11 +354,11 @@ public class Dispatcher {if (success && chunk.isFinished()) {// finished with this queue!- this.log.logInfo("STORE: Chunk " + chunk.primaryTarget() + " has FINISHED all transmissions!");+ this.log.logInfo("STORE: Chunk " + new String(chunk.primaryTarget()) + " has FINISHED all transmissions!");return chunk;}- this.log.logInfo("STORE: Chunk " + chunk.primaryTarget() + " has failed to transmit index; marked peer as busy");+ this.log.logInfo("STORE: Chunk " + new String(chunk.primaryTarget()) + " has failed to transmit index; marked peer as busy");if (chunk.canFinish()) {try {@@ -368,7 +369,7 @@ public class Dispatcher {}return chunk;} else {- this.log.logInfo("STORE: Chunk " + chunk.primaryTarget() + " has not enough targets left. This transmission has failed, putting back index to backend");+ this.log.logInfo("STORE: Chunk " + new String(chunk.primaryTarget()) + " has not enough targets left. This transmission has failed, putting back index to backend");chunk.restore();return null;}diff --git a/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.java b/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.javaindex bc68ab5cd..782d67aa4 100755--- a/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.java+++ b/source/de/anomic/yacy/dht/VerticalWordPartitionScheme.java@@ -73,6 +73,7 @@ public class VerticalWordPartitionScheme implements PartitionScheme {public final long dhtPosition(final byte[] wordHash, final int verticalPosition) {assert wordHash != null;+ assert wordHash[2] != '@';if (partitionExponent == 0) return FlatWordPartitionScheme.std.dhtPosition(wordHash, null);long partitionMask = (1L << (Long.SIZE - 1 - partitionExponent)) - 1L;long verticalMask = ((long) verticalPosition) << (Long.SIZE - 1 - partitionExponent); // don't remove the cast! it will become an integer result which is wrong.diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.javaindex 4267e9038..494d83e57 100644--- a/source/de/anomic/yacy/yacyClient.java+++ b/source/de/anomic/yacy/yacyClient.java@@ -125,7 +125,7 @@ public final class yacyClient {post.add(new DefaultCharsetStringPart("seed", mySeed.genSeedStr(salt)));// send requestfinal long start = System.currentTimeMillis();- final byte[] content = wput("http://" + address + "/yacy/hello.html", yacySeed.b64Hash2hexHash(otherHash) + ".yacyh", post, 15000, false);+ final byte[] content = wput("http://" + address + "/yacy/hello.html", yacySeed.b64Hash2hexHash(otherHash) + ".yacyh", post, 30000, false);yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' contacted peer at " + address + ", received " + ((content == null) ? "null" : content.length) + " bytes, time = " + (System.currentTimeMillis() - start) + " milliseconds");result = FileUtils.table(content, "UTF-8");break;@@ -134,7 +134,7 @@ public final class yacyClient {yacyCore.log.logWarning("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' interrupted.");return -1;}- yacyCore.log.logWarning("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' exception: " + e.getMessage() + "; retry = " + retry);+ yacyCore.log.logWarning("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "', peer " + address + "; exception: " + e.getMessage() + "; retry = " + retry);// try again (go into loop)result = null;}