From 46c4f8b68ae8a39009be5e8bb140f29641d8eb68 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 24 Feb 2010 23:11:58 +0000 Subject: [PATCH] better look-ahead into the crawl queue: show more on crawl monitor git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6699 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/crawler/Balancer.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/crawler/Balancer.java b/source/de/anomic/crawler/Balancer.java index 838191938..f19561f56 100644 --- a/source/de/anomic/crawler/Balancer.java +++ b/source/de/anomic/crawler/Balancer.java @@ -512,9 +512,26 @@ public class Balancer { cel.add(crawlEntry); count--; if (count <= 0) break; - } catch (IOException e) { - } + } catch (IOException e) {} } + + int depth = 0; + loop: while (count > 0) { + // iterate over the domain stacks + for (LinkedList list: this.domainStacks.values()) { + if (list.size() <= depth) continue loop; + String n = list.get(depth); + try { + Row.Entry rowEntry = urlFileIndex.get(n.getBytes()); + if (rowEntry == null) continue; + final Request crawlEntry = new Request(rowEntry); + cel.add(crawlEntry); + count--; + if (count <= 0) break loop; + } catch (IOException e) {} + } + } + } return cel; }