Examples of OperandPolicy


Examples of org.scale7.cassandra.pelops.OperandPolicy

     * @param cluster the cluster this pool is pooling connections to
     * @param keyspace the keyspace this pool is for
     * @see #CommonsBackedPool(org.scale7.cassandra.pelops.Cluster, String, org.scale7.cassandra.pelops.pool.CommonsBackedPool.Policy,org.scale7.cassandra.pelops.OperandPolicy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.INodeSelectionStrategy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.INodeSuspensionStrategy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.IConnectionValidator)
     */
    public CommonsBackedPool(Cluster cluster, String keyspace) {
        this(cluster, keyspace, new Policy(cluster), new OperandPolicy());
    }
View Full Code Here

Examples of org.scale7.cassandra.pelops.OperandPolicy

        if (keyspace == null) throw new IllegalArgumentException("keyspace is a required argument");
        this.cluster = cluster;
        this.keyspace = keyspace;
       
        this.policy = policy != null ? policy : new Policy(cluster);
        this.operandPolicy = operandPolicy != null ? operandPolicy : new OperandPolicy();

        logger.info("Initialising pool configuration policy: {}", this.policy.toString());

        this.nodeSelectionStrategy = nodeSelectionStrategy != null ? nodeSelectionStrategy : new LeastLoadedNodeSelectionStrategy();
        logger.info("Initialising pool node selection strategy: {}", this.nodeSelectionStrategy);
View Full Code Here

Examples of org.scale7.cassandra.pelops.OperandPolicy

     * Tests the factory bean works as expected when operand or pool policy instances are provided.
     * @throws Exception if an error occurs
     */
    @Test
    public void testAfterProperties() throws Exception {
        OperandPolicy operandPolicy = new OperandPolicy();
        CommonsBackedPool.Policy policy = new CommonsBackedPool.Policy();
        LeastLoadedNodeSelectionStrategy nodeSelectionStrategy = new LeastLoadedNodeSelectionStrategy();
        NoOpNodeSuspensionStrategy nodeSuspensionStrategy = new NoOpNodeSuspensionStrategy();
        NoOpConnectionValidator connectionValidator = new NoOpConnectionValidator();

View Full Code Here

Examples of org.scale7.cassandra.pelops.OperandPolicy

        final AtomicBoolean suspended = new AtomicBoolean(true);
        CommonsBackedPool pool = new CommonsBackedPool(
                AbstractIntegrationTest.cluster,
                AbstractIntegrationTest.KEYSPACE,
                config,
                new OperandPolicy(),
                new LeastLoadedNodeSelectionStrategy(),
                new CommonsBackedPool.INodeSuspensionStrategy() {
                    @Override
                    public boolean evaluate(CommonsBackedPool pool, PooledNode node) {
                        if (suspended.get()) {
View Full Code Here

Examples of org.scale7.cassandra.pelops.OperandPolicy

        final AtomicBoolean invoked = new AtomicBoolean(false);
        CommonsBackedPool pool = new CommonsBackedPool(
                AbstractIntegrationTest.cluster,
                AbstractIntegrationTest.KEYSPACE,
                config,
                new OperandPolicy(),
                new LeastLoadedNodeSelectionStrategy(),
                new NoOpNodeSuspensionStrategy(),
                new CommonsBackedPool.IConnectionValidator() {
                    @Override
                    public boolean validate(CommonsBackedPool.PooledConnection connection) {
View Full Code Here

Examples of org.scale7.cassandra.pelops.OperandPolicy

        long startMillis = System.currentTimeMillis();
        CommonsBackedPool pool = new CommonsBackedPool(
                cluster,
                AbstractIntegrationTest.KEYSPACE,
                config,
                new OperandPolicy(),
                new LeastLoadedNodeSelectionStrategy(),
                new NoOpNodeSuspensionStrategy(),
                new DescribeVersionConnectionValidator()
        );
View Full Code Here

Examples of org.scale7.cassandra.pelops.OperandPolicy

    private CommonsBackedPool configurePool(CommonsBackedPool.Policy config) {
        return new CommonsBackedPool(
                AbstractIntegrationTest.cluster,
                AbstractIntegrationTest.KEYSPACE,
                config,
                new OperandPolicy(),
                new LeastLoadedNodeSelectionStrategy(),
                new NoOpNodeSuspensionStrategy(),
                new NoOpConnectionValidator()
        );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.