/** * {@inheritDoc} */ @Override public <T> boolean needScatterGather(Request<T> request) { if (!BATCHING_STRATEGY_METHODS.contains(request.getMethod())) { return false; } final String serviceName = request.getServiceName(); try { return _uriMapper.needScatterGather(serviceName); } catch (ServiceUnavailableException e) { log.error("Unable to determine scatter-gather capability for service :" + serviceName + " and treat as unsupported!", e); return false; } }
try serviceUri = new URI(D2_URI_PREFIX + request.getServiceName());
private void getProtocolVersionForService(final Request<?> request, Callback<ProtocolVersion> callback) { try { _client.getMetadata(new URI(_uriPrefix + request.getServiceName()), Callbacks.handle(metadata -> callback.onSuccess(getProtocolVersion(AllProtocolVersions.BASELINE_PROTOCOL_VERSION, AllProtocolVersions.PREVIOUS_PROTOCOL_VERSION, AllProtocolVersions.LATEST_PROTOCOL_VERSION, AllProtocolVersions.NEXT_PROTOCOL_VERSION, getAnnouncedVersion(metadata), request.getRequestOptions().getProtocolVersionOption(), _forceUseNextVersionOverride)), callback)); } catch (URISyntaxException e) { throw new RuntimeException("Failed to create a valid URI to fetch properties for!"); } }