Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update mdbc project
  • Loading branch information
Tschaen, Brendan (bt054f) committed Jun 18, 2018
1 parent ae7db74 commit fe34488
Show file tree
Hide file tree
Showing 36 changed files with 4,634 additions and 366 deletions.
7 changes: 5 additions & 2 deletions recipes/mdbc/README.md
Expand Up @@ -48,7 +48,7 @@ call to influence how MDBC works.

| Property Name | Property Value | Default Value |
|--------------------|--------------------------------------------------------------------------------|---------------|
| MDBC\_DB\_MIXIN | The mixin name to use to select the database mixin to use for this connection. | h2 |
| MDBC\_DB\_MIXIN | The mixin name to use to select the database mixin to use for this connection. | mysql |
| MDBC\_MUSIC\_MIXIN | The mixin name to use to select the MUSIC mixin to use for this connection. | cassandra2 |
| myid | The ID of this replica in the collection of replicas sharing the same tables. | 0 |
| replicas | A comma-separated list of replica names for the collection of replicas sharing the same tables. | the value of myid |
Expand All @@ -63,7 +63,7 @@ The values of the mixin properties may be:
|--------------------|----------------|---------------|
| MDBC\_DB\_MIXIN | h2 | This mixin provides access to either an in-memory, or a local (file-based) version of the H2 database. |
| MDBC\_DB\_MIXIN | h2server | This mixin provides access to a copy of the H2 database running as a server. Because the server needs special Java classes in order to handle certain TRIGGER actions, the server must be et up in a special way (see below). |
| MDBC\_DB\_MIXIN | mysql | This mixin provides access to MySQL or MariaDB running on a remote server. |
| MDBC\_DB\_MIXIN | mysql | This mixin provides access to MySQL or MariaDB (10.2+) running on a remote server. |
| MDBC\_MUSIC\_MIXIN | cassandra | A Cassandra based persistence layer (without any of the table locking that MUSIC normally provides). |
| MDBC\_MUSIC\_MIXIN | cassandra2 | Similar to the _cassandra_ mixin, but stores all dirty row information in one table, rather than one table per real table. |

Expand Down Expand Up @@ -157,3 +157,6 @@ will be no longer than 512 bytes. If this is not true, you should adjust, edit,

* MDBC is limited to only data types that can be easily translated to a Cassandra equivalent;
e.g. BIGINT, BOOLEAN, BLOB, DOUBLE, INT, TIMESTAMP, VARCHAR

* To find the data types that your database is currently using run the following command:
SELECT DISTINCT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='<your db name here>';
40 changes: 33 additions & 7 deletions recipes/mdbc/pom.xml
Expand Up @@ -15,20 +15,15 @@
</properties>

<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>3.0.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.168</version>
<version>1.4.195</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -45,6 +40,8 @@
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency>


<!-- These two dependencies pull in optional libraries for Cassandra -->
<dependency>
<groupId>net.jpountz.lz4</groupId>
Expand All @@ -68,6 +65,35 @@
<version>1.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.att.eelf</groupId>
<artifactId>eelf-core</artifactId>
<version>1.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<!-- Music jar from onap -->
<dependency>
<groupId>org.onap.music</groupId>
<artifactId>MUSIC</artifactId>
<version>2.5.4</version>
</dependency>
</dependencies>

<build>
Expand Down
@@ -0,0 +1,84 @@
/*
* ============LICENSE_START==========================================
* org.onap.music
* ===================================================================
* Copyright (c) 2017 AT&T Intellectual Property
* ===================================================================
* 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.
*
* ============LICENSE_END=============================================
* ====================================================================
*/

package com.att.research.exceptions;

/**
* @author inam
*
*/
public class MDBCServiceException extends Exception {


private int errorCode;
private String errorMessage;

public int getErrorCode() {
return errorCode;
}


public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}


public String getErrorMessage() {
return errorMessage;
}


public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}


public MDBCServiceException() {
super();
}


public MDBCServiceException(String message) {
super(message);

}


public MDBCServiceException(Throwable cause) {
super(cause);

}


public MDBCServiceException(String message, Throwable cause) {
super(message, cause);

}


public MDBCServiceException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);

}

}
@@ -0,0 +1,89 @@
/*
* ============LICENSE_START==========================================
* org.onap.music
* ===================================================================
* Copyright (c) 2017 AT&T Intellectual Property
* ===================================================================
* 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.
*
* ============LICENSE_END=============================================
* ====================================================================
*/
package com.att.research.exceptions;



/**
* @author inam
*
*/
public class QueryException extends Exception {

/**
*
*/
private static final long serialVersionUID = 1L;
private int errorCode;


/**
*
*/
public QueryException() {
super();
}

/**
* @param message
*/
public QueryException(String message) {
super(message);
}



/**
* @param message
*/
public QueryException(String message, int errorCode) {
super(message);
this.errorCode = errorCode;
}

/**
* @param cause
*/
public QueryException(Throwable cause) {
super(cause);
}

/**
* @param message
* @param cause
*/
public QueryException(String message, Throwable cause) {
super(message, cause);
}

/**
* @param message
* @param cause
* @param enableSuppression
* @param writableStackTrace
*/
public QueryException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}

}

0 comments on commit fe34488

Please sign in to comment.