mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
cluster c*
This commit is contained in:
parent
2e20261b00
commit
dc3c9022ce
3 changed files with 6 additions and 8 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue