diff options
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/music/prom/main/PromDaemon.java | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/music/prom/musicinterface/MusicHandle.java | 2 | ||||
-rw-r--r-- | src/test/java/org/onap/music/prom/main/PromDaemonTest.java | 2 |
4 files changed, 8 insertions, 7 deletions
@@ -26,7 +26,7 @@ stated inside of the file. <groupId>org.onap.music.prom</groupId> <artifactId>prom</artifactId> <name>music-prom</name> - <version>1.0.5</version> + <version>1.0.6</version> <parent> <groupId>org.onap.oparent</groupId> <artifactId>oparent</artifactId> diff --git a/src/main/java/org/onap/music/prom/main/PromDaemon.java b/src/main/java/org/onap/music/prom/main/PromDaemon.java index f39228b..cf9ab01 100644 --- a/src/main/java/org/onap/music/prom/main/PromDaemon.java +++ b/src/main/java/org/onap/music/prom/main/PromDaemon.java @@ -76,14 +76,15 @@ public class PromDaemon { MusicHandle.createIndexInTable(keyspaceName, tableName, "lockref"); Map<String,Object> values = new HashMap<String,Object>(); - values.put("id",this.id); + values.put("id","PROM_ADMIN"); // need dummy for lock values.put("isactive","false"); values.put("timeoflastupdate", "0"); - //values.put("lockref", ""); MusicHandle.insertIntoTableEventual(keyspaceName, tableName, values); - //MusicHandle.insertIntoTableEventual(keyspaceName, tableName, values); - lockName = keyspaceName+".active.lock"; + values.put("id",this.id); + MusicHandle.insertIntoTableEventual(keyspaceName, tableName, values); + + lockName = keyspaceName+".Replicas.PROM_ADMIN"; } /** diff --git a/src/main/java/org/onap/music/prom/musicinterface/MusicHandle.java b/src/main/java/org/onap/music/prom/musicinterface/MusicHandle.java index 83d148b..cc7a875 100644 --- a/src/main/java/org/onap/music/prom/musicinterface/MusicHandle.java +++ b/src/main/java/org/onap/music/prom/musicinterface/MusicHandle.java @@ -579,7 +579,7 @@ public class MusicHandle { ClientResponse response = addMusicHeaders(webResource).get(ClientResponse.class); - if (response.getStatus() != 200) { + if (response.getStatus() != 200 && response.getStatus() != 400) { logger.error(EELFLoggerDelegate.errorLogger, "Failed to acquireLock : Status Code "+response.getStatus()); throw new RuntimeException("Failed : HTTP error code : " + response.getStatus()); } diff --git a/src/test/java/org/onap/music/prom/main/PromDaemonTest.java b/src/test/java/org/onap/music/prom/main/PromDaemonTest.java index be2d798..f8199b0 100644 --- a/src/test/java/org/onap/music/prom/main/PromDaemonTest.java +++ b/src/test/java/org/onap/music/prom/main/PromDaemonTest.java @@ -80,7 +80,7 @@ public class PromDaemonTest { Whitebox.invokeMethod(promDaemon, "bootStrap"); assertEquals("prom_testing", promDaemon.keyspaceName); - assertEquals("prom_testing.active.lock", promDaemon.lockName); + assertEquals("prom_testing.Replicas.PROM_ADMIN", promDaemon.lockName); } @Test |