mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
- 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:
parent
78daea95c3
commit
e80e060ca6
|
@ -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() {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user