diff options
author | Thomas Nelson (arthurdent3) <nelson24@att.com> | 2019-10-02 18:09:23 -0400 |
---|---|---|
committer | Thomas Nelson (arthurdent3) <nelson24@att.com> | 2019-10-03 17:28:55 -0400 |
commit | 48b02dfdc78a6412d568a14b015ccb9439a1dbb5 (patch) | |
tree | ae9dfd7d47d643fcd7e1b4206b525ee0f98f1550 /music-rest/src/main | |
parent | a681a9e295dc2b8f35dd42251f795d0079471ac0 (diff) |
Update locking to use Threadsafe set
Had to create whole new method for Atomic Lock Creation.
Added thread safe set to contol lock creation per key.
Updated the deadlock to use local_quorum
Removed some uneeded import
Updated some logging.
Issue-ID: MUSIC-512
Signed-off-by: Thomas Nelson (arthurdent3) <nelson24@att.com>
Change-Id: I7e1a4c34de5dc9a0e90adf30d1f4d1bac698ceae
Signed-off-by: Thomas Nelson (arthurdent3) <nelson24@att.com>
Diffstat (limited to 'music-rest/src/main')
-rw-r--r-- | music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java b/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java index 18fa8a18..ebaa3a1f 100644 --- a/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java +++ b/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java @@ -94,9 +94,9 @@ public class MusicConditional { String key = keyspace + "." + tablename + "." + primaryKey; String lockId; try { - lockId = MusicCore.createLockReference(key); + lockId = MusicCore.createLockReferenceAtomic(key); } catch (MusicLockingException e) { - return new ReturnType(ResultType.FAILURE, e.getMessage()); + return new ReturnType(ResultType.FAILURE, e.getMessage()); } long leasePeriod = MusicUtil.getDefaultLockLeasePeriod(); ReturnType lockAcqResult = MusicCore.acquireLockWithLease(key, lockId, leasePeriod); @@ -169,7 +169,7 @@ public class MusicConditional { throws MusicLockingException, MusicQueryException, MusicServiceException { String key = dataObj.getKeyspace() + "." + dataObj.getTableName() + "." + dataObj.getPrimaryKeyValue(); - String lockId = MusicCore.createLockReference(key); + String lockId = MusicCore.createLockReferenceAtomic(key); long leasePeriod = MusicUtil.getDefaultLockLeasePeriod(); ReturnType lockAcqResult = MusicCore.acquireLockWithLease(key, lockId, leasePeriod); |