當前位置: 首頁>>代碼示例>>Java>>正文


Java QueryOptions.setSerialConsistencyLevel方法代碼示例

本文整理匯總了Java中com.datastax.driver.core.QueryOptions.setSerialConsistencyLevel方法的典型用法代碼示例。如果您正苦於以下問題:Java QueryOptions.setSerialConsistencyLevel方法的具體用法?Java QueryOptions.setSerialConsistencyLevel怎麽用?Java QueryOptions.setSerialConsistencyLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.datastax.driver.core.QueryOptions的用法示例。


在下文中一共展示了QueryOptions.setSerialConsistencyLevel方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
private void configureQueryOptions() {

        final String consistencyConfiguration = (String) configuration.get(TRIDENT_CASSANDRA_CONSISTENCY);
        final String serialConsistencyConfiguration = (String) configuration.get(TRIDENT_CASSANDRA_SERIAL_CONSISTENCY);
        final QueryOptions queryOptions = builder.getConfiguration().getQueryOptions();

        if (StringUtils.isNotEmpty(consistencyConfiguration)) {
            queryOptions.setConsistencyLevel(ConsistencyLevel.valueOf(consistencyConfiguration));
        }

        if (StringUtils.isNotEmpty(serialConsistencyConfiguration)) {
            queryOptions.setSerialConsistencyLevel(ConsistencyLevel.valueOf(serialConsistencyConfiguration));
        }

        builder = builder.withQueryOptions(queryOptions);

    }
 
開發者ID:hpcc-systems,項目名稱:storm-cassandra-cql,代碼行數:18,代碼來源:MapConfiguredCqlClientFactory.java

示例2: configureQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
/**
 * Creates the query options for this factory.
 * 
 * @param configuration the configuration.
 * @return the query options for this factory.
 */
private QueryOptions configureQueryOptions(final Configuration<Map<String, Object>> configuration) {
	final QueryOptions queryOptions = new QueryOptions();

	queryOptions.setConsistencyLevel(
				ConsistencyLevel.valueOf(
						configuration.getParameter(
								"consistency_level",
								"ONE")));

	queryOptions.setSerialConsistencyLevel(
				ConsistencyLevel.valueOf(
						configuration.getParameter(
								"serial_consistency_level",
								"ONE")));

	queryOptions.setFetchSize(configuration.getParameter(
					"fetch_size",
					1000));

	return queryOptions;
}
 
開發者ID:spaziocodice,項目名稱:jena-nosql,代碼行數:28,代碼來源:CassandraStorageLayerFactory.java

示例3: populateQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
private Cluster.Builder populateQueryOptions(Properties properties, Cluster.Builder builder) {
  String consistencyLevelProp = properties.getProperty(CassandraStoreParameters.CONSISTENCY_LEVEL);
  String serialConsistencyLevelProp = properties.getProperty(CassandraStoreParameters.SERIAL_CONSISTENCY_LEVEL);
  String fetchSize = properties.getProperty(CassandraStoreParameters.FETCH_SIZE);
  QueryOptions options = new QueryOptions();
  if (consistencyLevelProp != null) {
    options.setConsistencyLevel(ConsistencyLevel.valueOf(consistencyLevelProp));
  }
  if (serialConsistencyLevelProp != null) {
    options.setSerialConsistencyLevel(ConsistencyLevel.valueOf(serialConsistencyLevelProp));
  }
  if (fetchSize != null) {
    options.setFetchSize(Integer.parseInt(fetchSize));
  }
  return builder.withQueryOptions(options);
}
 
開發者ID:apache,項目名稱:gora,代碼行數:17,代碼來源:CassandraClient.java

示例4: populateQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
private Builder populateQueryOptions(Map<String, String> properties, Builder builder) {
    String consistencyLevelProp = properties.get(DBConstants.Cassandra.CONSISTENCY_LEVEL);
    String serialConsistencyLevelProp = properties.get(DBConstants.Cassandra.SERIAL_CONSISTENCY_LEVEL);
    String fetchSize = properties.get(DBConstants.Cassandra.FETCH_SIZE);
    QueryOptions options = new QueryOptions();
    if (consistencyLevelProp != null) {
        options.setConsistencyLevel(ConsistencyLevel.valueOf(consistencyLevelProp));
    }
    if (serialConsistencyLevelProp != null) {
        options.setSerialConsistencyLevel(ConsistencyLevel.valueOf(serialConsistencyLevelProp));
    }
    if (fetchSize != null) {
        options.setFetchSize(Integer.parseInt(fetchSize));
    }
    return builder.withQueryOptions(options);
}
 
