Last active
December 16, 2017 21:44
-
-
Save ponkin/40db34dde4477f84e711 to your computer and use it in GitHub Desktop.
Revisions
-
ponkin revised this gist
Oct 29, 2015 . 1 changed file with 12 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -20,16 +20,18 @@ class CasandraSpec extends FunSuite |'class': 'SimpleStrategy', |'replication_factor':1} |""".stripMargin) session.execute(s"""CREATE TABLE $testKeyspace.$testTable( | partitionKey text, | clusterKey text, | someValue int, | PRIMARY KEY (partitionKey, clusterKey)) | WITH | compaction = { 'class' : 'SizeTieredCompactionStrategy'} AND | compression = { 'sstable_compression' : 'SnappyCompressor' } | """.stripMargin) } } override def clearCache: Unit = Unit } -
ponkin created this gist
Oct 29, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ class CasandraSpec extends FunSuite with Eventually with BeforeAndAfterAll with LocalSparkContext with EmbeddedCassandra with Logging{ val testKeyspace = "test1" val testTable = "table1" var conn: CassandraConnector = _ override def beforeAll(): Unit = { useCassandraConfig(Seq("cassandra-default.yaml.template")) conn = CassandraConnector(Set(EmbeddedCassandra.getHost(0))) conn.withSessionDo { session => session.execute( s"""DROP KEYSPACE IF EXISTS $testKeyspace""") session.execute( s"""CREATE KEYSPACE $testKeyspace |WITH replication = { |'class': 'SimpleStrategy', |'replication_factor':1} |""".stripMargin) session.execute( s"""CREATE TABLE $testKeyspace.$testTable( | partitionKey text, | clusterKey text, | someValue int, | PRIMARY KEY (partitionKey, clusterKey)) | WITH | compaction = { 'class' : 'SizeTieredCompactionStrategy'} AND | compression = { 'sstable_compression' : 'SnappyCompressor' } | """.stripMargin) } } }