Update cassandra_store.go

This commit is contained in:
eshujiushiwo 2016-11-28 15:14:19 +08:00 committed by GitHub
parent 809aa028ec
commit 3e29d0f75b

View file

@ -34,6 +34,7 @@ func NewCassandraStore(keyspace string, hosts ...string) (c *CassandraStore, err
c = &CassandraStore{}
s := strings.Split(hosts, ",")
if len(s) == 1 {
glog.V(0).Infof("Only one cassandra node to connect!A Cluster is Proposed" )
c.cluster = gocql.NewCluster(hosts...)
} else if len(s) > 1 {
c.cluster = gocql.NewCluster(s[0], s[1])