forked from velvia/FiloDB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable all Cassandra tables to take host/port/keyspace config from a …
…Config
- Loading branch information
Showing
13 changed files
with
142 additions
and
75 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
cassandra/src/main/scala/filodb.cassandra/FiloCassandraConnector.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,22 @@ | ||
package filodb.cassandra | ||
|
||
import com.datastax.driver.core.{Session, VersionNumber} | ||
import com.typesafe.config.Config | ||
import com.websudos.phantom.connectors.{ContactPoints, KeySpace} | ||
import net.ceedubs.ficus.Ficus._ | ||
|
||
trait FiloCassandraConnector { | ||
private[this] lazy val connector = | ||
ContactPoints(config.as[Seq[String]]("hosts"), config.getInt("port")).keySpace(keySpace.name) | ||
|
||
// Cassandra config with following keys: keyspace, hosts, port | ||
def config: Config | ||
|
||
implicit lazy val keySpace = KeySpace(config.getString("keyspace")) | ||
|
||
implicit lazy val session: Session = connector.session | ||
|
||
def cassandraVersion: VersionNumber = connector.cassandraVersion | ||
|
||
def cassandraVersions: Set[VersionNumber] = connector.cassandraVersions | ||
} |
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
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
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
Oops, something went wrong.