vitess-gh/go/vt/zktopo/cell.go

31 строка
643 B
Go
Исходник Обычный вид История

2013-08-28 00:11:36 +04:00
// Copyright 2013, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package zktopo
import (
2013-09-06 00:01:48 +04:00
"sort"
2013-08-28 00:11:36 +04:00
"github.com/youtube/vitess/go/zk"
)
/*
This file contains the cell management methods of zktopo.Server
*/
func (zkts *Server) GetKnownCells() ([]string, error) {
2014-12-17 05:44:35 +03:00
cellsWithGlobal, err := zk.ZkKnownCells()
if err != nil {
return cellsWithGlobal, err
}
2013-08-28 00:11:36 +04:00
cells := make([]string, 0, len(cellsWithGlobal))
for _, cell := range cellsWithGlobal {
if cell != "global" {
cells = append(cells, cell)
}
}
2013-09-06 00:01:48 +04:00
sort.Strings(cells)
2013-08-28 00:11:36 +04:00
return cells, nil
}