From c6d2a4893a1e620325f2fd363b3065546efc2e64 Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Thu, 12 Jan 2017 13:13:24 +0100 Subject: simplify SharedSender API * require ResultCallback owners to keep their own Pending number * no longer send numPending in handleReply() * remove unused remove() method * get rid of activeOwners map and associated monitor * waitForPending() now just delegates to the Pending number --- .../src/main/java/com/yahoo/storage/searcher/GetSearcher.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vespaclient-container-plugin') diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java b/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java index 4efe3a8321b..5d97e45a347 100755 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java @@ -86,6 +86,7 @@ public class GetSearcher extends Searcher { private List documentHits = new ArrayList<>(); private List errorHits = new ArrayList<>(); private List replies = new ArrayList<>(); + private final SharedSender.Pending pendingNumber = new SharedSender.Pending(); public GetResponse(List documentIds) { ordering = new HashMap<>(documentIds.size()); @@ -106,14 +107,16 @@ public class GetSearcher extends Searcher { return sw.toString(); } - public boolean handleReply(Reply reply, int numPending) { + public boolean handleReply(Reply reply) { if ((reply.getTrace().getLevel() > 0) && log.isLoggable(LogLevel.DEBUG)) { String str = reply.getTrace().toString(); log.log(LogLevel.DEBUG, str); } replies.add(reply); - return numPending > 0; + return true; } + public SharedSender.Pending getPending() { return pendingNumber; } + private void processReplies() { for (Reply reply : replies) { processReply(reply); -- cgit v1.2.3