Package com.datastax.driver.core

Examples of com.datastax.driver.core.ConsistencyLevel


        Table table = AnnotationChecks.getTypeAnnotation(Table.class, entityClass);

        String ksName = table.caseSensitiveKeyspace() ? table.keyspace() : table.keyspace().toLowerCase();
        String tableName = table.caseSensitiveTable() ? table.name() : table.name().toLowerCase();

        ConsistencyLevel writeConsistency = table.writeConsistency().isEmpty() ? null : ConsistencyLevel.valueOf(table.writeConsistency().toUpperCase());
        ConsistencyLevel readConsistency = table.readConsistency().isEmpty() ? null : ConsistencyLevel.valueOf(table.readConsistency().toUpperCase());

        if (Strings.isNullOrEmpty(table.keyspace())) {
            ksName = mappingManager.getSession().getLoggedKeyspace();
            if (Strings.isNullOrEmpty(ksName))
                throw new IllegalArgumentException(String.format(
View Full Code Here


                    throw new IllegalArgumentException(String.format("For method '%s', either all or none of the paramaters of a method must have a @Param annotation", m.getName()));

                paramMappers[i] = newParamMapper(accClass.getName(), m.getName(), i, paramName, paramTypes[i], paramAnnotations[i], mappingManager);
            }

            ConsistencyLevel cl = null;
            int fetchSize = -1;
            boolean tracing = false;

            QueryParameters options = m.getAnnotation(QueryParameters.class);
            if (options != null) {
View Full Code Here

                    waitOnReconnection(h);
                    if (h.isUp())
                        return h;
                }

                ConsistencyLevel cl = statement.getConsistencyLevel() == null
                                    ? configuration.getQueryOptions().getConsistencyLevel()
                                    : statement.getConsistencyLevel();

                if (dontHopForLocalCL && cl.isDCLocal())
                    return endOfData();

                if (remoteDcs == null) {
                    Set<String> copy = new HashSet<String>(perDcLiveHosts.keySet());
                    copy.remove(localDc);
View Full Code Here

     */
    @Override
    public Iterator<Host> newQueryPlan(String loggedKeyspace, Statement statement) {

        if (!hasLoggedLocalCLUse) {
            ConsistencyLevel cl = statement.getConsistencyLevel() == null
                                ? configuration.getQueryOptions().getConsistencyLevel()
                                : statement.getConsistencyLevel();
            if (cl.isDCLocal()) {
                hasLoggedLocalCLUse = true;
                logger.warn("Detected request at Consistency Level {} but the non-DC aware RoundRobinPolicy is in use. "
                          + "It is strongly advised to use DCAwareRoundRobinPolicy if you have multiple DCs/use DC-aware consistency levels "
                          + "(note: this message will only be logged once)", statement.getConsistencyLevel());
            }
View Full Code Here

                            c += currentDcHosts.size();
                        }
                        return currentDcHosts.get(c);
                    }

                    ConsistencyLevel cl = statement.getConsistencyLevel() == null
                                        ? queryOptions.getConsistencyLevel()
                                        : statement.getConsistencyLevel();

                    if (dontHopForLocalCL && cl.isDCLocal())
                        return endOfData();

                    if (remoteDcs == null) {
                        Set<String> copy = new HashSet<String>(perDcLiveHosts.keySet());
                        copy.remove(localDc);
View Full Code Here

    @Override
    public Iterator<Host> newQueryPlan(String loggedKeyspace, Statement statement) {

        if (!hasLoggedLocalCLUse)
        {
            ConsistencyLevel cl = statement.getConsistencyLevel() == null
                                ? queryOptions.getConsistencyLevel()
                                : statement.getConsistencyLevel();
            if (cl.isDCLocal()) {
                hasLoggedLocalCLUse = true;
                logger.warn("Detected request at Consistency Level {} but the non-DC aware RoundRobinPolicy is in use. "
                          + "It is strongly advised to use DCAwareRoundRobinPolicy if you have multiple DCs/use DC-aware consistency levels "
                          + "(note: this message will only be logged once)", statement.getConsistencyLevel());
            }
View Full Code Here

        StringBuilder execInfo = new StringBuilder();
        for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) {
            if (executionInfo == null)
                continue;
            Host qh = executionInfo.getQueriedHost();
            ConsistencyLevel cl = executionInfo.getAchievedConsistencyLevel();
            QueryTrace queryTrace = executionInfo.getQueryTrace();
            execInfo.append("\n    exeuction info: queried-host=[address=").append(qh.getAddress()).
                append(", version=").append(qh.getCassandraVersion()).
                append(", dc=").append(qh.getDatacenter()).
                append(", rac=").append(qh.getRack()).
View Full Code Here

                    waitOnReconnection(h);
                    if (h.isUp())
                        return h;
                }

                ConsistencyLevel cl = statement.getConsistencyLevel() == null
                                    ? configuration.getQueryOptions().getConsistencyLevel()
                                    : statement.getConsistencyLevel();

                if (dontHopForLocalCL && cl.isDCLocal())
                    return endOfData();

                if (remoteDcs == null) {
                    Set<String> copy = new HashSet<String>(perDcLiveHosts.keySet());
                    copy.remove(localDc);
View Full Code Here

     */
    @Override
    public Iterator<Host> newQueryPlan(String loggedKeyspace, Statement statement) {

        if (!hasLoggedLocalCLUse) {
            ConsistencyLevel cl = statement.getConsistencyLevel() == null
                                ? configuration.getQueryOptions().getConsistencyLevel()
                                : statement.getConsistencyLevel();
            if (cl.isDCLocal()) {
                hasLoggedLocalCLUse = true;
                logger.warn("Detected request at Consistency Level {} but the non-DC aware RoundRobinPolicy is in use. "
                          + "It is strongly advised to use DCAwareRoundRobinPolicy if you have multiple DCs/use DC-aware consistency levels "
                          + "(note: this message will only be logged once)", statement.getConsistencyLevel());
            }
View Full Code Here

                    waitOnReconnection(h);
                    if (h.isUp())
                        return h;
                }

                ConsistencyLevel cl = statement.getConsistencyLevel() == null
                                    ? configuration.getQueryOptions().getConsistencyLevel()
                                    : statement.getConsistencyLevel();

                if (dontHopForLocalCL && cl.isDCLocal())
                    return endOfData();

                if (remoteDcs == null) {
                    Set<String> copy = new HashSet<String>(perDcLiveHosts.keySet());
                    copy.remove(localDc);
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.ConsistencyLevel

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.