Java 类com.datastax.driver.core.policies.SpeculativeExecutionPolicy 实例源码

项目:ignite    文件:DataSource.java   
/**
 * Sets speculative execution policy.
 *
 * @param plc Speculative execution policy.
 */
@SuppressWarnings("UnusedDeclaration")
public void setSpeculativeExecutionPolicy(SpeculativeExecutionPolicy plc) {
    speculativeExecutionPlc = plc;

    invalidate();
}
项目:ignite    文件:DataSource.java   
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    fetchSize = (Integer)in.readObject();
    readConsistency = (ConsistencyLevel)in.readObject();
    writeConsistency = (ConsistencyLevel)in.readObject();
    user = U.readString(in);
    pwd = U.readString(in);
    port = (Integer)in.readObject();
    contactPoints = (List<InetAddress>)in.readObject();
    contactPointsWithPorts = (List<InetSocketAddress>)in.readObject();
    maxSchemaAgreementWaitSeconds = (Integer)in.readObject();
    protoVer = (Integer)in.readObject();
    compression = U.readString(in);
    useSSL = (Boolean)in.readObject();
    collectMetrix = (Boolean)in.readObject();
    jmxReporting = (Boolean)in.readObject();
    creds = (Credentials)in.readObject();
    loadBalancingPlc = (LoadBalancingPolicy)readObject(in);
    reconnectionPlc = (ReconnectionPolicy)readObject(in);
    addrTranslator = (AddressTranslator)readObject(in);
    speculativeExecutionPlc = (SpeculativeExecutionPolicy)readObject(in);
    authProvider = (AuthProvider)readObject(in);
    sslOptions = (SSLOptions)readObject(in);
    poolingOptions = (PoolingOptions)readObject(in);
    sockOptions = (SocketOptions)readObject(in);
    nettyOptions = (NettyOptions)readObject(in);
}
项目:dropwizard-cassandra    文件:ConstantSpeculativeExecutionPolicyFactoryTest.java   
@Test
public void buildsPolicyWithConfiguredValues() throws Exception {
    final ConstantSpeculativeExecutionPolicyFactory factory = new ConstantSpeculativeExecutionPolicyFactory();
    factory.setDelay(Duration.seconds(5));
    factory.setMaxSpeculativeExecutions(2);

    final SpeculativeExecutionPolicy policy = factory.build();

    assertThat(policy).isExactlyInstanceOf(ConstantSpeculativeExecutionPolicy.class);
}
项目:dropwizard-cassandra    文件:NoSpeculativeExecutionPolicyFactoryTest.java   
@Test
public void returnsSingletonInstance() throws Exception {
    final NoSpeculativeExecutionPolicyFactory factory = new NoSpeculativeExecutionPolicyFactory();

    final SpeculativeExecutionPolicy policy = factory.build();

    assertThat(policy).isSameAs(NoSpeculativeExecutionPolicy.INSTANCE);
}
项目:Lagerta    文件:DataSource.java   
/**
 * Sets speculative execution policy.
 *
 * @param plc Speculative execution policy.
 */
@SuppressWarnings("UnusedDeclaration")
public void setSpeculativeExecutionPolicy(SpeculativeExecutionPolicy plc) {
    this.speculativeExecutionPlc = plc;
    invalidate();
}
项目:Lagerta    文件:DataSource.java   
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    fetchSize = (Integer)in.readObject();
    readConsistency = (ConsistencyLevel)in.readObject();
    writeConsistency = (ConsistencyLevel)in.readObject();
    user = U.readString(in);
    pwd = U.readString(in);
    port = (Integer)in.readObject();
    contactPoints = (List<InetAddress>)in.readObject();
    contactPointsWithPorts = (List<InetSocketAddress>)in.readObject();
    maxSchemaAgreementWaitSeconds = (Integer)in.readObject();
    protoVer = (Integer)in.readObject();
    compression = U.readString(in);
    useSSL = (Boolean)in.readObject();
    collectMetrix = (Boolean)in.readObject();
    jmxReporting = (Boolean)in.readObject();
    creds = (Credentials)in.readObject();
    loadBalancingPlc = (LoadBalancingPolicy)readObject(in);
    reconnectionPlc = (ReconnectionPolicy)readObject(in);
    addrTranslator = (AddressTranslator)readObject(in);
    speculativeExecutionPlc = (SpeculativeExecutionPolicy)readObject(in);
    authProvider = (AuthProvider)readObject(in);
    sslOptions = (SSLOptions)readObject(in);
    poolingOptions = (PoolingOptions)readObject(in);
    sockOptions = (SocketOptions)readObject(in);
    nettyOptions = (NettyOptions)readObject(in);
}
项目:dropwizard-cassandra    文件:NoSpeculativeExecutionPolicyFactory.java   
@Override
public SpeculativeExecutionPolicy build() {
    return NoSpeculativeExecutionPolicy.INSTANCE;
}
项目:dropwizard-cassandra    文件:ConstantSpeculativeExecutionPolicyFactory.java   
@Override
public SpeculativeExecutionPolicy build() {
    return new ConstantSpeculativeExecutionPolicy(delay.toMilliseconds(), maxSpeculativeExecutions);
}
项目:camel-cql    文件:ClusterBean.java   
/**
 * @return the speculativeExecutionPolicy
 */
public SpeculativeExecutionPolicy getSpeculativeExecutionPolicy() {
    return speculativeExecutionPolicy;
}
项目:camel-cql    文件:ClusterBean.java   
/**
 * @param speculativeExecutionPolicy
 *            the speculativeExecutionPolicy to set
 */
public void setSpeculativeExecutionPolicy(
        SpeculativeExecutionPolicy speculativeExecutionPolicy) {
    this.speculativeExecutionPolicy = speculativeExecutionPolicy;
}
项目:dropwizard-cassandra    文件:SpeculativeExecutionPolicyFactory.java   
SpeculativeExecutionPolicy build();