Search in sources :

Example 1 with ClassSettingDetails

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());
}
Also used : LoadBalancingInfo(com.datastax.dse.driver.internal.core.insights.schema.LoadBalancingInfo) ClassSettingDetails(com.datastax.dse.driver.internal.core.insights.PackageUtil.ClassSettingDetails) LinkedHashMap(java.util.LinkedHashMap)

Example 2 with ClassSettingDetails

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());
}
Also used : ClassSettingDetails(com.datastax.dse.driver.internal.core.insights.PackageUtil.ClassSettingDetails) LinkedHashMap(java.util.LinkedHashMap) SpeculativeExecutionInfo(com.datastax.dse.driver.internal.core.insights.schema.SpeculativeExecutionInfo)

Example 3 with ClassSettingDetails

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());
}
Also used : AuthProviderType(com.datastax.dse.driver.internal.core.insights.schema.AuthProviderType) ClassSettingDetails(com.datastax.dse.driver.internal.core.insights.PackageUtil.ClassSettingDetails)

Aggregations

ClassSettingDetails (com.datastax.dse.driver.internal.core.insights.PackageUtil.ClassSettingDetails)3 LinkedHashMap (java.util.LinkedHashMap)2 AuthProviderType (com.datastax.dse.driver.internal.core.insights.schema.AuthProviderType)1 LoadBalancingInfo (com.datastax.dse.driver.internal.core.insights.schema.LoadBalancingInfo)1 SpeculativeExecutionInfo (com.datastax.dse.driver.internal.core.insights.schema.SpeculativeExecutionInfo)1