Java Code Examples for com.datastax.driver.core.ProtocolOptions#Compression

The following examples show how to use com.datastax.driver.core.ProtocolOptions#Compression . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConstructorConfiguredCqlClientFactory.java    From storm-cassandra-cql with Apache License 2.0 5 votes vote down vote up
public ConstructorConfiguredCqlClientFactory(String hosts, String clusterName, ConsistencyLevel clusterConsistency,
                        ConsistencyLevel conditionalUpdateConsistency, ProtocolOptions.Compression compression) {
    this.hosts = hosts.split(",");
    this.clusterConsistencyLevel = clusterConsistency;
    if (conditionalUpdateConsistency != null){
        this.serialConsistencyLevel = conditionalUpdateConsistency;
    }
    if (clusterName != null) {
        this.clusterName = clusterName;
    }
    this.compression = compression;
}
 
Example 2
Source File: CassandraConfig.java    From realtime-analytics with GNU General Public License v2.0 4 votes vote down vote up
public ProtocolOptions.Compression getCompression() {
    return compression;
}
 
Example 3
Source File: CassandraConfig.java    From realtime-analytics with GNU General Public License v2.0 4 votes vote down vote up
public void setCompression(ProtocolOptions.Compression compression) {
    this.compression = compression;
}
 
Example 4
Source File: SettingsMode.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
public ProtocolOptions.Compression compression()
{
    return ProtocolOptions.Compression.valueOf(compression);
}
 
Example 5
Source File: CloudCassandraSessionParser.java    From spring-cloud-connectors with Apache License 2.0 4 votes vote down vote up
@Override
protected void doParse(Element element, ParserContext parserContext,
		BeanDefinitionBuilder builder) {
	super.doParse(element, parserContext, builder);

	Element optionsElement = DomUtils.getChildElementByTagName(element,
			ELEMENT_CASSANDRA_OPTIONS);

	BeanDefinitionBuilder beanBuilder = BeanDefinitionBuilder
			.genericBeanDefinition(CassandraClusterConfig.class.getName());

	if (optionsElement != null) {
		String compressionString = optionsElement.getAttribute(COMPRESSION_ATTRIBUTE);
		if (!StringUtils.isEmpty(compressionString)) {
			ProtocolOptions.Compression compression = ProtocolOptions.Compression
					.valueOf(compressionString);
			beanBuilder.addPropertyValue("compression", compression);
		}

		String retryPolicyString = optionsElement
				.getAttribute(RETRY_POLICY_ATTRIBUTE);
		if (!StringUtils.isEmpty(retryPolicyString)) {
			beanBuilder.addPropertyReference("retryPolicy", retryPolicyString);
		}

		String loadBalancingPolicyString = optionsElement
				.getAttribute(LOAD_BALANCING_POLICY_ATTRIBUTE);
		if (!StringUtils.isEmpty(loadBalancingPolicyString)) {
			beanBuilder.addPropertyReference("loadBalancingPolicy",
					loadBalancingPolicyString);
		}

		String socketOptionsString = optionsElement
				.getAttribute(SOCKET_OPTIONS_ATTRIBUTE);
		if (!StringUtils.isEmpty(socketOptionsString)) {
			beanBuilder.addPropertyReference("socketOptions", socketOptionsString);
		}

		String reconnectionPolicyString = optionsElement
				.getAttribute(RECONNECTION_POLICY_ATTRIBUTE);
		if (!StringUtils.isEmpty(reconnectionPolicyString)) {
			beanBuilder.addPropertyReference("reconnectionPolicy",
					reconnectionPolicyString);
		}

	}

	builder.addConstructorArgValue(beanBuilder.getBeanDefinition());
}