diff options
author | Thomas Nelson Jr (arthurdent3) <tn1381@att.com> | 2018-02-20 16:50:44 -0500 |
---|---|---|
committer | Thomas Nelson Jr (arthurdent3) <tn1381@att.com> | 2018-02-20 16:50:44 -0500 |
commit | 3acbae6bf3be04f352bfaac340b8303064a2f7c4 (patch) | |
tree | ed5df3391216742cb9bfd20dc798dd5a246bc962 /src/main/java/org/onap/music/client/MusicClient.java | |
parent | dffae1c7c5cd1f50e2456948942cd7716837a7f2 (diff) |
Applying bug fixes
To many overlapping changes so including all of them.
When pushing individually build was breaking.
Issue-ID: MUSIC-33,MUSIC-34,MUSIC-35,MUSIC-36,MUSIC-37
Change-Id: I15b6f7c683d0d2eeadd99c2376dedd6c43a67a8c
Signed-off-by: Thomas Nelson Jr (arthurdent3) <tn1381@att.com>
Diffstat (limited to 'src/main/java/org/onap/music/client/MusicClient.java')
-rw-r--r-- | src/main/java/org/onap/music/client/MusicClient.java | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/main/java/org/onap/music/client/MusicClient.java b/src/main/java/org/onap/music/client/MusicClient.java index 2d29e236..e67c98a4 100644 --- a/src/main/java/org/onap/music/client/MusicClient.java +++ b/src/main/java/org/onap/music/client/MusicClient.java @@ -32,6 +32,7 @@ import java.util.Set; import org.onap.music.datastore.jsonobjects.JsonInsert; import org.onap.music.datastore.jsonobjects.JsonKeySpace; import org.onap.music.datastore.jsonobjects.JsonTable; +import org.onap.music.eelf.logging.EELFLoggerDelegate; import org.onap.music.lockingservice.MusicLockingService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,7 +60,7 @@ import com.datastax.driver.core.querybuilder.Select; * @author Robert Eby */ public class MusicClient { - private static final Logger LOG = LoggerFactory.getLogger(MusicClient.class); + private EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(MusicClient.class); private final String[] music_hosts; // array of hosts in the music cluster private Cluster cluster; // MUSIC Cassandra cluster @@ -229,7 +230,7 @@ public class MusicClient { String query = String.format( "CREATE KEYSPACE IF NOT EXISTS %s WITH replication = { %s } %s;", keyspaceName, jsonMaptoSqlString(replicationInfo, ","), durability); - LOG.debug(query); + LOG.info(EELFLoggerDelegate.applicationLogger,query); executeCreateQuery(query, consistency); return true; } @@ -237,7 +238,7 @@ public class MusicClient { public boolean dropKeyspace(String keyspaceName, JsonKeySpace kspObject) throws Exception { String consistency = extractConsistencyInfo(keyspaceName, kspObject.getConsistencyInfo()); String query = String.format("DROP KEYSPACE %s;", keyspaceName); - LOG.debug(query); + LOG.info(EELFLoggerDelegate.applicationLogger,query); executeCreateQuery(query, consistency); return false; } @@ -263,33 +264,9 @@ public class MusicClient { prefix = ", "; } - // information about the name-value style properties - // Map<String,Object> propertiesMap = tableObj.getProperties(); - // String propertiesString=""; - // if(propertiesMap != null){ - // counter =0; - // for (Map.Entry<String, Object> entry : propertiesMap.entrySet()) - // { - // Object ot = entry.getValue(); - // String value = ot+""; - // if(ot instanceof String){ - // value = "'"+value+"'"; - // }else if(ot instanceof Map){ - // Map<String,Object> otMap = (Map<String,Object>)ot; - // value = "{"+jsonMaptoSqlString(otMap, ",")+"}"; - // } - // propertiesString = propertiesString+entry.getKey()+"="+ value+""; - // if(counter!=propertiesMap.size()-1) - // propertiesString = propertiesString+" AND "; - // counter = counter +1; - // } - // } - String query = String.format("CREATE TABLE IF NOT EXISTS %s (%s);", tablename, fields.toString()); - // if (propertiesMap != null) - // query = query + " WITH "+ propertiesString; - + LOG.debug(query); String consistency = extractConsistencyInfo(tablename, tableObj.getConsistencyInfo()); executeCreateQuery(query, consistency); @@ -327,7 +304,7 @@ public class MusicClient { String suffix = getTTLSuffix(insObj); String query = String.format("INSERT INTO %s (%s) VALUES (%s)%s;", tablename, fields.toString(), values.toString(), suffix); - LOG.debug(query); + LOG.info(EELFLoggerDelegate.applicationLogger,query); String consistency = extractConsistencyInfo(tablename, consistencyInfo); executeCreateQuery(query, consistency); |