From 24c82cbc9ccdcfab25b304bc4c1660dca304bdb9 Mon Sep 17 00:00:00 2001 From: "Tschaen, Brendan" Date: Mon, 3 Dec 2018 15:21:30 -0500 Subject: Cassa lockstore return string for peekLock Change-Id: I4384ed522e7849ba9ca355efa63a08512f11ccec Issue-ID: MUSIC-222 Signed-off-by: Tschaen, Brendan --- .../onap/music/lockingservice/cassandra/CassaLockStore.java | 12 +++++------- .../java/org/onap/music/service/impl/MusicCassaCore.java | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java b/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java index 68423699..9b5793fa 100644 --- a/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java +++ b/src/main/java/org/onap/music/lockingservice/cassandra/CassaLockStore.java @@ -167,16 +167,14 @@ public class CassaLockStore { PreparedQueryObject queryObject = new PreparedQueryObject(); queryObject.appendQueryString(selectQuery); ResultSet rs = dsHandle.executeOneConsistencyGet(queryObject); - System.err.println(rs); - return rs.one().getLong("count"); } - - + + /** - * This method returns the top of lock table/queue for the key. - * @param keyspace of the application. - * @param table of the application. + * This method returns the top of lock table/queue for the key. + * @param keyspace of the application. + * @param table of the application. * @param key is the primary key of the application table * @return the UUID lock reference. * @throws MusicServiceException diff --git a/src/main/java/org/onap/music/service/impl/MusicCassaCore.java b/src/main/java/org/onap/music/service/impl/MusicCassaCore.java index a7a6a5ab..9bbb3a9a 100644 --- a/src/main/java/org/onap/music/service/impl/MusicCassaCore.java +++ b/src/main/java/org/onap/music/service/impl/MusicCassaCore.java @@ -327,7 +327,7 @@ public class MusicCassaCore implements MusicCoreService { String table = splitString[1]; String primaryKeyValue = splitString[2]; try { - return getLockingServiceHandle().peekLockQueue(keyspace, table, primaryKeyValue)+""; + return getLockingServiceHandle().peekLockQueue(keyspace, table, primaryKeyValue).lockRef; } catch (MusicLockingException | MusicServiceException | MusicQueryException e) { logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), AppMessages.LOCKINGERROR+fullyQualifiedKey ,ErrorSeverity.CRITICAL, ErrorTypes.LOCKINGERROR); } -- cgit 1.2.3-korg