開發者ID:wso2,項目名稱:carbon-data,代碼行數:17,代碼來源:CassandraConfig.java

示例5: getQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
private QueryOptions getQueryOptions(CassandraProperties properties) {
    QueryOptions options = new QueryOptions();
    if (properties.getConsistencyLevel() != null) {
        options.setConsistencyLevel(properties.getConsistencyLevel());
    }
    if (properties.getSerialConsistencyLevel() != null) {
        options.setSerialConsistencyLevel(properties.getSerialConsistencyLevel());
    }
    options.setFetchSize(properties.getFetchSize());
    return options;
}
 
開發者ID:ElectronicArmory,項目名稱:Armory,代碼行數:12,代碼來源:CassandraConfiguration.java

示例6: getQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
private static QueryOptions getQueryOptions(CassandraProperties properties) {
    QueryOptions options = new QueryOptions();
    if (properties.getConsistencyLevel() != null) {
        options.setConsistencyLevel(properties.getConsistencyLevel());
    }
    if (properties.getSerialConsistencyLevel() != null) {
        options.setSerialConsistencyLevel(properties.getSerialConsistencyLevel());
    }
    options.setFetchSize(properties.getFetchSize());
    return options;
}
 
開發者ID:xm-online,項目名稱:xm-gate,代碼行數:12,代碼來源:CassandraConfiguration.java

示例7: getQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
private QueryOptions getQueryOptions() {
    QueryOptions options = new QueryOptions();
    if (eventStoreConfig.getConsistencyLevel() != null) {
        options.setConsistencyLevel(eventStoreConfig.getConsistencyLevel());
    }
    if (eventStoreConfig.getSerialConsistencyLevel() != null) {
        options.setSerialConsistencyLevel(eventStoreConfig.getSerialConsistencyLevel());
    }
    options.setFetchSize(eventStoreConfig.getFetchSize());
    return options;
}
 
開發者ID:kloiasoft,項目名稱:eventapis,代碼行數:12,代碼來源:CassandraSession.java

示例8: getQueryOptions

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
private QueryOptions getQueryOptions() {
	QueryOptions options = new QueryOptions();
	CassandraProperties properties = this.properties;
	if (properties.getConsistencyLevel() != null) {
		options.setConsistencyLevel(properties.getConsistencyLevel());
	}
	if (properties.getSerialConsistencyLevel() != null) {
		options.setSerialConsistencyLevel(properties.getSerialConsistencyLevel());
	}
	options.setFetchSize(properties.getFetchSize());
	return options;
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:13,代碼來源:CassandraAutoConfiguration.java

示例9: getClusterBuilder

import com.datastax.driver.core.QueryOptions; //導入方法依賴的package包/類
public Cluster.Builder getClusterBuilder() {

        final List<InetSocketAddress> sockets = new ArrayList<InetSocketAddress>();
        for (String host : hosts) {
            if(StringUtils.contains(host, ":")) {
                String hostParts [] = StringUtils.split(host, ":");
                sockets.add(new InetSocketAddress(hostParts[0], Integer.valueOf(hostParts[1])));
                LOG.debug("Connecting to [" + host + "] with port [" + hostParts[1] + "]");
            } else {
                sockets.add(new InetSocketAddress(host, ProtocolOptions.DEFAULT_PORT));
                LOG.debug("Connecting to [" + host + "] with port [" + ProtocolOptions.DEFAULT_PORT + "]");
            }
        }

        Cluster.Builder builder = Cluster.builder().addContactPointsWithPorts(sockets).withCompression(compression);
        QueryOptions queryOptions = new QueryOptions();
        queryOptions.setConsistencyLevel(clusterConsistencyLevel);
        queryOptions.setSerialConsistencyLevel(serialConsistencyLevel);
        builder = builder.withQueryOptions(queryOptions);

        if (StringUtils.isNotEmpty(clusterName)) {
            builder = builder.withClusterName(clusterName);
        }

        return builder;

    }
 
開發者ID:hpcc-systems,項目名稱:storm-cassandra-cql,代碼行數:28,代碼來源:ConstructorConfiguredCqlClientFactory.java


注:本文中的com.datastax.driver.core.QueryOptions.setSerialConsistencyLevel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。