From 5214f571cd157c41aab934e7bbebc38aad9d883e Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 19 Jul 2006 00:42:20 +0000 Subject: [PATCH] simplified method call in balancer git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2303 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaCrawlBalancer.java | 9 ++++----- source/de/anomic/plasma/plasmaCrawlNURL.java | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/plasma/plasmaCrawlBalancer.java b/source/de/anomic/plasma/plasmaCrawlBalancer.java index 241615bff..cf5522160 100644 --- a/source/de/anomic/plasma/plasmaCrawlBalancer.java +++ b/source/de/anomic/plasma/plasmaCrawlBalancer.java @@ -142,15 +142,14 @@ public class plasmaCrawlBalancer { } } - public Object[] /*String, byte[]*/ get() throws IOException { - // returns a pair of domain/hash from the stack - // if the domain is unknown, a null/hash is returned + public byte[] get() throws IOException { + // returns an url-hash from the stack synchronized (domainStacks) { if (stack.size() > 0) { - return new Object[]{null, stack.pop().getColBytes(0)}; + return stack.pop().getColBytes(0); } else if (domainStacks.size() > 0) { flushOnce(); - return new Object[]{null, stack.pop().getColBytes(0)}; + return stack.pop().getColBytes(0); } else { return null; } diff --git a/source/de/anomic/plasma/plasmaCrawlNURL.java b/source/de/anomic/plasma/plasmaCrawlNURL.java index fd67e7249..81e376aab 100644 --- a/source/de/anomic/plasma/plasmaCrawlNURL.java +++ b/source/de/anomic/plasma/plasmaCrawlNURL.java @@ -404,7 +404,7 @@ public class plasmaCrawlNURL extends indexURL { private Entry pop(plasmaCrawlBalancer balancer) throws IOException { // this is a filo - pop if (balancer.size() > 0) { - Entry e = new Entry(new String((byte[]) balancer.get()[1])); + Entry e = new Entry(new String(balancer.get())); stackIndex.remove(e.hash); return e; } else {