Test new datacenter name
This commit is contained in:
parent
02bc40b6e8
commit
70d7e31540
|
@ -145,7 +145,7 @@ public class CassandraClusterConnection {
|
|||
CqlSession cqlSession = configBuilder(CqlSession.builder())
|
||||
.addContactPoints(hosts)
|
||||
.withKeyspace(KEYSPACE_NAME)
|
||||
.withLocalDatacenter("1")
|
||||
.withLocalDatacenter(datacenterName)
|
||||
.build();
|
||||
_log.info("[OK] Connected to Keyspace {} ", KEYSPACE_NAME);
|
||||
return cqlSession;
|
||||
|
@ -180,7 +180,7 @@ public class CassandraClusterConnection {
|
|||
private static void createKeyspace(String keyspaceName, int replicationFactor) {
|
||||
try (CqlSession cqlSession = configBuilder(CqlSession.builder())
|
||||
.addContactPoints(hosts)
|
||||
.withLocalDatacenter("1")
|
||||
.withLocalDatacenter(datacenterName)
|
||||
.build()) {
|
||||
cqlSession.execute(SchemaBuilder.createKeyspace(keyspaceName)
|
||||
.ifNotExists()
|
||||
|
@ -196,7 +196,7 @@ public class CassandraClusterConnection {
|
|||
ResultSet toreturn;
|
||||
try (CqlSession cqlSession = configBuilder(CqlSession.builder())
|
||||
.addContactPoints(hosts)
|
||||
.withLocalDatacenter("1")
|
||||
.withLocalDatacenter(datacenterName)
|
||||
.build()) {
|
||||
toreturn = cqlSession.execute(SchemaBuilder.dropKeyspace(keyspaceName).ifExists().build());
|
||||
_log.info("Keyspace {} dropped.", keyspaceName);
|
||||
|
@ -207,7 +207,7 @@ public class CassandraClusterConnection {
|
|||
private void createTables(){
|
||||
try (CqlSession cqlSession = configBuilder(CqlSession.builder())
|
||||
.addContactPoints(hosts)
|
||||
.withLocalDatacenter("1")
|
||||
.withLocalDatacenter(datacenterName)
|
||||
.withKeyspace(keyspaceName)
|
||||
.build()) {
|
||||
|
||||
|
|
|
@ -98,8 +98,10 @@ public class RunningCluster implements Serializable {
|
|||
for (ServiceEndpoint res : resources) {
|
||||
AccessPoint found = res.profile().accessPoints().iterator().next();
|
||||
host = found.address();
|
||||
datacenterName = found.description();
|
||||
keyspaceName = found.name();
|
||||
//datacenterName = found.description();
|
||||
datacenterName="d4science_datacenter";
|
||||
//keyspaceName = found.name();
|
||||
keyspaceName="dev_keyspace";
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue