- 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
pull/1/head
orbiter 15 years ago
parent 78daea95c3
commit e80e060ca6

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

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

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

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

Loading…
Cancel
Save