Upgrade to MUSIC 3.2.1 68/74068/2
authorRob Daugherty <rd472p@att.com>
Fri, 30 Nov 2018 15:24:27 +0000 (10:24 -0500)
committerTschaen, Brendan <ctschaen@att.com>
Fri, 30 Nov 2018 18:15:18 +0000 (13:15 -0500)
Add license headers to new files

Change-Id: I1a557dbafbd29ce457b545dbd1ca2bc0db62a085
Issue-ID: MUSIC-219
Signed-off-by: Rob Daugherty <rd472p@att.com>
mdbc-server/pom.xml
mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicConnector.java
mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicMixin.java
mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java
mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java
mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java
pom.xml

index f01f90a..de18444 100755 (executable)
         <dependency>
             <groupId>org.onap.music</groupId>
             <artifactId>dev-MUSIC-cassandra</artifactId>
-            <version>3.2.0-SNAPSHOT</version>
+            <version>3.2.1-SNAPSHOT</version>
         </dependency>
     </dependencies>
 
index 59e3581..b9b4fb6 100755 (executable)
@@ -27,6 +27,7 @@ import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
 
+import org.onap.music.datastore.MusicDataStoreHandle;
 import org.onap.music.logging.EELFLoggerDelegate;
 import com.datastax.driver.core.Cluster;
 import com.datastax.driver.core.HostDistance;
