Skip to content

Commit

Permalink
simplified method call in balancer
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2303 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Jul 19, 2006
1 parent 7b0e252 commit 5214f57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions source/de/anomic/plasma/plasmaCrawlBalancer.java
Expand Up @@ -142,15 +142,14 @@ public void add(String domain, byte[] hash) throws IOException {
}
}

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;
}
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/plasma/plasmaCrawlNURL.java
Expand Up @@ -404,7 +404,7 @@ private Entry pop(kelondroStack stack) throws IOException {
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 {
Expand Down

0 comments on commit 5214f57

Please sign in to comment.