forked from apache/cassandra-gocql-driver
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from sylwiaszunejko/drop_simple_strategy
Switch tests from SimpleStrategy to NetworkTopologyStrategy
- Loading branch information
Showing
18 changed files
with
107 additions
and
129 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,25 @@ | ||
CREATE KEYSPACE gocqlx_aggregates WITH replication = { | ||
'class': 'SimpleStrategy', | ||
'replication_factor': '2' | ||
}; | ||
|
||
CREATE FUNCTION gocqlx_aggregates.avgstate (state | ||
tuple<int, double>, val | ||
double) | ||
CALLED ON NULL INPUT | ||
RETURNS frozen<tuple<int, double>> | ||
LANGUAGE lua | ||
AS $$ | ||
return { state[1]+1, state[2]+val } | ||
$$; | ||
|
||
CREATE FUNCTION gocqlx_aggregates.avgfinal (state | ||
tuple<int, double>) | ||
CALLED ON NULL INPUT | ||
RETURNS double | ||
LANGUAGE lua | ||
AS $$ | ||
CREATE KEYSPACE gocqlx_aggregates WITH replication = {'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'datacenter1': '2'} AND durable_writes = true; | ||
CREATE FUNCTION gocqlx_aggregates.avgfinal(state frozen<tuple<int, double>>) | ||
CALLED ON NULL INPUT | ||
RETURNS double | ||
LANGUAGE lua | ||
AS $$ | ||
r=0 | ||
r=state[2] | ||
r=r/state[1] | ||
return r | ||
$$; | ||
|
||
CREATE AGGREGATE gocqlx_aggregates.average( | ||
double) | ||
SFUNC avgstate | ||
STYPE tuple<int, double> | ||
FINALFUNC avgfinal | ||
INITCOND (0, 0); | ||
|
||
$$; | ||
CREATE FUNCTION gocqlx_aggregates.avgstate(state frozen<tuple<int, double>>, val double) | ||
CALLED ON NULL INPUT | ||
RETURNS frozen<tuple<int, double>> | ||
LANGUAGE lua | ||
AS $$ | ||
return { state[1]+1, state[2]+val } | ||
|
||
$$; | ||
CREATE AGGREGATE gocqlx_aggregates.average(double) | ||
SFUNC avgstate | ||
STYPE frozen<tuple<int, double>> | ||
FINALFUNC avgfinal | ||
INITCOND (0, 0); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
CREATE KEYSPACE gocqlx_keyspace WITH replication = { | ||
'class': 'SimpleStrategy', | ||
'class': 'NetworkTopologyStrategy', | ||
'replication_factor': '2' | ||
}; |
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,4 +1 @@ | ||
CREATE KEYSPACE gocqlx_keyspace WITH replication = { | ||
'class': 'SimpleStrategy', | ||
'replication_factor': '2' | ||
}; | ||
CREATE KEYSPACE gocqlx_keyspace WITH replication = {'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'datacenter1': '2'} AND durable_writes = true; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,61 @@ | ||
CREATE KEYSPACE gocqlx_mv WITH replication = { | ||
'class': 'SimpleStrategy', | ||
'replication_factor': '2' | ||
}; | ||
|
||
CREATE KEYSPACE gocqlx_mv WITH replication = {'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'datacenter1': '2'} AND durable_writes = true; | ||
CREATE TABLE gocqlx_mv.mv_buildings ( | ||
name text PRIMARY KEY, | ||
name text, | ||
built int, | ||
city text, | ||
meters int | ||
meters int, | ||
PRIMARY KEY (name) | ||
) WITH bloom_filter_fp_chance = 0.01 | ||
AND caching = {'keys':'ALL','rows_per_partition':'ALL'} | ||
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'} | ||
AND comment = '' | ||
AND compaction = {'class':'SizeTieredCompactionStrategy'} | ||
AND compression = {'sstable_compression':'org.apache.cassandra.io.compress.LZ4Compressor'} | ||
AND compaction = {'class': 'SizeTieredCompactionStrategy'} | ||
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} | ||
AND crc_check_chance = 1 | ||
AND default_time_to_live = 0 | ||
AND gc_grace_seconds = 864000 | ||
AND max_index_interval = 2048 | ||
AND memtable_flush_period_in_ms = 0 | ||
AND min_index_interval = 128 | ||
AND speculative_retry = '99.0PERCENTILE'; | ||
|
||
AND speculative_retry = '99.0PERCENTILE' | ||
AND paxos_grace_seconds = 864000 | ||
AND tombstone_gc = {'mode': 'timeout', 'propagation_delay_in_seconds': '3600'}; | ||
CREATE MATERIALIZED VIEW gocqlx_mv.mv_building_by_city AS | ||
SELECT * | ||
SELECT city, name, built, meters | ||
FROM gocqlx_mv.mv_buildings | ||
WHERE city IS NOT null | ||
PRIMARY KEY (city, name) | ||
WITH CLUSTERING ORDER BY (name ASC) | ||
AND bloom_filter_fp_chance = 0.01 | ||
AND caching = {'keys':'ALL','rows_per_partition':'ALL'} | ||
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'} | ||
AND comment = '' | ||
AND compaction = {'class':'SizeTieredCompactionStrategy'} | ||
AND compression = {'sstable_compression':'org.apache.cassandra.io.compress.LZ4Compressor'} | ||
AND compaction = {'class': 'SizeTieredCompactionStrategy'} | ||
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} | ||
AND crc_check_chance = 1 | ||
AND default_time_to_live = 0 | ||
AND gc_grace_seconds = 864000 | ||
AND max_index_interval = 2048 | ||
AND memtable_flush_period_in_ms = 0 | ||
AND min_index_interval = 128 | ||
AND speculative_retry = '99.0PERCENTILE'; | ||
|
||
AND speculative_retry = '99.0PERCENTILE' | ||
AND paxos_grace_seconds = 864000 | ||
AND tombstone_gc = {'mode': 'timeout', 'propagation_delay_in_seconds': '3600'}; | ||
CREATE MATERIALIZED VIEW gocqlx_mv.mv_building_by_city2 AS | ||
SELECT | ||
city, | ||
name, | ||
meters | ||
SELECT city, name, meters | ||
FROM gocqlx_mv.mv_buildings | ||
WHERE city IS NOT null | ||
PRIMARY KEY (city, name) | ||
WITH CLUSTERING ORDER BY (name ASC) | ||
AND bloom_filter_fp_chance = 0.01 | ||
AND caching = {'keys':'ALL','rows_per_partition':'ALL'} | ||
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'} | ||
AND comment = '' | ||
AND compaction = {'class':'SizeTieredCompactionStrategy'} | ||
AND compression = {'sstable_compression':'org.apache.cassandra.io.compress.LZ4Compressor'} | ||
AND compaction = {'class': 'SizeTieredCompactionStrategy'} | ||
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} | ||
AND crc_check_chance = 1 | ||
AND default_time_to_live = 0 | ||
AND gc_grace_seconds = 864000 | ||
AND max_index_interval = 2048 | ||
AND memtable_flush_period_in_ms = 0 | ||
AND min_index_interval = 128 | ||
AND speculative_retry = '99.0PERCENTILE'; | ||
AND speculative_retry = '99.0PERCENTILE' | ||
AND paxos_grace_seconds = 864000 | ||
AND tombstone_gc = {'mode': 'timeout', 'propagation_delay_in_seconds': '3600'}; |
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.