mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 21:09:06 +08:00
c2734fa55f
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
42 lines
680 B
Go
42 lines
680 B
Go
package grpcindexservice
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/util/paramtable"
|
|
)
|
|
|
|
type ParamTable struct {
|
|
paramtable.BaseTable
|
|
|
|
ServiceAddress string
|
|
ServicePort int
|
|
}
|
|
|
|
var Params ParamTable
|
|
var once sync.Once
|
|
|
|
func (pt *ParamTable) Init() {
|
|
once.Do(func() {
|
|
pt.BaseTable.Init()
|
|
pt.initParams()
|
|
})
|
|
}
|
|
|
|
func (pt *ParamTable) initParams() {
|
|
pt.initServicePort()
|
|
pt.initServiceAddress()
|
|
}
|
|
|
|
func (pt *ParamTable) initServicePort() {
|
|
pt.ServicePort = pt.ParseInt("indexService.port")
|
|
}
|
|
|
|
func (pt *ParamTable) initServiceAddress() {
|
|
ret, err := pt.Load("IndexServiceAddress")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
pt.ServiceAddress = ret
|
|
}
|