tried to fix some problems with time-outs during search

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1994 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent e2e8d0c188
commit ac114d69c0

@ -219,27 +219,27 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
plasmaWordIndexEntryContainer searchResult = new plasmaWordIndexEntryContainer(null); plasmaWordIndexEntryContainer searchResult = new plasmaWordIndexEntryContainer(null);
long preorderTime = profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_PRESORT); long preorderTime = profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_PRESORT);
long postorderTime = profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_POSTSORT);
profileLocal.startTimer(); profileLocal.startTimer();
long pst = System.currentTimeMillis(); long pst = System.currentTimeMillis();
searchResult.add(rcLocal, preorderTime / 3); searchResult.add(rcLocal, preorderTime);
searchResult.add(rcGlobal, preorderTime / 3); searchResult.add(rcGlobal, preorderTime);
preorderTime = preorderTime - (System.currentTimeMillis() - pst); preorderTime = preorderTime - (System.currentTimeMillis() - pst);
if (preorderTime < 0) preorderTime = 100; if (preorderTime < 0) preorderTime = 200;
plasmaSearchPreOrder preorder = new plasmaSearchPreOrder(query, ranking); plasmaSearchPreOrder preorder = new plasmaSearchPreOrder(query, ranking);
preorder.addContainer(searchResult, preorderTime); preorder.addContainer(searchResult, preorderTime);
profileLocal.setYieldTime(plasmaSearchTimingProfile.PROCESS_PRESORT); profileLocal.setYieldTime(plasmaSearchTimingProfile.PROCESS_PRESORT);
profileLocal.setYieldCount(plasmaSearchTimingProfile.PROCESS_PRESORT, rcLocal.size()); profileLocal.setYieldCount(plasmaSearchTimingProfile.PROCESS_PRESORT, rcLocal.size());
// start url-fetch
long postorderTime = profileLocal.getTargetTime(plasmaSearchTimingProfile.PROCESS_POSTSORT);
long postorderLimitTime = (postorderTime < 0) ? Long.MAX_VALUE : (System.currentTimeMillis() + postorderTime);
profileLocal.startTimer(); profileLocal.startTimer();
plasmaSearchResult acc = new plasmaSearchResult(query, ranking); plasmaSearchResult acc = new plasmaSearchResult(query, ranking);
if (searchResult == null) return acc; // strange case where searchResult is not proper: acc is then empty //if (searchResult == null) return acc; // strange case where searchResult is not proper: acc is then empty
if (searchResult.size() == 0) return acc; // case that we have nothing to do //if (searchResult.size() == 0) return acc; // case that we have nothing to do
// start url-fetch
plasmaWordIndexEntry entry; plasmaWordIndexEntry entry;
long postorderLimitTime = (postorderTime < 0) ? Long.MAX_VALUE : (System.currentTimeMillis() + postorderTime);
plasmaCrawlLURL.Entry page; plasmaCrawlLURL.Entry page;
int minEntries = profileLocal.getTargetCount(plasmaSearchTimingProfile.PROCESS_POSTSORT); int minEntries = profileLocal.getTargetCount(plasmaSearchTimingProfile.PROCESS_POSTSORT);
try { try {

@ -86,6 +86,8 @@ public class plasmaSearchTimingProfile implements Cloneable {
public static final char PROCESS_FILTER = 'f'; public static final char PROCESS_FILTER = 'f';
public static final char PROCESS_SNIPPETFETCH = 's'; public static final char PROCESS_SNIPPETFETCH = 's';
private static final long minimumTargetTime = 100;
public static char[] sequence = new char[]{ public static char[] sequence = new char[]{
PROCESS_COLLECTION, PROCESS_COLLECTION,
PROCESS_JOIN, PROCESS_JOIN,
@ -197,11 +199,11 @@ public class plasmaSearchTimingProfile implements Cloneable {
element = new Character(sequence[i]); element = new Character(sequence[i]);
t = (Long) targetTime.get(element); t = (Long) targetTime.get(element);
if (t != null) sum += t.longValue(); if (t != null) sum += t.longValue();
if (type == sequence[i]) return (sum < 0) ? 0 : sum; if (type == sequence[i]) return (sum < 0) ? minimumTargetTime : sum;
t = (Long) yieldTime.get(element); t = (Long) yieldTime.get(element);
if (t != null) sum -= t.longValue(); if (t != null) sum -= t.longValue();
} }
return 0; return minimumTargetTime;
} }
public int getTargetCount(char type) { public int getTargetCount(char type) {

@ -657,34 +657,34 @@ storagePeerHash =
# time-percent is the percent of total search time # time-percent is the percent of total search time
# count-percent is the percent of total wanted urls in result # count-percent is the percent of total wanted urls in result
# we distinguish local and remote search times # we distinguish local and remote search times
searchProcessLocalTime_c = 25 searchProcessLocalTime_c = 10
searchProcessLocalCount_c = 10000000 searchProcessLocalCount_c = 10000000
searchProcessLocalTime_j = 10 searchProcessLocalTime_j = 10
searchProcessLocalCount_j = 1000000 searchProcessLocalCount_j = 1000000
searchProcessLocalTime_r = 10 searchProcessLocalTime_r = 10
searchProcessLocalCount_r =100000 searchProcessLocalCount_r =100000
searchProcessLocalTime_u = 30 searchProcessLocalTime_u = 50
searchProcessLocalCount_u = 10000 searchProcessLocalCount_u = 10000
searchProcessLocalTime_o = 10 searchProcessLocalTime_o = 10
searchProcessLocalCount_o = 100 searchProcessLocalCount_o = 100
searchProcessLocalTime_f = 5 searchProcessLocalTime_f = 5
searchProcessLocalCount_f = 100 searchProcessLocalCount_f = 100
searchProcessLocalTime_s = 10 searchProcessLocalTime_s = 5
searchProcessLocalCount_s = 30 searchProcessLocalCount_s = 30
searchProcessRemoteTime_c = 25 searchProcessRemoteTime_c = 10
searchProcessRemoteCount_c = 1000000 searchProcessRemoteCount_c = 1000000
searchProcessRemoteTime_j = 10 searchProcessRemoteTime_j = 10
searchProcessRemoteCount_j = 1000000 searchProcessRemoteCount_j = 1000000
searchProcessRemoteTime_r = 10 searchProcessRemoteTime_r = 10
searchProcessRemoteCount_r = 1000 searchProcessRemoteCount_r = 1000
searchProcessRemoteTime_u = 30 searchProcessRemoteTime_u = 50
searchProcessRemoteCount_u = 1000 searchProcessRemoteCount_u = 1000
searchProcessRemoteTime_o = 10 searchProcessRemoteTime_o = 10
searchProcessRemoteCount_o = 1000 searchProcessRemoteCount_o = 1000
searchProcessRemoteTime_f = 5 searchProcessRemoteTime_f = 5
searchProcessRemoteCount_f = 100 searchProcessRemoteCount_f = 100
searchProcessRemoteTime_s = 10 searchProcessRemoteTime_s = 5
searchProcessRemoteCount_s = 10 searchProcessRemoteCount_s = 10
# path to ranking directory containing ranking reference files # path to ranking directory containing ranking reference files

Loading…
Cancel
Save