summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2017-01-12 13:13:24 +0100
committerArne H Juul <arnej@yahoo-inc.com>2017-01-12 13:13:24 +0100
commitc6d2a4893a1e620325f2fd363b3065546efc2e64 (patch)
treeb2160ceb7bf9d4a5d322606d7e614e5b1645368c /vespaclient-container-plugin
parentc3e78ef7a72efc0ccd419acf6ac719eb6effdc3d (diff)
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
Diffstat (limited to 'vespaclient-container-plugin')
-rwxr-xr-xvespaclient-container-plugin/src/main/java/com/yahoo/storage/searcher/GetSearcher.java7
1 files changed, 5 insertions, 2 deletions
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<DocumentHit> documentHits = new ArrayList<>();
private List<DefaultErrorHit> errorHits = new ArrayList<>();
private List<Reply> replies = new ArrayList<>();
+ private final SharedSender.Pending pendingNumber = new SharedSender.Pending();
public GetResponse(List<String> 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);