aboutsummaryrefslogtreecommitdiffstats
path: root/jar/src
diff options
context:
space:
mode:
authorNelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>2019-01-31 18:11:35 -0500
committerNelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>2019-01-31 18:11:35 -0500
commitc752be120a8f8708471246497e0619a7d468debe (patch)
treeb11d9cdd1e029005ad47c02ff40dede78366360b /jar/src
parent7a6ad9831c7009f85ad881a695529fdc0246c3a6 (diff)
Update Jar.
Change-Id: Ib78033ce66873e2180a6248a97339c0b54a22500 Issue-ID: MUSIC-303 Signed-off-by: Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>
Diffstat (limited to 'jar/src')
-rw-r--r--jar/src/main/java/org/onap/music/datastore/MusicDataStore.java14
-rwxr-xr-xjar/src/main/java/org/onap/music/main/MusicUtil.java19
2 files changed, 28 insertions, 5 deletions
diff --git a/jar/src/main/java/org/onap/music/datastore/MusicDataStore.java b/jar/src/main/java/org/onap/music/datastore/MusicDataStore.java
index 959ea83d..2fbca444 100644
--- a/jar/src/main/java/org/onap/music/datastore/MusicDataStore.java
+++ b/jar/src/main/java/org/onap/music/datastore/MusicDataStore.java
@@ -55,6 +55,7 @@ import com.datastax.driver.core.exceptions.NoHostAvailableException;
import com.datastax.driver.core.policies.RoundRobinPolicy;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.PoolingOptions;
+import org.onap.music.main.MusicUtil;
/**
@@ -167,17 +168,18 @@ public class MusicDataStore {
.setConnectionsPerHost(HostDistance.REMOTE, 2, 4);
while (it.hasNext()) {
try {
- if(MusicUtil.getCassName() != null && MusicUtil.getCassPwd() != null) {
+ if(MusicUtil.getCassName() != null && MusicUtil.getCassPwd() != null) {
logger.info(EELFLoggerDelegate.applicationLogger,
"Building with credentials "+MusicUtil.getCassName()+" & "+MusicUtil.getCassPwd());
- cluster = Cluster.builder().withPort(9042)
+ cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
.withCredentials(MusicUtil.getCassName(), MusicUtil.getCassPwd())
//.withLoadBalancingPolicy(new RoundRobinPolicy())
+ .withoutJMXReporting()
.withPoolingOptions(poolingOptions)
.addContactPoints(addresses).build();
}
else
- cluster = Cluster.builder().withPort(9042)
+ cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
//.withLoadBalancingPolicy(new RoundRobinPolicy())
.addContactPoints(addresses).build();
@@ -216,15 +218,17 @@ public class MusicDataStore {
if(MusicUtil.getCassName() != null && MusicUtil.getCassPwd() != null) {
logger.info(EELFLoggerDelegate.applicationLogger,
"Building with credentials "+MusicUtil.getCassName()+" & "+MusicUtil.getCassPwd());
- cluster = Cluster.builder().withPort(9042)
+ cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
.withCredentials(MusicUtil.getCassName(), MusicUtil.getCassPwd())
//.withLoadBalancingPolicy(new RoundRobinPolicy())
+ .withoutJMXReporting()
.withPoolingOptions(poolingOptions)
.addContactPoints(addresses).build();
}
else {
- cluster = Cluster.builder().withPort(9042)
+ cluster = Cluster.builder().withPort(MusicUtil.getCassandraPort())
//.withLoadBalancingPolicy(new RoundRobinPolicy())
+ .withoutJMXReporting()
.withPoolingOptions(poolingOptions)
.addContactPoints(addresses).build();
}
diff --git a/jar/src/main/java/org/onap/music/main/MusicUtil.java b/jar/src/main/java/org/onap/music/main/MusicUtil.java
index 0e844215..c36da9d7 100755
--- a/jar/src/main/java/org/onap/music/main/MusicUtil.java
+++ b/jar/src/main/java/org/onap/music/main/MusicUtil.java
@@ -84,6 +84,7 @@ public class MusicUtil {
private static String cassName = "cassandra";
private static String cassPwd = "cassandra";
private static String aafEndpointUrl = null;
+ private static int cassandraPort = 9042;
private MusicUtil() {
throw new IllegalStateException("Utility Class");
@@ -342,6 +343,21 @@ public class MusicUtil {
}
/**
+ *
+ * @return cassandra port
+ */
+ public static int getCassandraPort() {
+ return cassandraPort;
+ }
+
+ /**
+ * set cassandra port
+ * @param cassandraPort
+ */
+ public static void setCassandraPort(int cassandraPort) {
+ MusicUtil.cassandraPort = cassandraPort;
+ }
+ /**
*
* @return
*/
@@ -567,6 +583,9 @@ public class MusicUtil {
String zkHosts = prop.getProperty("zookeeper.host");
MusicUtil.setMyZkHost(zkHosts);
MusicUtil.setCassName(prop.getProperty("cassandra.user"));
+ String cassPort = prop.getProperty("cassandra.port");
+ if(cassPort != null)
+ MusicUtil.setCassandraPort(Integer.parseInt(cassPort));
}