Skip to content

Commit 377732f

Browse files
authored
Merge pull request cfpb#1028 from nickgrippin/namespace
Make keyspace and cluster names configurable
2 parents f6e3152 + d9db715 commit 377732f

File tree

6 files changed

+7
-2
lines changed

6 files changed

+7
-2
lines changed

api/src/main/resources/application-dev.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ constructr.coordination.nodes = [${?ZOOKEEPER_HOST}":"${?ZOOKEEPER_PORT}]
3030

3131
clustering {
3232
name = "hmda"
33+
name = ${?HMDA_CLUSTER_NAME}
3334
ip = "127.0.0.1"
3435
port = 0
3536
port = ${?APP_PORT}

api/src/main/resources/application.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ constructr.coordination.nodes = [${?ZOOKEEPER_HOST}":"${?ZOOKEEPER_PORT}]
3636

3737
clustering {
3838
name = "hmda"
39+
name = ${?HMDA_CLUSTER_NAME}
3940
ip = "127.0.0.1"
4041
port = 0
4142
port = ${?APP_PORT}

api/src/main/scala/hmda/api/HmdaPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object HmdaPlatform {
3232

3333
def main(args: Array[String]): Unit = {
3434

35-
val system = ActorSystem("hmda", configuration)
35+
val system = ActorSystem(configuration.getString("clustering.name"), configuration)
3636
val supervisor = createSupervisor(system)
3737
val querySupervisor = createQuerySupervisor(system)
3838
implicit val ec = system.dispatcher

persistence-model/src/main/resources/application.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ cassandra-journal {
7070
contact-points = ["127.0.0.1"]
7171
contact-points = [${?CASSANDRA_CLUSTER_HOSTS}]
7272
keyspace = "hmda_journal"
73+
keyspace = ${?CASSANDRA_JOURNAL_KEYSPACE}
7374
table = "journal"
7475
keyspace-autocreate = true
7576
keyspace-autocreate-retries = 5
@@ -82,6 +83,7 @@ cassandra-snapshot-store {
8283
contact-points = ["127.0.0.1"]
8384
contact-points = [${?CASSANDRA_CLUSTER_HOSTS}]
8485
keyspace = "hmda_snapshot"
86+
keyspace = ${?CASSANDRA_SNAPSHOT_KEYSPACE}
8587
table = "snapshot"
8688
keyspace-autocreate = true
8789
keyspace-autocreate-retries = 5

query/src/main/resources/application.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ cassandra {
3737
port = 9042
3838
port = ${CASSANDRA_CLUSTER_PORT}
3939
keyspace = "hmda_query"
40+
keyspace = ${?CASSANDRA_QUERY_KEYSPACE}
4041
retries = 60
4142
retry-interval = 1000
4243
}

query/src/main/scala/hmda/query/repository/CassandraRepository.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trait CassandraRepository[A] {
2222

2323
val log = LoggerFactory.getLogger("CassandraRepository")
2424

25-
val keyspace = "hmda_query"
25+
val keyspace = cassandraKeyspace
2626

2727
@tailrec
2828
private def retry[T](n: Int)(fn: => T): Try[T] = {

0 commit comments

Comments
 (0)