cluster c*

This commit is contained in:
Todd Gruben 2014-04-11 10:04:05 -05:00
parent 2e20261b00
commit dc3c9022ce
3 changed files with 6 additions and 8 deletions

View file

@ -48,7 +48,7 @@ func NewService() *Service {
service.WebService = NewWebService(service)
service.Index = index.NewFragmentContainer()
service.Hold = hold.NewHolder()
service.version = "0.0.16"
service.version = "0.0.18"
service.name = "Cruncher"
service.PrepareLogging()
fmt.Printf("Pilosa %s\n", service.version)

View file

@ -244,15 +244,13 @@ func getStorage(db string, slice int, frame string, fid SUUID) Storage {
full_dir := fmt.Sprintf("%s/%s/%d/%s/%s", base_path, db, slice, frame, SUUID_to_Hex(fid))
return NewLevelDBStorage(full_dir)
case "cassandra":
host := config.GetString("cassandra_host")
if host == "" {
host = "localhost"
}
// host := config.GetString("cassandra_host")
hosts := config.GetStringArrayDefault("cassandra_servers", []string{"localhost"})
keyspace := config.GetString("cassandra_keyspace")
if keyspace == "" {
keyspace = "hotbox"
}
return NewCassStorage(host, keyspace)
return NewCassStorage(hosts, keyspace)
}
return nil
}

View file

@ -29,10 +29,10 @@ func BuildSchema() {
*/
}
func NewCassStorage(host, keyspace string) Storage {
func NewCassStorage(hosts []string, keyspace string) Storage {
obj := new(CassandraStorage)
//cluster := gocql.NewCluster("127.0.0.1")
cluster := gocql.NewCluster(host)
cluster := gocql.NewCluster(hosts...)
cluster.Keyspace = keyspace
//cluster.Consistency = gocql.Quorum
cluster.Consistency = gocql.One