changed to cassandra storage and hard code connect for now

This commit is contained in:
Todd Gruben 2014-01-20 14:20:59 -06:00
parent daf42d5694
commit 4a55e4a43e
2 changed files with 4 additions and 3 deletions

View file

@ -168,7 +168,7 @@ type Fragment struct {
}
func getStorage(db string, slice int, frame string) Storage {
choice := 2
choice := 3
switch choice {
case 1:
return NewMemoryStorage()

View file

@ -15,14 +15,15 @@ type CassandraStorage struct {
func BuildSchema() {
/*
"CREATE KEYSPACE IF NOT EXISTS hotbox WITH strategy_class = SimpleStrategy AND strategy_options:replication_factor = 1"
"CREATE TABLE IF NOT EXISTS bitmap ( bitmap_id bigint, db varchar, slice int, ChunkKey bigint, BlockIndex int, block bigint, PRIMARY KEY ((bitmap_id, db, slice),ChunkKey,BlockIndex) )
CREATE TABLE IF NOT EXISTS bitmap ( bitmap_id bigint, db varchar, slice int, ChunkKey bigint, BlockIndex int, block bigint, PRIMARY KEY ((bitmap_id, db, slice),ChunkKey,BlockIndex) )
"
*/
}
func NewCassStorage() Storage {
obj := new(CassandraStorage)
cluster := gocql.NewCluster("127.0.0.1")
//cluster := gocql.NewCluster("127.0.0.1")
cluster := gocql.NewCluster("10.87.110.249")
cluster.Keyspace = "hotbox"
cluster.Consistency = gocql.Quorum
//cluster.ProtoVersion = 1