use of com.datastax.oss.driver.internal.core.tracker.MultiplexingRequestTracker in project java-driver by datastax.
the class DefaultDriverContext method buildRequestTracker.
protected RequestTracker buildRequestTracker(RequestTracker requestTrackerFromBuilder) {
List<RequestTracker> trackers = new ArrayList<>();
if (requestTrackerFromBuilder != null) {
trackers.add(requestTrackerFromBuilder);
}
for (LoadBalancingPolicy lbp : this.getLoadBalancingPolicies().values()) {
lbp.getRequestTracker().ifPresent(trackers::add);
}
DefaultDriverOption newOption = DefaultDriverOption.REQUEST_TRACKER_CLASSES;
@SuppressWarnings("deprecation") DefaultDriverOption legacyOption = DefaultDriverOption.REQUEST_TRACKER_CLASS;
DriverExecutionProfile profile = config.getDefaultProfile();
if (profile.isDefined(newOption)) {
trackers.addAll(Reflection.buildFromConfigList(this, newOption, RequestTracker.class, "com.datastax.oss.driver.internal.core.tracker"));
}
if (profile.isDefined(legacyOption)) {
LOG.warn("Option {} has been deprecated and will be removed in a future release; please use option {} instead.", legacyOption, newOption);
Reflection.buildFromConfig(this, legacyOption, RequestTracker.class, "com.datastax.oss.driver.internal.core.tracker").ifPresent(trackers::add);
}
if (trackers.isEmpty()) {
return new NoopRequestTracker(this);
} else if (trackers.size() == 1) {
return trackers.get(0);
} else {
return new MultiplexingRequestTracker(trackers);
}
}
Aggregations