<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>
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;
}
private void connectToMultipleAddresses(String address) {
- MusicCore.getDSHandle(address);
+ MusicDataStoreHandle.getDSHandle(address);
/*
PoolingOptions poolingOptions =
new PoolingOptions()
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;
}
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());
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 {
+/*
+ * ============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.*;
@Test
public void relinquishIfRequired() {
}
-}
\ No newline at end of file
+}
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;
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){
+/*
+ * ============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.*;
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 {
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);
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());
@Test
public void relinquishIfRequired() {
}
-}
\ No newline at end of file
+}
<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>