Java 类com.datastax.driver.core.TimestampGenerator 实例源码

项目:glowroot    文件:CentralModule.java   
private static Cluster createCluster(CentralConfiguration centralConfig,
        TimestampGenerator defaultTimestampGenerator) {
    Cluster.Builder builder = Cluster.builder()
            .addContactPoints(
                    centralConfig.cassandraContactPoint().toArray(new String[0]))
            // aggressive reconnect policy seems ok since not many clients
            .withReconnectionPolicy(new ConstantReconnectionPolicy(1000))
            // let driver know that only idempotent queries are used so it will retry on timeout
            .withQueryOptions(new QueryOptions()
                    .setDefaultIdempotence(true)
                    .setConsistencyLevel(centralConfig.cassandraConsistencyLevel()))
            // central runs lots of parallel async queries and is very spiky since all
            // aggregates come in right after each minute marker
            .withPoolingOptions(
                    new PoolingOptions().setMaxQueueSize(Session.MAX_CONCURRENT_QUERIES))
            .withTimestampGenerator(defaultTimestampGenerator);
    String cassandraUsername = centralConfig.cassandraUsername();
    if (!cassandraUsername.isEmpty()) {
        // empty password is strange but valid
        builder.withCredentials(cassandraUsername, centralConfig.cassandraPassword());
    }
    return builder.build();
}
项目:state-channels    文件:CassandraConfiguration.java   
@Bean
public TimestampGenerator getTimestampGenerator() {
    return new AtomicMonotonicTimestampGenerator();
}
项目:camel-cql    文件:ClusterBean.java   
/**
 * @return the timestampGenerator
 */
public TimestampGenerator getTimestampGenerator() {
    return timestampGenerator;
}
项目:camel-cql    文件:ClusterBean.java   
/**
 * @param timestampGenerator
 *            the timestampGenerator to set
 */
public void setTimestampGenerator(TimestampGenerator timestampGenerator) {
    this.timestampGenerator = timestampGenerator;
}