From 4a55e4a43e79853bca7667658f839b57fd4ecbd7 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Mon, 20 Jan 2014 14:20:59 -0600 Subject: [PATCH] changed to cassandra storage and hard code connect for now --- index/fragment_container.go | 2 +- index/storage_cass.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index/fragment_container.go b/index/fragment_container.go index f4c54eecc..a783b1765 100644 --- a/index/fragment_container.go +++ b/index/fragment_container.go @@ -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() diff --git a/index/storage_cass.go b/index/storage_cass.go index ee878f138..304a7306b 100644 --- a/index/storage_cass.go +++ b/index/storage_cass.go @@ -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