1) Create a configuration file using as a template:
-src/main/java/com/att/research/mdbc/configurations/tableConfiguration.json
+src/main/java/org/onap/music/mdbc/configurations/tableConfiguration.json
The meaning of the fields is as follows:
2) Create the configuration for each node using the command line program in the following location:
-src/main/java/com/att/research/mdbc/tools/CreateNodeConfiguration.java
+src/main/java/org/onap/music/mdbc/tools/CreateNodeConfiguration.java
To run it, use the following parameters:
--t ../ETDB/src/main/java/com/att/research/mdbc/configurations/tableConfiguration.json -b base -o /Users/quique/Desktop/
+-t ../ETDB/src/main/java/org/onap/music/mdbc/configurations/tableConfiguration.json -b base -o /Users/quique/Desktop/
This program is going to generate all the required configuration json for each ETDB node in the system and additionally initialize all the corresponding rows and tables for the system to correctly work. The meaning of the parameters is:
• -t: the tableConfiguration.json explained in the step 1
3) Run each of the server in its corresponding node: The ETDB server can be found in the file:
-src/main/java/com/att/research/mdbc/MdbcServer.java
+src/main/java/org/onap/music/mdbc/MdbcServer.java
It requires three parameters:
- -c ../ETDB/src/main/java/com/att/research/mdbc/configurations/config-0.json -u jdbc:mysql://localhost -p 30000
+ -c ../ETDB/src/main/java/org/onap/music/mdbc/configurations/config-0.json -u jdbc:mysql://localhost -p 30000
-c is a json with the configuration created in step 2.
• -u is where the local mysql database is located (without the database name, just the url, see example)
4) Run the clients. A client example can be found in this folder:
-src/main/java/com/att/research/mdbc/examples
+src/main/java/org/onap/music/mdbc/examples
## Building METRIC
3. If you supply properties to the DriverManager.getConnection(String, Properties) call,
use the properties defined below to control behavior of the proxy.
4. Load the driver using the following call:
- Class.forName("com.att.research.mdbc.ProxyDriver");
+ Class.forName("org.onap.music.mdbc.ProxyDriver");
The following properties can be passed to the JDBC DriverManager.getConnection(String, Properties)
call to influence how METRIC works.
</security>
</datasource>
<drivers>
- <driver name="mdbc" module="com.att.research.mdbc">
- <driver-class>com.att.research.mdbc.ProxyDriver</driver-class>
+ <driver name="mdbc" module="org.onap.music.mdbc">
+ <driver-class>org.onap.music.mdbc.ProxyDriver</driver-class>
</driver>
</drivers>
</datasources>
```
-Note: This assumes that you have built and installed the com.att.research.mdbc module within JBoss.
+Note: This assumes that you have built and installed the org.onap.music.mdbc module within JBoss.
### To Define a Tomcat DataSource Resource
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
uniqueResourceName="process-engine"
- driverClassName="com.att.research.mdbc.ProxyDriver"
+ driverClassName="org.onap.music.mdbc.ProxyDriver"
url="jdbc:mdbc:./camunda-h2-dbs/process-engine;MVCC=TRUE;TRACE_LEVEL_FILE=0;DB_CLOSE_ON_EXIT=FALSE"
connectionProperties="myid=0;replicas=0,1,2;music_keyspace=camunda;music_address=localhost"
username="sa"
## Testing Mixin Combinations
-The files under `src/main/java/com/att/research/mdbc/tests` can be used to test various METRIC
+The files under `src/main/java/org/onap/music/mdbc/tests` can be used to test various METRIC
operations with various combinations of Mixins. The tests are controlled via the file
`src/main/resources/tests.json`. More details are available in the javadoc for this package.
<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>
- <groupId>com.att.research.mdbc</groupId>
+ <groupId>org.onap.music.mdbc</groupId>
<artifactId>mdbc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mdbc</name>
* ====================================================================
*/
-package com.att.research.exceptions;
+package org.onap.music.exceptions;
/**
* @author inam
* ============LICENSE_END=============================================
* ====================================================================
*/
-package com.att.research.exceptions;
+package org.onap.music.exceptions;
-package com.att.research.logging;
+package org.onap.music.logging;
import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN;
import static com.att.eelf.configuration.Configuration.MDC_SERVER_IP_ADDRESS;
* ====================================================================
*/
-package com.att.research.logging.format;
+package org.onap.music.logging.format;
/**
* @author inam
* ============LICENSE_END=============================================
* ====================================================================
*/
-package com.att.research.logging.format;
+package org.onap.music.logging.format;
/**
* @author inam
* ============LICENSE_END=============================================
* ====================================================================
*/
-package com.att.research.logging.format;
+package org.onap.music.logging.format;
import com.att.eelf.i18n.EELFResolvableErrorEnum;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import org.json.JSONObject;
-import com.att.research.mdbc.mixins.DBInterface;
-import com.att.research.mdbc.mixins.MusicInterface;
+import org.onap.music.mdbc.mixins.DBInterface;
+import org.onap.music.mdbc.mixins.MusicInterface;
public class ArchiveProcess {
protected MusicInterface mi;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
public class Configuration {
/** The property name to use to connect to cassandra*/
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.logging.EELFLoggerDelegate;
import org.onap.music.datastore.PreparedQueryObject;
import org.onap.music.exceptions.MusicLockingException;
import org.onap.music.exceptions.MusicQueryException;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Set;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.logging.EELFLoggerDelegate;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
public class LockId {
private String primaryKey;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.io.*;
import java.util.Base64;
import java.util.Deque;
import java.util.HashMap;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.logging.format.AppMessages;
-import com.att.research.logging.format.ErrorSeverity;
-import com.att.research.logging.format.ErrorTypes;
-import com.att.research.mdbc.tables.Operation;
-import com.att.research.mdbc.tables.StagingTable;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.logging.format.AppMessages;
+import org.onap.music.logging.format.ErrorSeverity;
+import org.onap.music.logging.format.ErrorTypes;
+import org.onap.music.mdbc.tables.Operation;
+import org.onap.music.mdbc.tables.StagingTable;
import javassist.bytecode.Descriptor.Iterator;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.io.InputStream;
import java.io.Reader;
import java.util.Calendar;
import java.util.Map;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.logging.EELFLoggerDelegate;
/**
* ProxyStatement is a proxy Statement that front ends Statements from the underlying JDBC driver. It passes all operations through,
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.sql.Array;
import java.sql.Blob;
import java.util.Properties;
import java.util.concurrent.Executor;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.exceptions.QueryException;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.logging.format.AppMessages;
-import com.att.research.logging.format.ErrorSeverity;
-import com.att.research.logging.format.ErrorTypes;
-import com.att.research.mdbc.mixins.MusicInterface;
-import com.att.research.mdbc.tables.TxCommitProgress;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.exceptions.QueryException;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.logging.format.AppMessages;
+import org.onap.music.logging.format.ErrorSeverity;
+import org.onap.music.logging.format.ErrorTypes;
+import org.onap.music.mdbc.mixins.MusicInterface;
+import org.onap.music.mdbc.tables.TxCommitProgress;
/**
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.io.InputStream;
import java.io.Reader;
import org.apache.commons.lang3.StringUtils;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.logging.EELFLoggerDelegate;
/**
* ProxyStatement is a proxy Statement that front ends Statements from the underlying JDBC driver. It passes all operations through,
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* limitations under the License.
*/
-import com.att.research.mdbc.configurations.NodeConfiguration;
+import org.onap.music.mdbc.configurations.NodeConfiguration;
import org.apache.calcite.avatica.remote.Driver.Serialization;
import org.apache.calcite.avatica.remote.LocalService;
import org.apache.calcite.avatica.server.HttpServer;
import org.apache.calcite.avatica.util.Unsafe;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.logging.EELFLoggerDelegate;
import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.mdbc.configurations.NodeConfiguration;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.mdbc.configurations.NodeConfiguration;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalListener;
import org.apache.calcite.avatica.jdbc.JdbcMeta;
import org.apache.calcite.avatica.remote.TypedValue;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.logging.format.AppMessages;
-import com.att.research.logging.format.ErrorSeverity;
-import com.att.research.logging.format.ErrorTypes;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.logging.format.AppMessages;
+import org.onap.music.logging.format.ErrorSeverity;
+import org.onap.music.logging.format.ErrorTypes;
public class MdbcServerLogic extends JdbcMeta{
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLWarning;
import java.sql.Statement;
-import com.att.research.exceptions.QueryException;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.logging.format.AppMessages;
-import com.att.research.logging.format.ErrorSeverity;
-import com.att.research.logging.format.ErrorTypes;
+import org.onap.music.exceptions.QueryException;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.logging.format.AppMessages;
+import org.onap.music.logging.format.ErrorSeverity;
+import org.onap.music.logging.format.ErrorTypes;
/**
* ProxyStatement is a proxy Statement that front ends Statements from the underlying JDBC driver. It passes all operations through,
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.sql.Connection;
import java.util.*;
import org.json.JSONObject;
-import com.att.research.mdbc.mixins.DBInterface;
-import com.att.research.mdbc.mixins.MixinFactory;
-import com.att.research.mdbc.mixins.MusicInterface;
-import com.att.research.mdbc.mixins.Utils;
-import com.att.research.mdbc.tables.StagingTable;
-import com.att.research.mdbc.tables.TxCommitProgress;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.exceptions.QueryException;
-import com.att.research.logging.*;
-import com.att.research.logging.format.AppMessages;
-import com.att.research.logging.format.ErrorSeverity;
-import com.att.research.logging.format.ErrorTypes;
+import org.onap.music.mdbc.mixins.DBInterface;
+import org.onap.music.mdbc.mixins.MixinFactory;
+import org.onap.music.mdbc.mixins.MusicInterface;
+import org.onap.music.mdbc.mixins.Utils;
+import org.onap.music.mdbc.tables.StagingTable;
+import org.onap.music.mdbc.tables.TxCommitProgress;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.exceptions.QueryException;
+import org.onap.music.logging.*;
+import org.onap.music.logging.format.AppMessages;
+import org.onap.music.logging.format.ErrorSeverity;
+import org.onap.music.logging.format.ErrorTypes;
/**
* <p>
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.io.InputStream;
import java.io.Reader;
import org.apache.log4j.Logger;
-import com.att.research.exceptions.QueryException;
+import org.onap.music.exceptions.QueryException;
/**
* ProxyStatement is a proxy Statement that front ends Statements from the underlying JDBC driver. It passes all operations through,
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.io.Serializable;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
public class RedoRow {
private String redoTableName;
-package com.att.research.mdbc;
-
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.logging.format.AppMessages;
-import com.att.research.logging.format.ErrorSeverity;
-import com.att.research.logging.format.ErrorTypes;
-import com.att.research.mdbc.mixins.MixinFactory;
-import com.att.research.mdbc.mixins.MusicInterface;
-import com.att.research.mdbc.mixins.MusicMixin;
-import com.att.research.mdbc.tables.TxCommitProgress;
+package org.onap.music.mdbc;
+
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.logging.format.AppMessages;
+import org.onap.music.logging.format.ErrorSeverity;
+import org.onap.music.logging.format.ErrorTypes;
+import org.onap.music.mdbc.mixins.MixinFactory;
+import org.onap.music.mdbc.mixins.MusicInterface;
+import org.onap.music.mdbc.mixins.MusicMixin;
+import org.onap.music.mdbc.tables.TxCommitProgress;
import java.sql.Connection;
import java.sql.DriverManager;
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
import java.sql.Types;
import java.util.ArrayList;
-package com.att.research.mdbc.configurations;
+package org.onap.music.mdbc.configurations;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.DatabasePartition;
-import com.att.research.mdbc.MDBCUtils;
-import com.att.research.mdbc.Range;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.DatabasePartition;
+import org.onap.music.mdbc.MDBCUtils;
+import org.onap.music.mdbc.Range;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-package com.att.research.mdbc.configurations;
+package org.onap.music.mdbc.configurations;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.DatabaseOperations;
-import com.att.research.mdbc.RedoRow;
-import com.att.research.mdbc.mixins.CassandraMixin;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.DatabaseOperations;
+import org.onap.music.mdbc.RedoRow;
+import org.onap.music.mdbc.mixins.CassandraMixin;
import com.google.gson.Gson;
import org.onap.music.datastore.PreparedQueryObject;
import org.onap.music.exceptions.MusicServiceException;
-package com.att.research.mdbc.examples;
+package org.onap.music.mdbc.examples;
import java.sql.*;
import org.apache.calcite.avatica.remote.Driver;
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.sql.Types;
import java.util.ArrayList;
import org.onap.music.main.MusicCore;
import org.onap.music.main.ReturnType;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.DatabasePartition;
-import com.att.research.mdbc.TableInfo;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.DatabasePartition;
+import org.onap.music.mdbc.TableInfo;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
/**
* This class provides the methods that MDBC needs to access Cassandra directly in order to provide persistence
* to calls to the user's DB. It stores dirty row references in one table (called DIRTY____) rather than one dirty
- * table per real table (as {@link com.att.research.mdbc.mixins.CassandraMixin} does).
+ * table per real table (as {@link org.onap.music.mdbc.mixins.CassandraMixin} does).
*
* @author Robert P. Eby
*/
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.io.IOException;
import java.io.Reader;
import java.util.TreeSet;
import java.util.UUID;
-import com.att.research.mdbc.*;
-import com.att.research.mdbc.tables.PartitionInformation;
-import com.att.research.mdbc.tables.MusixTxDigestId;
-import com.att.research.mdbc.tables.StagingTable;
-import com.att.research.mdbc.tables.MriReference;
-import com.att.research.mdbc.tables.MusicRangeInformationRow;
-import com.att.research.mdbc.tables.TxCommitProgress;
+import org.onap.music.mdbc.*;
+import org.onap.music.mdbc.tables.PartitionInformation;
+import org.onap.music.mdbc.tables.MusixTxDigestId;
+import org.onap.music.mdbc.tables.StagingTable;
+import org.onap.music.mdbc.tables.MriReference;
+import org.onap.music.mdbc.tables.MusicRangeInformationRow;
+import org.onap.music.mdbc.tables.TxCommitProgress;
import org.json.JSONObject;
import org.onap.music.datastore.CassaLockStore;
import org.onap.music.main.ResultType;
import org.onap.music.main.ReturnType;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.logging.EELFLoggerDelegate;
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.DataType;
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.sql.ResultSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import com.att.research.mdbc.Range;
-import com.att.research.mdbc.TableInfo;
-import com.att.research.mdbc.tables.StagingTable;
+import org.onap.music.mdbc.Range;
+import org.onap.music.mdbc.TableInfo;
+import org.onap.music.mdbc.tables.StagingTable;
/**
* This Interface defines the methods that MDBC needs in order to mirror data to/from a Database instance.
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.sql.Connection;
import java.util.Properties;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.DatabasePartition;
-import com.att.research.mdbc.MusicSqlManager;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.DatabasePartition;
+import org.onap.music.mdbc.MusicSqlManager;
/**
- * This class is used to construct instances of Mixins that implement either the {@link com.att.research.mdbc.mixins.DBInterface}
- * interface, or the {@link com.att.research.mdbc.mixins.MusicInterface} interface. The Mixins are searched for in the CLASSPATH.
+ * This class is used to construct instances of Mixins that implement either the {@link org.onap.music.mdbc.mixins.DBInterface}
+ * interface, or the {@link org.onap.music.mdbc.mixins.MusicInterface} interface. The Mixins are searched for in the CLASSPATH.
*
* @author Robert P. Eby
*/
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Iterator;
import java.util.List;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.logging.EELFLoggerDelegate;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.Metadata;
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.util.HashMap;
import java.util.List;
import org.json.JSONObject;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.mdbc.DatabasePartition;
-import com.att.research.mdbc.Range;
-import com.att.research.mdbc.TableInfo;
-import com.att.research.mdbc.tables.PartitionInformation;
-import com.att.research.mdbc.tables.MusixTxDigestId;
-import com.att.research.mdbc.tables.StagingTable;
-import com.att.research.mdbc.tables.MriReference;
-import com.att.research.mdbc.tables.MusicRangeInformationRow;
-import com.att.research.mdbc.tables.TxCommitProgress;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.mdbc.DatabasePartition;
+import org.onap.music.mdbc.Range;
+import org.onap.music.mdbc.TableInfo;
+import org.onap.music.mdbc.tables.PartitionInformation;
+import org.onap.music.mdbc.tables.MusixTxDigestId;
+import org.onap.music.mdbc.tables.StagingTable;
+import org.onap.music.mdbc.tables.MriReference;
+import org.onap.music.mdbc.tables.MusicRangeInformationRow;
+import org.onap.music.mdbc.tables.TxCommitProgress;
/**
* This Interface defines the methods that MDBC needs for a class to provide access to the persistence layer of MUSIC.
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
-import com.att.research.mdbc.LockId;
+import org.onap.music.mdbc.LockId;
import org.json.JSONObject;
import org.onap.music.exceptions.MusicLockingException;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.mdbc.DatabasePartition;
-import com.att.research.mdbc.Range;
-import com.att.research.mdbc.TableInfo;
-import com.att.research.mdbc.tables.PartitionInformation;
-import com.att.research.mdbc.tables.MusixTxDigestId;
-import com.att.research.mdbc.tables.StagingTable;
-import com.att.research.mdbc.tables.MriReference;
-import com.att.research.mdbc.tables.MusicRangeInformationRow;
-import com.att.research.mdbc.tables.TxCommitProgress;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.mdbc.DatabasePartition;
+import org.onap.music.mdbc.Range;
+import org.onap.music.mdbc.TableInfo;
+import org.onap.music.mdbc.tables.PartitionInformation;
+import org.onap.music.mdbc.tables.MusixTxDigestId;
+import org.onap.music.mdbc.tables.StagingTable;
+import org.onap.music.mdbc.tables.MriReference;
+import org.onap.music.mdbc.tables.MusicRangeInformationRow;
+import org.onap.music.mdbc.tables.TxCommitProgress;
import org.onap.music.main.MusicCore;
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.sql.Connection;
import java.sql.PreparedStatement;
import org.json.JSONObject;
import org.json.JSONTokener;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.MusicSqlManager;
-import com.att.research.mdbc.Range;
-import com.att.research.mdbc.TableInfo;
-import com.att.research.mdbc.tables.OperationType;
-import com.att.research.mdbc.tables.StagingTable;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.MusicSqlManager;
+import org.onap.music.mdbc.Range;
+import org.onap.music.mdbc.TableInfo;
+import org.onap.music.mdbc.tables.OperationType;
+import org.onap.music.mdbc.tables.StagingTable;
import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
import java.io.IOException;
import java.io.InputStream;
import org.json.JSONObject;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.TableInfo;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.TableInfo;
import com.datastax.driver.core.utils.Bytes;
/**
/**
* <p>
* This package provides the "mixins" to use when constructing a MusicSqlManager. The mixins define how MusicSqlManager
- * will interface both to the database being mirrored (via the {@link com.att.research.mdbc.mixins.DBInterface} interface),
- * and how it will interface to the persistence layer provided by MUSIC (via the {@link com.att.research.mdbc.mixins.MusicInterface}
+ * will interface both to the database being mirrored (via the {@link org.onap.music.mdbc.mixins.DBInterface} interface),
+ * and how it will interface to the persistence layer provided by MUSIC (via the {@link org.onap.music.mdbc.mixins.MusicInterface}
* interface).
* </p>
* <p>
* The <code>mdbc-h2server-0.0.1-SNAPSHOT.jar</code> file is built with Maven using the <code>pom-h2server.xml</code> pom file.
* </p>
*/
-package com.att.research.mdbc.mixins;
+package org.onap.music.mdbc.mixins;
* </li>
* <li>Load the driver using the following call:
* <pre>
- * Class.forName("com.att.research.mdbc.ProxyDriver");
+ * Class.forName("org.onap.music.mdbc.ProxyDriver");
* </pre></li>
* </ol>
* <p>Because, under the current design, the MDBC driver must be running within the same JVM as the database, MDBC
* type="javax.sql.DataSource"
* factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
* uniqueResourceName="process-engine"
- * driverClassName="<b>com.att.research.mdbc.ProxyDriver</b>"
+ * driverClassName="<b>org.onap.music.mdbc.ProxyDriver</b>"
* url="jdbc:<b>mdbc</b>:./camunda-h2-dbs/process-engine;MVCC=TRUE;TRACE_LEVEL_FILE=0;DB_CLOSE_ON_EXIT=FALSE"
* <b>connectionProperties="myid=0;replicas=0,1,2;music_keyspace=camunda;music_address=localhost"</b>
* username="sa"
* </security>
* </datasource>
* <drivers>
- * <b><driver name="mdbc" module="com.att.research.mdbc">
- * <driver-class>com.att.research.mdbc.ProxyDriver</driver-class>
+ * <b><driver name="mdbc" module="org.onap.music.mdbc">
+ * <driver-class>org.onap.music.mdbc.ProxyDriver</driver-class>
* </driver></b>
* </drivers>
* </datasources>
* </pre>
- * <p>Note: This assumes that you have built and installed the <b>com.att.research.mdbc</b> module within JBoss.
+ * <p>Note: This assumes that you have built and installed the <b>org.onap.music.mdbc</b> module within JBoss.
*/
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
import java.util.UUID;
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
import java.util.List;
import java.util.UUID;
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
import java.util.UUID;
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
import java.io.Serializable;
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
public enum OperationType{
DELETE, UPDATE, INSERT, SELECT
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
import java.util.List;
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
import java.io.Serializable;
import java.util.Deque;
import org.apache.commons.lang3.tuple.Pair;
import org.json.JSONObject;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.logging.EELFLoggerDelegate;
public class StagingTable implements Serializable{
/**
-package com.att.research.mdbc.tables;
+package org.onap.music.mdbc.tables;
import java.math.BigInteger;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.datastax.driver.core.utils.UUIDs;
-import com.att.research.logging.EELFLoggerDelegate;
+import org.onap.music.logging.EELFLoggerDelegate;
import java.sql.Connection;
import java.util.concurrent.atomic.AtomicReference;
-package com.att.research.mdbc.tests;
+package org.onap.music.mdbc.tests;
//import java.sql.Connection;
//import java.sql.DriverManager;
// *
// * In order to use, must have mysql and Cassandra services running locally. Must
// * have a database EMP created in the mysql db. Uses
-// * "Driver.getConnection(com.att.research.mdbc.ProxyDriver)" for mdbc
+// * "Driver.getConnection(org.onap.music.mdbc.ProxyDriver)" for mdbc
// * connection
// */
// //@Test
// connectionProps.put("user", USER);
// connectionProps.put("password", PASS);
//
-// final String MDBC_DRIVER = "com.att.research.mdbc.ProxyDriver";
+// final String MDBC_DRIVER = "org.onap.music.mdbc.ProxyDriver";
// final String MDBC_DB_URL = "jdbc:mdbc://localhost/TEST";
// final String MDBC_DB_MIXIN = "mysql";
// connectionProps.put("MDBC_DB_MIXIN", MDBC_DB_MIXIN);
// *
// * In order to use, must have mysql and Cassandra services running locally. Must
// * have a database EMP created in the mysql db. Uses
-// * "Driver.getConnection(com.att.research.mdbc.ProxyDriver)" for mdbc
+// * "Driver.getConnection(org.onap.music.mdbc.ProxyDriver)" for mdbc
// * connection
// *
// * Uses preparedStatements
// connectionProps.put("user", USER);
// connectionProps.put("password", PASS);
//
-// final String MDBC_DRIVER = "com.att.research.mdbc.ProxyDriver";
+// final String MDBC_DRIVER = "org.onap.music.mdbc.ProxyDriver";
// final String MDBC_DB_URL = "jdbc:mdbc://localhost/EMP";
// //final String MDBC_DRIVER = "org.h2.Driver";
// //final String MDBC_DB_URL = "jdbc:h2:tcp://localhost:9092/~/test";
-package com.att.research.mdbc.tests;
+package org.onap.music.mdbc.tests;
import java.io.FileInputStream;
import java.io.InputStream;
-package com.att.research.mdbc.tests;
+package org.onap.music.mdbc.tests;
import java.sql.Connection;
import java.sql.DriverManager;
* @author Robert Eby
*/
public abstract class Test {
- public static final String MDBC_DRIVER = "com.att.research.mdbc.ProxyDriver";
+ public static final String MDBC_DRIVER = "org.onap.music.mdbc.ProxyDriver";
/**
* Each test derived from this class must implement this method,
public String getName() {
String s = this.getClass().getName();
- return s.replaceAll("com.att.research.mdbc.tests.", "");
+ return s.replaceAll("org.onap.music.mdbc.tests.", "");
}
public Properties buildProperties(JSONObject config, int i) {
-package com.att.research.mdbc.tests;
+package org.onap.music.mdbc.tests;
import java.sql.Connection;
import java.sql.Statement;
-package com.att.research.mdbc.tests;
+package org.onap.music.mdbc.tests;
import java.sql.Connection;
import java.sql.ResultSet;
-package com.att.research.mdbc.tests;
+package org.onap.music.mdbc.tests;
import java.sql.Connection;
import java.sql.Statement;
* To run the tests against all the configurations specified in /tests.json, do the following:
* </p>
* <pre>
- * java com.att.research.mdbc.tests.MAIN [ configfile ]
+ * java org.onap.music.mdbc.tests.MAIN [ configfile ]
* </pre>
* <p>
* It is assumed that a copy of Cassandra is running locally on port 9042,
* <pre>
* {
* "tests": [
- * "com.att.research.mdbc.tests.Test_Insert",
- * "com.att.research.mdbc.tests.Test_Delete",
- * "com.att.research.mdbc.tests.Test_Transactions"
+ * "org.onap.music.mdbc.tests.Test_Insert",
+ * "org.onap.music.mdbc.tests.Test_Delete",
+ * "org.onap.music.mdbc.tests.Test_Transactions"
* ],
* "configs": [
* {
* }
* </pre>
*/
-package com.att.research.mdbc.tests;
+package org.onap.music.mdbc.tests;
-package com.att.research.mdbc.tools;
+package org.onap.music.mdbc.tools;
-import com.att.research.exceptions.MDBCServiceException;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.configurations.NodeConfiguration;
-import com.att.research.mdbc.configurations.TablesConfiguration;
+import org.onap.music.exceptions.MDBCServiceException;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.configurations.NodeConfiguration;
+import org.onap.music.mdbc.configurations.TablesConfiguration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
-package com.att.research.mdbc.tools;
+package org.onap.music.mdbc.tools;
-import com.att.research.logging.EELFLoggerDelegate;
-import com.att.research.mdbc.configurations.NodeConfiguration;
+import org.onap.music.logging.EELFLoggerDelegate;
+import org.onap.music.mdbc.configurations.NodeConfiguration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
by the use of "mixins". Each JDBC Connection via MDBC specifies two mixins to use:
</p>
<ul>
-<li>a Mixin that conforms to the {@link com.att.research.mdbc.mixins.MusicInterface} specification
+<li>a Mixin that conforms to the {@link org.onap.music.mdbc.mixins.MusicInterface} specification
for communicating with MUSIC/Cassandra.</li>
-<li>a Mixin that conforms to the {@link com.att.research.mdbc.mixins.DBInterface} specification
+<li>a Mixin that conforms to the {@link org.onap.music.mdbc.mixins.DBInterface} specification
for communicating with the underlying database in use.</li>
</ul>
<p>
More details are provided on the package pages for
-<code>com.att.research.mdbc</code> and
-<code>com.att.research.mdbc.mixins</code>.
+<code>org.onap.music.mdbc</code> and
+<code>org.onap.music.mdbc.mixins</code>.
</p>
<h2>Limitations</h2>
There are several limitations to the use of MDBC:
-com.att.research.mdbc.ProxyDriver
+org.onap.music.mdbc.ProxyDriver
# A list of all Mixins that should be checked by MDBC
#
MIXINS= \
- com.att.research.mdbc.mixins.H2Mixin \
- com.att.research.mdbc.mixins.H2ServerMixin \
- com.att.research.mdbc.mixins.MySQLMixin \
- com.att.research.mdbc.mixins.CassandraMixin \
- com.att.research.mdbc.mixins.Cassandra2Mixin
+ org.onap.music.mdbc.mixins.H2Mixin \
+ org.onap.music.mdbc.mixins.H2ServerMixin \
+ org.onap.music.mdbc.mixins.MySQLMixin \
+ org.onap.music.mdbc.mixins.CassandraMixin \
+ org.onap.music.mdbc.mixins.Cassandra2Mixin
critical.tables= \
TEST
\ No newline at end of file
# A list of all Mixins that should be checked by MDBC
#
MIXINS= \
- com.att.research.mdbc.mixins.H2Mixin \
- com.att.research.mdbc.mixins.H2ServerMixin \
- com.att.research.mdbc.mixins.MySQLMixin \
- com.att.research.mdbc.mixins.CassandraMixin \
- com.att.research.mdbc.mixins.Cassandra2Mixin
+ org.onap.music.mdbc.mixins.H2Mixin \
+ org.onap.music.mdbc.mixins.H2ServerMixin \
+ org.onap.music.mdbc.mixins.MySQLMixin \
+ org.onap.music.mdbc.mixins.CassandraMixin \
+ org.onap.music.mdbc.mixins.Cassandra2Mixin
DEFAULT_DRIVERS=\
org.h2.Driver \
{
"tests": [
- "com.att.research.mdbc.tests.Test_Insert",
- "com.att.research.mdbc.tests.Test_Delete",
- "com.att.research.mdbc.tests.Test_Transactions"
+ "org.onap.music.mdbc.tests.Test_Insert",
+ "org.onap.music.mdbc.tests.Test_Delete",
+ "org.onap.music.mdbc.tests.Test_Transactions"
],
"configs": [
{
fi
T=/tmp/mk_jboss_module$$
-T2=$T/com/att/research/mdbc/main
+T2=$T/org/onap/music/mdbc/main
MODULE=$T2/module.xml
TARGET=`pwd`/target/mdbc-jboss-module.tar
JARS=$( mvn dependency:build-classpath | grep -v INFO | tr : '\012' )
Note: This module includes a copy of the H2 database, rather than depending on the
com.h2database.h2 module included with JBoss, because I could not get that copy to work.
-->
-<module xmlns="urn:jboss:module:1.1" name="com.att.research.mdbc">
+<module xmlns="urn:jboss:module:1.1" name="org.onap.music.mdbc">
<resources>
EOF
for i in $JAR2; do echo " <resource-root path=\"$i\"/>"; done >> $MODULE
-package com.att.research.mdbc;
+package org.onap.music.mdbc;
-import com.att.research.mdbc.tables.OperationType;
-import com.att.research.mdbc.tables.StagingTable;
+import org.onap.music.mdbc.tables.OperationType;
+import org.onap.music.mdbc.tables.StagingTable;
import org.json.JSONArray;
import org.json.JSONObject;
-package com.att.research.mdbc.test;
+package org.onap.music.mdbc.test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
-package com.att.research.mdbc.test;
+package org.onap.music.mdbc.test;
import static org.junit.Assert.*;
-package com.att.research.mdbc.test;
+package org.onap.music.mdbc.test;
import static org.junit.Assert.*;
-package com.att.research.mdbc.test;
+package org.onap.music.mdbc.test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
-import com.att.research.mdbc.mixins.CassandraMixin;
+import org.onap.music.mdbc.mixins.CassandraMixin;
public class TestCommon {
public static final String DB_DRIVER = "avatica.Driver";
-package com.att.research.mdbc.test;
+package org.onap.music.mdbc.test;
import static org.junit.Assert.fail;