- increased thread priority for server threads

- decreased thread priority for crawler threads

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6596 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2010-01-19 11:29:22 +00:00
parent 78daea95c3
commit e80e060ca6
4 changed files with 8 additions and 4 deletions

View File

@ -533,6 +533,7 @@ public class CrawlQueues {
workers.put(code, this);
this.start();
}
this.setPriority(Thread.MIN_PRIORITY); // http requests from the crawler should not cause that other functions work worse
}
public long age() {

View File

@ -137,8 +137,8 @@ public final class ResultURLs {
*/
public synchronized String getHashNo(final EventOrigin stack, final int pos, final int index) {
final String result = getResultStackAt(stack, pos);
if(result != null) {
if(result.length() < Word.commonHashLength * 3) {
if (result != null) {
if (result.length() < Word.commonHashLength * 3) {
Log.logSevere("ResultURLs", "unexpected error: result of stack is too short: "+ result.length());
if(result.length() <= Word.commonHashLength * 2) {
return null;
@ -189,8 +189,10 @@ public final class ResultURLs {
public int deleteDomain(final EventOrigin stack, String host, String hosthash) {
assert hosthash.length() == 6;
int i = 0;
String urlhash;
while (i < getStackSize(stack)) {
if (getUrlHash(stack, i).substring(6).equals(hosthash)) getStack(stack).remove(i); else i++;
urlhash = getUrlHash(stack, i);
if (urlhash == null || urlhash.substring(6).equals(hosthash)) getStack(stack).remove(i); else i++;
}
assert host != null : "host = null";
assert getDomains(stack) != null : "getDomains(" + stack + ") = null";

View File

@ -498,6 +498,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
public Session(final ThreadGroup theThreadGroup, final Socket controlSocket, final int socketTimeout) {
super(theThreadGroup, controlSocket.getInetAddress().toString() + "@" + Long.toString(System.currentTimeMillis()));
this.setPriority(Thread.MAX_PRIORITY);
this.socketTimeout = socketTimeout;
this.controlSocket = controlSocket;
this.hashIndex = sessionCounter;

View File

@ -104,7 +104,7 @@ public class BEncodedHeap implements Iterable<Map.Entry<byte[], Map<String, byte
return b2m(b);
}
private static Map<String, byte[]> b2m(byte[] b) {
static Map<String, byte[]> b2m(byte[] b) {
if (b == null) return null;
System.out.println("b = " + new String(b));
BDecoder decoder = new BDecoder(b);