Add Cassandra db support
Added Cassandra configuration Java class in the common project similar to existing db. Change-Id: I9aa250bab206438f9b98bd211d472c0d8fe12bde story: 2001231 task: 5957
This commit is contained in:
parent
1a7cb82971
commit
9258e7efc2
19
java/monasca-common-cassandra/pom.xml
Normal file
19
java/monasca-common-cassandra/pom.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>monasca-common</groupId>
|
||||
<artifactId>monasca-common</artifactId>
|
||||
<version>${computedVersion}</version>
|
||||
</parent>
|
||||
<artifactId>monasca-common-cassandra</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* (c) Copyright 2017 SUSE LLC.
|
||||
*
|
||||
* 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 monasca.common.configuration;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class CassandraDbConfiguration {
|
||||
|
||||
@JsonProperty
|
||||
int maxConnections;
|
||||
|
||||
public int getMaxConnections() {
|
||||
return maxConnections;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int maxRequests;
|
||||
|
||||
public int getMaxRequests() {
|
||||
return maxRequests;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int connectionTimeout;
|
||||
|
||||
public int getConnectionTimeout() {
|
||||
return connectionTimeout;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int readTimeout;
|
||||
|
||||
public int getReadTimeout() {
|
||||
return readTimeout;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
String[] contactPoints;
|
||||
|
||||
public String[] getContactPoints() {
|
||||
return contactPoints;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int port;
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int readConsistencyLevel;
|
||||
|
||||
@JsonProperty
|
||||
String consistencyLevel;
|
||||
|
||||
public String getConsistencyLevel() {
|
||||
return consistencyLevel;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
String keyspace;
|
||||
|
||||
public String getKeySpace() {
|
||||
return keyspace;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
String user;
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
String password;
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
long maxDefinitionCacheSize;
|
||||
|
||||
public long getDefinitionMaxCacheSize() {
|
||||
return maxDefinitionCacheSize;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int maxWriteRetries;
|
||||
|
||||
public int getMaxWriteRetries() {
|
||||
return maxWriteRetries;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int maxBatches;
|
||||
|
||||
public int getMaxBatches() {
|
||||
return maxBatches;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
int retentionPolicy;
|
||||
|
||||
public int getRetentionPolicy() {
|
||||
return retentionPolicy;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
String localDataCenter;
|
||||
|
||||
public String getLocalDataCenter() {
|
||||
return localDataCenter;
|
||||
}
|
||||
}
|
@ -38,6 +38,7 @@
|
||||
<module>monasca-common-middleware</module>
|
||||
<module>monasca-common-influxdb</module>
|
||||
<module>monasca-common-hibernate</module>
|
||||
<module>monasca-common-cassandra</module>
|
||||
</modules>
|
||||
|
||||
<profiles>
|
||||
|
Loading…
x
Reference in New Issue
Block a user