Package org.easycassandra.persistence.cassandra.FixKeySpaceUtil

Examples of org.easycassandra.persistence.cassandra.FixKeySpaceUtil.CreateKeySpace


    }

    public void createKeySpace(KeySpaceQueryInformation information, Session session) {

        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(information.getReplicaStrategy());
        try {
            session.execute(createKeySpace.createQuery(information));
        } catch (InvalidQueryException exception) {
            error(information, createKeySpace, exception);
        }
    }
View Full Code Here


    @Test
    public void networkdTest() {
        KeySpaceQueryInformation query = new KeySpaceQueryInformation();
        query.setReplicaStrategy(ReplicaStrategy.NETWORK_TOPOLOGY_STRATEGY);
        query.setKeySpace("javabahia");
        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(query.getReplicaStrategy());
        Assert.assertEquals(
                createKeySpace.createQuery(query),
                NETWORK_TEST);

    }
View Full Code Here

        query.setKeySpace("javabahia");
        Map<String, Integer> map = new LinkedHashMap<>();
        query.setDataCenter(map);
        query.getDataCenter().put("DC1", 1);
        query.getDataCenter().put("DC2", THREE);
        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(query.getReplicaStrategy());
        Assert.assertEquals(
                createKeySpace.createQuery(query),
                NETWORK_DC_TEST);

    }
View Full Code Here

    public void simpleTest() {
        KeySpaceQueryInformation query = new KeySpaceQueryInformation();
        query.setReplicaStrategy(ReplicaStrategy.SIMPLES_TRATEGY);
        query.setKeySpace("javabahia");
        query.setFactor(THREE);
        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(query.getReplicaStrategy());
        Assert.assertEquals(
                createKeySpace.createQuery(query),
                SIMPLE_TEST);

    }
View Full Code Here

    @Test (expected = CreateKeySpaceException.class)
    public void customMandatoryTest() {
        KeySpaceQueryInformation query = new KeySpaceQueryInformation();
        query.setReplicaStrategy(ReplicaStrategy.CUSTOM_STRATEGY);
        query.setKeySpace("javabahia");
        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(query.getReplicaStrategy());
        createKeySpace.createQuery(query);

    }
View Full Code Here

    public void customWithOutBeginTest() {
        KeySpaceQueryInformation query = new KeySpaceQueryInformation();
        query.setReplicaStrategy(ReplicaStrategy.CUSTOM_STRATEGY);
        query.setKeySpace("javabahia");
        query.setCustomQuery(CUSTOM_QUERY_ERRO_TEST);
        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(query.getReplicaStrategy());
        createKeySpace.createQuery(query);

    }
View Full Code Here

    public void customTest() {
        KeySpaceQueryInformation query = new KeySpaceQueryInformation();
        query.setReplicaStrategy(ReplicaStrategy.CUSTOM_STRATEGY);
        query.setKeySpace("javabahia");
        query.setCustomQuery(CUSTOM_QUERY);
        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(query.getReplicaStrategy());

        Assert.assertEquals(createKeySpace.createQuery(query), query.getCustomQuery());

    }
View Full Code Here

TOP

Related Classes of org.easycassandra.persistence.cassandra.FixKeySpaceUtil.CreateKeySpace

Copyright © 2018 www.massapicom. 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.