Skip to content

Commit

Permalink
Update solr_zk.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Strum355 authored Oct 28, 2017
1 parent c3079c9 commit bfb9301
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions solr_zk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import (
"sync"
)

func init() {

}

type solrZkInstance struct {
zookeeper Zookeeper
collection string
Expand All @@ -26,7 +22,11 @@ type solrZkInstance struct {
}

func NewSolrZK(zookeepers string, zkRoot string, collectionName string, opts ...func(*solrZkInstance)) SolrZK {
instance := solrZkInstance{zookeeper: NewZookeeper(zookeepers, zkRoot, collectionName), sleepTimeMS: 500, collection: collectionName}
instance := solrZkInstance{
zookeeper: NewZookeeper(zookeepers, zkRoot, collectionName),
sleepTimeMS: 500,
collection: collectionName
}

instance.clusterStateMutex = &sync.Mutex{}
instance.listening = false
Expand Down Expand Up @@ -140,10 +140,10 @@ func (s *solrZkInstance) GetReplicaUris() ([]string, error) {
return []string{}, nil
}
nodes := cs.LiveNodes
var uris []string = make([]string, 0, len(nodes))
for _, v := range nodes {
uris := make([]string, len(nodes))
for i, v := range nodes {
host := fmt.Sprintf("%s://%s/v2/c", protocol, v)
uris = append(uris, host)
uris[i] = host
}
return shuffleNodes(uris), nil

Expand Down

0 comments on commit bfb9301

Please sign in to comment.