systems.composable.dropwizard.cassandra.pooling.HostDistanceOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-cassandra Show documentation
Show all versions of dropwizard-cassandra Show documentation
Cassandra library for Dropwizard
The newest version!
/*
* Copyright 2016 Composable Systems Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package systems.composable.dropwizard.cassandra.pooling;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.Min;
/**
* A factory for configuring and building {@link com.datastax.driver.core.PoolingOptions} instances.
*
* Configuration Parameters:
*
*
* Name
* Default
* Description
*
*
* maxRequestsPerConnection
* Default is dependent on protocol version. See driver docs for details.
* The maximum number of connections per host.
*
*
* newConnectionThreshold
* Default is dependent on protocol version. See driver docs for details.
* The threshold that triggers the creation of a new connection to a host.
*
*
* coreConnections
* No default. You must specify core connections.
* The core number of connections per host.
*
*
* maxConnections
* No default. You must specify maximum connections.
* The maximum number of connections per host.
*
*
*/
public class HostDistanceOptions {
@Min(0)
private Integer maxRequestsPerConnection;
@Min(0)
private Integer newConnectionThreshold;
@Min(0)
private Integer coreConnections;
@Min(0)
private Integer maxConnections;
@JsonProperty
public Integer getMaxRequestsPerConnection() {
return maxRequestsPerConnection;
}
@JsonProperty
public void setMaxRequestsPerConnection(Integer maxRequestsPerConnection) {
this.maxRequestsPerConnection = maxRequestsPerConnection;
}
@JsonProperty
public Integer getNewConnectionThreshold() {
return newConnectionThreshold;
}
@JsonProperty
public void setNewConnectionThreshold(Integer newConnectionThreshold) {
this.newConnectionThreshold = newConnectionThreshold;
}
@JsonProperty
public Integer getCoreConnections() {
return coreConnections;
}
@JsonProperty
public void setCoreConnections(Integer coreConnections) {
this.coreConnections = coreConnections;
}
@JsonProperty
public Integer getMaxConnections() {
return maxConnections;
}
@JsonProperty
public void setMaxConnections(Integer maxConnections) {
this.maxConnections = maxConnections;
}
}