@Override protected void onFirstPhaseResult(int shardId, ScrollQueryFetchSearchResult result) { queryFetchResults.setOnce(shardId, result.result()); } }
protected void onFirstPhaseResult(int shardId, ScrollQuerySearchResult result) { queryResults.setOnce(shardId, result.queryResult()); }
@Override public void onResponse(T element) { results.setOnce(pos.incrementAndGet() - 1, element); if (countDown.countDown()) { if (failure.get() != null) { delegate.onFailure(failure.get()); } else { List<T> collect = this.results.asList(); collect.addAll(defaults); delegate.onResponse(Collections.unmodifiableList(collect)); } } }
@Override public void onResponse(TaskResponse response) { responses.setOnce(taskIndex, response == null ? null : new Tuple<>(response, null)); respondIfFinished(); }
/** * Record a response from a slice and respond to the listener if the request is finished. */ public void onSliceResponse(ActionListener<BulkByScrollResponse> listener, int sliceId, BulkByScrollResponse response) { results.setOnce(sliceId, new Result(sliceId, response)); /* If the request isn't finished we could automatically rethrottle the sub-requests here but we would only want to do that if we * were fairly sure they had a while left to go. */ recordSliceCompletionAndRespondIfAllDone(listener); }
@Override public void onFailure(Exception e) { responses.setOnce(taskIndex, new Tuple<>(null, e)); respondIfFinished(); }
/** * Record a failure from a slice and respond to the listener if the request is finished. */ public void onSliceFailure(ActionListener<BulkByScrollResponse> listener, int sliceId, Exception e) { results.setOnce(sliceId, new Result(sliceId, e)); recordSliceCompletionAndRespondIfAllDone(listener); // TODO cancel when a slice fails? }
@Override protected void onFirstPhaseResult(int shardId, ScrollQueryFetchSearchResult result) { queryFetchResults.setOnce(shardId, result.result()); } }
@Override protected void onFirstPhaseResult(int shardId, ScrollQueryFetchSearchResult result) { queryFetchResults.setOnce(shardId, result.result()); } }
@Override protected void onFirstPhaseResult(int shardId, ScrollQueryFetchSearchResult result) { queryFetchResults.setOnce(shardId, result.result()); } }
/** * Record a response from a slice and respond to the listener if the request is finished. */ public void onSliceResponse(ActionListener<BulkByScrollResponse> listener, int sliceId, BulkByScrollResponse response) { results.setOnce(sliceId, new Result(sliceId, response)); /* If the request isn't finished we could automatically rethrottle the sub-requests here but we would only want to do that if we * were fairly sure they had a while left to go. */ recordSliceCompletionAndRespondIfAllDone(listener); }
/** * Record a failure from a slice and respond to the listener if the request is finished. */ public void onSliceFailure(ActionListener<BulkByScrollResponse> listener, int sliceId, Exception e) { results.setOnce(sliceId, new Result(sliceId, e)); recordSliceCompletionAndRespondIfAllDone(listener); // TODO cancel when a slice fails? }
@Override public void onResponse(TaskResponse response) { responses.setOnce(taskIndex, response == null ? null : new Tuple<>(response, null)); respondIfFinished(); }
@Override public void onFailure(Exception e) { responses.setOnce(taskIndex, new Tuple<>(null, e)); respondIfFinished(); }
@Override public void onResponse(TaskResponse response) { responses.setOnce(taskIndex, response == null ? null : new Tuple<>(response, null)); respondIfFinished(); }
@Override public void onFailure(Exception e) { responses.setOnce(taskIndex, new Tuple<>(null, e)); respondIfFinished(); }
/** * Record a response from a slice and respond to the listener if the request is finished. */ public void onSliceResponse(ActionListener<BulkByScrollResponse> listener, int sliceId, BulkByScrollResponse response) { results.setOnce(sliceId, new Result(sliceId, response)); /* If the request isn't finished we could automatically rethrottle the sub-requests here but we would only want to do that if we * were fairly sure they had a while left to go. */ recordSliceCompletionAndRespondIfAllDone(listener); }
/** * Record a failure from a slice and respond to the listener if the request is finished. */ public void onSliceFailure(ActionListener<BulkByScrollResponse> listener, int sliceId, Exception e) { results.setOnce(sliceId, new Result(sliceId, e)); recordSliceCompletionAndRespondIfAllDone(listener); // TODO cancel when a slice fails? }
@Override public void onResponse(TaskResponse response) { responses.setOnce(taskIndex, response == null ? null : new Tuple<>(response, null)); respondIfFinished(); }
@Override public void onFailure(Exception e) { responses.setOnce(taskIndex, new Tuple<>(null, e)); respondIfFinished(); }