-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract keyspace configuration to a separate class. (#539)
The idea is to allow several instances to exist, i.e. in `CreateJournalSchema` and `CreateSnapshotSchema`.
- Loading branch information
Showing
6 changed files
with
30 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
.../src/main/scala/com/evolutiongaming/kafka/journal/eventual/cassandra/KeyspaceConfig.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.evolutiongaming.kafka.journal.eventual.cassandra | ||
|
||
import com.evolutiongaming.scassandra.ReplicationStrategyConfig | ||
import pureconfig.ConfigReader | ||
import pureconfig.generic.semiauto.deriveReader | ||
|
||
final case class KeyspaceConfig( | ||
name: String = "journal", | ||
replicationStrategy: ReplicationStrategyConfig = ReplicationStrategyConfig.Default, | ||
autoCreate: Boolean = true | ||
) | ||
|
||
object KeyspaceConfig { | ||
|
||
val default: KeyspaceConfig = KeyspaceConfig() | ||
|
||
implicit val configReaderKeyspace: ConfigReader[KeyspaceConfig] = deriveReader | ||
} |
23 changes: 4 additions & 19 deletions
23
...ra/src/main/scala/com/evolutiongaming/kafka/journal/eventual/cassandra/SchemaConfig.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,24 @@ | ||
package com.evolutiongaming.kafka.journal.eventual.cassandra | ||
|
||
import com.evolutiongaming.scassandra.ReplicationStrategyConfig | ||
import pureconfig.ConfigReader | ||
import pureconfig.generic.semiauto.deriveReader | ||
|
||
|
||
final case class SchemaConfig( | ||
keyspace: SchemaConfig.Keyspace = SchemaConfig.Keyspace.default, | ||
keyspace: KeyspaceConfig = KeyspaceConfig.default, | ||
journalTable: String = "journal", | ||
metadataTable: String = "metadata", | ||
metaJournalTable: String = "metajournal", | ||
pointerTable: String = "pointer", | ||
pointer2Table: String = "pointer2", | ||
settingTable: String = "setting", | ||
locksTable: String = "locks", | ||
autoCreate: Boolean = true) | ||
|
||
autoCreate: Boolean = true | ||
) | ||
|
||
object SchemaConfig { | ||
|
||
val default: SchemaConfig = SchemaConfig() | ||
|
||
implicit val configReaderSchemaConfig: ConfigReader[SchemaConfig] = deriveReader | ||
|
||
|
||
final case class Keyspace( | ||
name: String = "journal", | ||
replicationStrategy: ReplicationStrategyConfig = ReplicationStrategyConfig.Default, | ||
autoCreate: Boolean = true) | ||
|
||
object Keyspace { | ||
|
||
val default: Keyspace = Keyspace() | ||
|
||
|
||
implicit val configReaderKeyspace: ConfigReader[Keyspace] = deriveReader | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters