aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-11-30 10:24:27 -0500
committerTschaen, Brendan <ctschaen@att.com>2018-11-30 13:15:18 -0500
commitc4db500cdd53a2ed1e19a2abdb04612bb3785cd7 (patch)
treef4f10c167dce08fe41b8a0db3759c6b85ab916bb
parent9cc93ae782739f4fd637fa8d30a986ce2e14ae3e (diff)
Upgrade to MUSIC 3.2.1
Add license headers to new files Change-Id: I1a557dbafbd29ce457b545dbd1ca2bc0db62a085 Issue-ID: MUSIC-219 Signed-off-by: Rob Daugherty <rd472p@att.com>
-rwxr-xr-xmdbc-server/pom.xml2
-rwxr-xr-xmdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicConnector.java3
-rwxr-xr-xmdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicMixin.java9
-rw-r--r--mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java22
-rwxr-xr-xmdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java11
-rw-r--r--mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java36
-rwxr-xr-xpom.xml2
7 files changed, 61 insertions, 24 deletions
diff --git a/mdbc-server/pom.xml b/mdbc-server/pom.xml
index f01f90a..de18444 100755
--- a/mdbc-server/pom.xml
+++ b/mdbc-server/pom.xml
@@ -175,7 +175,7 @@
<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>
diff --git a/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicConnector.java b/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicConnector.java
index 59e3581..b9b4fb6 100755
--- a/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicConnector.java
+++ b/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicConnector.java
@@ -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()
diff --git a/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicMixin.java b/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicMixin.java
index 7228b55..a928526 100755
--- a/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicMixin.java
+++ b/mdbc-server/src/main/java/org/onap/music/mdbc/mixins/MusicMixin.java
@@ -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 {
diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java b/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java
index 776a06e..2250b90 100644
--- a/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java
+++ b/mdbc-server/src/test/java/org/onap/music/mdbc/MdbcConnectionTest.java
@@ -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
+}
diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java b/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java
index 4d32b83..85220d4 100755
--- a/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java
+++ b/mdbc-server/src/test/java/org/onap/music/mdbc/TestUtils.java
@@ -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){
diff --git a/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java b/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java
index 7e0e4c8..b6ab2dd 100644
--- a/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java
+++ b/mdbc-server/src/test/java/org/onap/music/mdbc/mixins/MusicMixinTest.java
@@ -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
--- a/pom.xml
+++ b/pom.xml
@@ -234,7 +234,7 @@
<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>