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

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

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

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.datastax.cassandra/cassandra-driver-core

ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy())
  .withMaxErrorsPerMinute(1)
  .withClock(clock)
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: 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_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

public void should_regard_defaults() throws InterruptedException {
 LoadBalancingPolicy lbp =
   ErrorAwarePolicy.builder(new SortingLoadBalancingPolicy()).withClock(clock).build();
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.policiesErrorAwarePolicybuilder

Javadoc

Creates a new error aware policy builder given the child policy that the resulting policy should wrap.

Popular methods of ErrorAwarePolicy

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top Sublime Text plugins
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