Tabnine Logo
ErrorAwarePolicy
Code IndexAdd Tabnine to your IDE (free)

How to use
ErrorAwarePolicy
in
com.datastax.driver.core.policies

Best Java code snippets using com.datastax.driver.core.policies.ErrorAwarePolicy (Showing top 17 results out of 315)

origin: com.datastax.cassandra/cassandra-driver-core

 /**
  * Creates the {@link ErrorAwarePolicy} instance.
  *
  * @return the newly created {@link ErrorAwarePolicy}.
  */
 public ErrorAwarePolicy build() {
  return new ErrorAwarePolicy(this);
 }
}
origin: com.datastax.cassandra/cassandra-driver-core

public void should_exclude_host_after_reaching_maximum_errors() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
     .withMaxErrorsPerMinute(1)
     .withClock(clock)
origin: com.datastax.cassandra/cassandra-driver-core

public void should_resurrect_host_after_retry_period() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
     .withMaxErrorsPerMinute(1)
     .withRetryPeriod(70, SECONDS)
origin: com.datastax.cassandra/cassandra-driver-core

public void should_regard_defaults() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy()).withClock(clock).build();
origin: com.facebook.presto.cassandra/cassandra-driver

  /**
   * Creates the {@link ErrorAwarePolicy} instance.
   *
   * @return the newly created {@link ErrorAwarePolicy}.
   */
  public ErrorAwarePolicy build() {
    return new ErrorAwarePolicy(this);
  }
}
origin: com.datastax.cassandra/cassandra-driver-core

ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
  .withMaxErrorsPerMinute(1)
  .withClock(clock)
origin: com.yugabyte/cassandra-driver-core

  /**
   * Creates the {@link ErrorAwarePolicy} instance.
   *
   * @return the newly created {@link ErrorAwarePolicy}.
   */
  public ErrorAwarePolicy build() {
    return new ErrorAwarePolicy(this);
  }
}
origin: systems.composable/dropwizard-cassandra

  @Override
  public LoadBalancingPolicy build() {
    ErrorAwarePolicy.Builder builder = ErrorAwarePolicy.builder(subPolicy.build());

    if (maxErrorsPerMinute != null) {
      builder.withMaxErrorsPerMinute(maxErrorsPerMinute);
    }

    if (retryPeriod != null) {
      builder.withRetryPeriod(retryPeriod.getQuantity(), retryPeriod.getUnit());
    }

    return builder.build();
  }
}
origin: io.prestosql.cassandra/cassandra-driver

  /**
   * Creates the {@link ErrorAwarePolicy} instance.
   *
   * @return the newly created {@link ErrorAwarePolicy}.
   */
  public ErrorAwarePolicy build() {
    return new ErrorAwarePolicy(this);
  }
}
origin: composable-systems/dropwizard-cassandra

  @Override
  public LoadBalancingPolicy build() {
    ErrorAwarePolicy.Builder builder = ErrorAwarePolicy.builder(subPolicy.build());

    if (maxErrorsPerMinute != null) {
      builder.withMaxErrorsPerMinute(maxErrorsPerMinute);
    }

    if (retryPeriod != null) {
      builder.withRetryPeriod(retryPeriod.getQuantity(), retryPeriod.getUnit());
    }

    return builder.build();
  }
}
origin: com.datastax.cassandra/cassandra-driver-core

public void should_not_penalize_default_ignored_exceptions() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
     .withMaxErrorsPerMinute(1)
     .withClock(clock)
origin: org.apache.camel/camel-cassandraql

  public LoadBalancingPolicy getLoadBalancingPolicy(String policy) {
    LoadBalancingPolicy loadBalancingPolicy = new RoundRobinPolicy();
    switch (policy) {
    case roundRobinPolicy:
      loadBalancingPolicy = new RoundRobinPolicy();
      break;
    case tokenAwarePolicy:
      loadBalancingPolicy = new TokenAwarePolicy(new RoundRobinPolicy());
      break;
    case dcAwareRoundRobinPolicy:
      loadBalancingPolicy = DCAwareRoundRobinPolicy.builder().build();
      break;
    case latencyAwarePolicy:
      loadBalancingPolicy = LatencyAwarePolicy.builder(new RoundRobinPolicy()).build();
      break;
    case errorAwarePolicy:
      loadBalancingPolicy = ErrorAwarePolicy.builder(new RoundRobinPolicy()).build();
      break;
    default:
      throw new IllegalArgumentException("Cassandra load balancing policy can be " + roundRobinPolicy + " ," + tokenAwarePolicy 
          + " ," + dcAwareRoundRobinPolicy);
    }
    return loadBalancingPolicy;
  }
}
origin: com.datastax.dse/dse-java-driver-core

public void should_exclude_host_after_reaching_maximum_errors() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
     .withMaxErrorsPerMinute(1)
     .withClock(clock)
origin: com.datastax.dse/dse-java-driver-core

public void should_regard_defaults() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy()).withClock(clock).build();
origin: com.datastax.dse/dse-java-driver-core

public void should_resurrect_host_after_retry_period() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
     .withMaxErrorsPerMinute(1)
     .withRetryPeriod(70, SECONDS)
origin: com.datastax.dse/dse-java-driver-core

ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
  .withMaxErrorsPerMinute(1)
  .withClock(clock)
origin: com.datastax.dse/dse-java-driver-core

public void should_not_penalize_default_ignored_exceptions() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
     .withMaxErrorsPerMinute(1)
     .withClock(clock)
com.datastax.driver.core.policiesErrorAwarePolicy

Javadoc

Chainable load balancing policy that filters out hosts based on their error rates.

When creating a query plan, this policy gathers a list of candidate hosts from its child policy; for each candidate host, it then determines whether it should be included into or excluded from the final query plan, based on its current error rate (measured over the last minute, with a 5-second granularity).

Note that the policy should not blindly count all errors in its measurements: some type of errors (e.g. CQL syntax errors) can originate from the client and occur on all hosts, therefore they should not count towards the exclusion threshold or all hosts could become excluded. You can provide your own ErrorFilter to customize that logic.

The policy follows the builder pattern to be created, the Builder class can be created with #builder method.

This policy is currently in BETA mode and its behavior might be changing throughout different driver versions.

Most used methods

  • <init>
  • builder
    Creates a new error aware policy builder given the child policy that the resulting policy should wra

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now