@@ -89,7 +90,7 @@ public class MusicConnector {
        }
        
        private void connectToMultipleAddresses(String address) {
-               MusicCore.getDSHandle(address);
+               MusicDataStoreHandle.getDSHandle(address);
        /*
        PoolingOptions poolingOptions =
                new PoolingOptions()
index 7228b55..a928526 100755 (executable)
@@ -43,13 +43,14 @@ import org.onap.music.mdbc.tables.MusicTxDigestId;
 import org.onap.music.mdbc.tables.StagingTable;
 import org.onap.music.mdbc.tables.MusicRangeInformationRow;
 import org.onap.music.mdbc.tables.TxCommitProgress;
-
+import org.onap.music.service.impl.MusicCassaCore;
 import org.json.JSONObject;
-import org.onap.music.datastore.CassaLockStore;
+import org.onap.music.lockingservice.cassandra.CassaLockStore;
 import org.onap.music.datastore.PreparedQueryObject;
 import org.onap.music.exceptions.MusicLockingException;
 import org.onap.music.exceptions.MusicQueryException;
 import org.onap.music.exceptions.MusicServiceException;
+import org.onap.music.datastore.Condition;
 import org.onap.music.main.MusicCore;
 import org.onap.music.main.ResultType;
 import org.onap.music.main.ReturnType;
@@ -1650,7 +1651,7 @@ public class MusicMixin implements MusicInterface {
         }
         CassaLockStore lsHandle;
         try {
-            lsHandle = MusicCore.getLockingServiceHandle();
+            lsHandle = MusicCassaCore.getLockingServiceHandle();
         } catch (MusicLockingException e) {
             logger.error("Error obtaining the locking service handle when checking if relinquish was required");
             throw new MDBCServiceException("Error obtaining locking service"+e.getMessage());
@@ -1723,7 +1724,7 @@ public class MusicMixin implements MusicInterface {
 
     private void executeMusicLockedPut(String namespace, String tableName,
                                        String primaryKeyWithoutDomain, PreparedQueryObject queryObject, String lockId,
-                                       MusicCore.Condition conditionInfo) throws MDBCServiceException {
+                                       Condition conditionInfo) throws MDBCServiceException {
         ReturnType rt ;
         if(lockId==null) {
             try {
index 776a06e..2250b90 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * ============LICENSE_START====================================================
+ * org.onap.music.mdbc
+ * =============================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * =============================================================================
+ * 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 org.onap.music.mdbc;
 
 import static org.junit.Assert.*;
@@ -13,4 +33,4 @@ public class MdbcConnectionTest {
     @Test
     public void relinquishIfRequired() {
     }
-}
\ No newline at end of file
+}
index 4d32b83..85220d4 100755 (executable)
@@ -22,7 +22,7 @@ package org.onap.music.mdbc;
 import com.datastax.driver.core.*;
 import com.datastax.driver.core.exceptions.QueryExecutionException;
 import com.datastax.driver.core.exceptions.SyntaxError;
-import org.onap.music.datastore.CassaDataStore;
+import org.onap.music.lockingservice.cassandra.CassaLockStore;
 import org.onap.music.logging.EELFLoggerDelegate;
 import org.onap.music.main.MusicUtil;
 
@@ -99,15 +99,6 @@ public class TestUtils {
         return expectedTypes;
     }
 
-
-    public static void checkRowsInTable(String keyspace, String tableName, CassaDataStore ds,
-                                        HashSet<String> expectedColumns, HashMap<String,DataType> expectedTypes){
-        TableMetadata table = ds.returnColumnMetadata(keyspace,tableName);
-        assertNotNull("Error obtaining metadata of table, there may be an error with its creation", table);
-        List<ColumnMetadata> columnsMeta = table.getColumns();
-        checkDataTypeForTable(columnsMeta,expectedColumns,expectedTypes);
-    }
-
     public static void checkDataTypeForTable(List<ColumnMetadata> columnsMeta, HashSet<String> expectedColumns,
                                HashMap<String,DataType> expectedTypes){
         for(ColumnMetadata cMeta : columnsMeta){
index 7e0e4c8..b6ab2dd 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * ============LICENSE_START====================================================
+ * org.onap.music.mdbc
+ * =============================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * =============================================================================
+ * 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 org.onap.music.mdbc.mixins;
 
 import static org.junit.Assert.*;
@@ -14,17 +34,20 @@ import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.onap.music.datastore.CassaDataStore;
-import org.onap.music.datastore.MusicLockState;
+import org.onap.music.datastore.MusicDataStore;
+import org.onap.music.datastore.MusicDataStoreHandle;
 import org.onap.music.exceptions.MDBCServiceException;
 import org.onap.music.exceptions.MusicLockingException;
 import org.onap.music.exceptions.MusicQueryException;
 import org.onap.music.exceptions.MusicServiceException;
+import org.onap.music.lockingservice.cassandra.CassaLockStore;
+import org.onap.music.lockingservice.cassandra.MusicLockState;
 import org.onap.music.main.MusicCore;
 import org.onap.music.mdbc.DatabasePartition;
 import org.onap.music.mdbc.Range;
 import org.onap.music.mdbc.tables.MusicRangeInformationRow;
 import org.onap.music.mdbc.tables.MusicTxDigestId;
+import org.onap.music.service.impl.MusicCassaCore;
 
 public class MusicMixinTest {
 
@@ -52,9 +75,10 @@ public class MusicMixinTest {
         assertNotNull("Invalid configuration for cassandra", cluster);
         session = cluster.connect();
         assertNotNull("Invalid configuration for cassandra", session);
-        CassaDataStore store = new CassaDataStore(cluster, session);
+
+        MusicDataStoreHandle.mDstoreHandle = new MusicDataStore(cluster, session);
+        CassaLockStore store = new CassaLockStore(MusicDataStoreHandle.mDstoreHandle);
         assertNotNull("Invalid configuration for music", store);
-        MusicCore.mDstoreHandle = store;
         try {
             Properties properties = new Properties();
             properties.setProperty(MusicMixin.KEY_MUSIC_NAMESPACE,keyspace);
@@ -145,7 +169,7 @@ public class MusicMixinTest {
             ownershipReturn.getOldIRangeds().get(1).equals(partition2.getMusicRangeInformationIndex()));
         String finalfullyQualifiedMriKey = keyspace+"."+ mriTableName+"."+newPartition.getMusicRangeInformationIndex().toString();
         try {
-            List<String> lockQueue = MusicCore.getLockingServiceHandle().getLockQueue(keyspace, mriTableName,
+            List<String> lockQueue = MusicCassaCore.getLockingServiceHandle().getLockQueue(keyspace, mriTableName,
                 newPartition.getMusicRangeInformationIndex().toString());
             assertEquals(1,lockQueue.size());
             assertEquals(lockQueue.get(0),newPartition.getLockId());
@@ -190,4 +214,4 @@ public class MusicMixinTest {
     @Test
     public void relinquishIfRequired() {
     }
-}
\ No newline at end of file
+}
diff --git a/pom.xml b/pom.xml
index 51dbd87..d999ad1 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
         <dependency>
             <groupId>org.onap.music</groupId>
             <artifactId>dev-MUSIC-cassandra</artifactId>
-            <version>3.2.0-SNAPSHOT</version>
+            <version>3.2.1-SNAPSHOT</version>
         </dependency>
     </dependencies>