use of com.datastax.dse.driver.internal.core.insights.PackageUtil.ClassSettingDetails in project java-driver by datastax.
the class ExecutionProfilesInfoFinder method getLoadBalancingInfo.
private LoadBalancingInfo getLoadBalancingInfo(DriverExecutionProfile driverExecutionProfile) {
Map<String, Object> options = new LinkedHashMap<>();
if (driverExecutionProfile.isDefined(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER)) {
options.put("localDataCenter", driverExecutionProfile.getString(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER));
}
@SuppressWarnings("deprecation") boolean hasNodeFiltering = driverExecutionProfile.isDefined(DefaultDriverOption.LOAD_BALANCING_FILTER_CLASS) || driverExecutionProfile.isDefined(DefaultDriverOption.LOAD_BALANCING_DISTANCE_EVALUATOR_CLASS);
options.put("filterFunction", hasNodeFiltering);
ClassSettingDetails loadBalancingDetails = PackageUtil.getLoadBalancingDetails(driverExecutionProfile.getString(DefaultDriverOption.LOAD_BALANCING_POLICY_CLASS));
return new LoadBalancingInfo(loadBalancingDetails.getClassName(), options, loadBalancingDetails.getFullPackage());
}
use of com.datastax.dse.driver.internal.core.insights.PackageUtil.ClassSettingDetails in project java-driver by datastax.
the class ExecutionProfilesInfoFinder method getSpeculativeExecutionInfo.
private SpeculativeExecutionInfo getSpeculativeExecutionInfo(DriverExecutionProfile driverExecutionProfile) {
Map<String, Object> options = new LinkedHashMap<>();
putIfExists(options, "maxSpeculativeExecutions", DefaultDriverOption.SPECULATIVE_EXECUTION_MAX, driverExecutionProfile);
putIfExists(options, "delay", DefaultDriverOption.SPECULATIVE_EXECUTION_DELAY, driverExecutionProfile);
ClassSettingDetails speculativeExecutionDetails = PackageUtil.getSpeculativeExecutionDetails(driverExecutionProfile.getString(DefaultDriverOption.SPECULATIVE_EXECUTION_POLICY_CLASS));
return new SpeculativeExecutionInfo(speculativeExecutionDetails.getClassName(), options, speculativeExecutionDetails.getFullPackage());
}
use of com.datastax.dse.driver.internal.core.insights.PackageUtil.ClassSettingDetails in project java-driver by datastax.
the class InsightsClient method getAuthProvider.
private AuthProviderType getAuthProvider() {
String authProviderClassName = driverContext.getConfig().getDefaultProfile().getString(AUTH_PROVIDER_CLASS, "NoAuthProvider");
ClassSettingDetails authProviderDetails = PackageUtil.getAuthProviderDetails(authProviderClassName);
return new AuthProviderType(authProviderDetails.getClassName(), authProviderDetails.getFullPackage());
}
Aggregations