From 9e1eed88c922cb2db2d6291dfa8eb414de476a64 Mon Sep 17 00:00:00 2001 From: kpango Date: Wed, 16 Sep 2020 04:30:19 +0900 Subject: [PATCH 1/8] [patch] add C.free & delete ivc before core.BulkInsert C' function executing for reducing memory usage Signed-off-by: kpango --- go.mod | 6 +-- go.sum | 12 +++--- internal/core/ngt/ngt.go | 72 ++++++++++++++++++++++--------- pkg/agent/core/ngt/service/ngt.go | 6 ++- 4 files changed, 65 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 45d9d932c9..c5e6459bfa 100755 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 replace ( cloud.google.com/go => cloud.google.com/go v0.65.0 github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible - github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.34.20 + github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.34.24 github.com/boltdb/bolt => github.com/boltdb/bolt v1.3.1 github.com/chzyer/logex => github.com/chzyer/logex v1.1.11-0.20170329064859-445be9e134b2 github.com/coreos/etcd => go.etcd.io/etcd v3.3.25+incompatible @@ -71,11 +71,11 @@ require ( go.uber.org/goleak v1.1.10 golang.org/x/net v0.0.0-20200904194848-62affa334b73 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 - golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 + golang.org/x/sys v0.0.0-20200915084602-288bc346aa39 gonum.org/v1/hdf5 v0.0.0-20200504100616-496fefe91614 gonum.org/v1/plot v0.8.0 google.golang.org/api v0.31.0 - google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d + google.golang.org/genproto v0.0.0-20200914193844-75d14daec038 google.golang.org/grpc v1.31.1 gopkg.in/yaml.v2 v2.3.0 k8s.io/api v0.18.8 diff --git a/go.sum b/go.sum index 0431573679..2b5603f6c1 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.34.20 h1:D9otznteZZyN5pRyFETqveYia/85Xzk7+RaPGB1I9fE= -github.com/aws/aws-sdk-go v1.34.20/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.24 h1:eTBgLksUJNLk5EwBl/lUweXjBZHbxvfcvqUxAJu7Fqg= +github.com/aws/aws-sdk-go v1.34.24/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -622,8 +622,8 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200727154430-2d971f7391a4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 h1:W0lCpv29Hv0UaM1LXb9QlBHLNP8UFfcKjblhVCWftOM= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200915084602-288bc346aa39 h1:356XA7ITklAU2//sYkjFeco+dH1bCRD8XCJ9FIEsvo4= +golang.org/x/sys v0.0.0-20200915084602-288bc346aa39/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -744,8 +744,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d h1:92D1fum1bJLKSdr11OJ+54YeCMCGYIygTA7R/YZxH5M= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200914193844-75d14daec038 h1:SnvTpXhVDJGFxzZiHbMUZTh3VjU2Vx2feJ7Zfl5+OIY= +google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= diff --git a/internal/core/ngt/ngt.go b/internal/core/ngt/ngt.go index 6db121adc6..b4995f0c7b 100644 --- a/internal/core/ngt/ngt.go +++ b/internal/core/ngt/ngt.go @@ -214,12 +214,14 @@ func (n *ngt) create() (err error) { return err } } + path := C.CString(n.idxPath) + defer C.free(unsafe.Pointer(path)) if !n.inMemory { - n.index = C.ngt_create_graph_and_tree(C.CString(n.idxPath), n.prop, n.ebuf) + n.index = C.ngt_create_graph_and_tree(path, n.prop, n.ebuf) if n.index == nil { return n.newGoError(n.ebuf) } - if C.ngt_save_index(n.index, C.CString(n.idxPath), n.ebuf) == ErrorCode { + if C.ngt_save_index(n.index, path, n.ebuf) == ErrorCode { return n.newGoError(n.ebuf) } } else { @@ -237,7 +239,9 @@ func (n *ngt) open() error { return errors.ErrIndexNotFound } - n.index = C.ngt_open_index(C.CString(n.idxPath), n.ebuf) + path := C.CString(n.idxPath) + defer C.free(unsafe.Pointer(path)) + n.index = C.ngt_open_index(path, n.ebuf) if n.index == nil { return n.newGoError(n.ebuf) } @@ -277,18 +281,27 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search if radius == 0 { radius = n.radius } + cvec := (*C.float)(&vec[0]) + defer C.free(unsafe.Pointer(cvec)) + csize := *(*C.size_t)(unsafe.Pointer(&size)) + defer C.free(unsafe.Pointer(&csize)) + cepsilon := *(*C.float)(unsafe.Pointer(&epsilon)) + defer C.free(unsafe.Pointer(&cepsilon)) + cradius := *(*C.float)(unsafe.Pointer(&radius)) + defer C.free(unsafe.Pointer(&cradius)) n.mu.RLock() ret := C.ngt_search_index_as_float( n.index, - (*C.float)(&vec[0]), + // *(*C.float)(unsafe.Pointer(&vec[0])), + cvec, n.dimension, - // C.size_t(size), - *(*C.size_t)(unsafe.Pointer(&size)), - // C.float(epsilon), - *(*C.float)(unsafe.Pointer(&epsilon)), - *(*C.float)(unsafe.Pointer(&radius)), - // C.float(radius), + csize, + cepsilon, + cradius, + // *(*C.size_t)(unsafe.Pointer(&size)), + // *(*C.float)(unsafe.Pointer(&epsilon)), + // *(*C.float)(unsafe.Pointer(&radius)), results, n.ebuf) @@ -308,7 +321,9 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search result := make([]SearchResult, rsize) for i := 0; i < rsize; i++ { - d := C.ngt_get_result(results, C.uint32_t(i), n.ebuf) + idx := C.uint32_t(i) + defer C.free(unsafe.Pointer(&idx)) + d := C.ngt_get_result(results, idx, n.ebuf) if d.id == 0 && d.distance == 0 { result[i] = SearchResult{0, 0, n.newGoError(n.ebuf)} } else { @@ -322,8 +337,12 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search // Insert returns NGT object id. // This only stores not indexing, you must call CreateIndex and SaveIndex. func (n *ngt) Insert(vec []float32) (uint, error) { + cvec := (*C.float)(&vec[0]) + defer C.free(unsafe.Pointer(cvec)) + cdim := C.uint32_t(n.dimension) + defer C.free(unsafe.Pointer(&cdim)) n.mu.Lock() - id := C.ngt_insert_index_as_float(n.index, (*C.float)(&vec[0]), C.uint32_t(n.dimension), n.ebuf) + id := C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf) n.mu.Unlock() if id == 0 { return 0, n.newGoError(n.ebuf) @@ -359,11 +378,14 @@ func (n *ngt) BulkInsert(vecs [][]float32) ([]uint, []error) { ids := make([]uint, 0, len(vecs)) errs := make([]error, 0, len(vecs)) - var id uint n.mu.Lock() for _, vec := range vecs { + cvec := (*C.float)(&vec[0]) + defer C.free(unsafe.Pointer(cvec)) + cdim := C.uint32_t(n.dimension) + defer C.free(unsafe.Pointer(&cdim)) // n.mu.Lock() - id = uint(C.ngt_insert_index_as_float(n.index, (*C.float)(&vec[0]), C.uint32_t(n.dimension), n.ebuf)) + id := uint(C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf)) // n.mu.Unlock() if id == 0 { errs = append(errs, n.newGoError(n.ebuf)) @@ -424,8 +446,10 @@ func (n *ngt) CreateIndex(poolSize uint32) error { if poolSize == 0 { poolSize = n.poolSize } + cpool := C.uint32_t(poolSize) + defer C.free(unsafe.Pointer(&cpool)) n.mu.Lock() - ret := C.ngt_create_index(n.index, C.uint32_t(poolSize), n.ebuf) + ret := C.ngt_create_index(n.index, cpool, n.ebuf) if ret == ErrorCode { ne := n.ebuf n.mu.Unlock() @@ -439,8 +463,10 @@ func (n *ngt) CreateIndex(poolSize uint32) error { // SaveIndex stores NGT index to storage. func (n *ngt) SaveIndex() error { if !n.inMemory { + path := C.CString(n.idxPath) + defer C.free(unsafe.Pointer(path)) n.mu.Lock() - ret := C.ngt_save_index(n.index, C.CString(n.idxPath), n.ebuf) + ret := C.ngt_save_index(n.index, path, n.ebuf) if ret == ErrorCode { ne := n.ebuf n.mu.Unlock() @@ -454,8 +480,10 @@ func (n *ngt) SaveIndex() error { // Remove removes from NGT index. func (n *ngt) Remove(id uint) error { + oid := C.ObjectID(id) + defer C.free(unsafe.Pointer(&oid)) n.mu.Lock() - ret := C.ngt_remove_index(n.index, C.ObjectID(id), n.ebuf) + ret := C.ngt_remove_index(n.index, oid, n.ebuf) if ret == ErrorCode { ne := n.ebuf n.mu.Unlock() @@ -470,7 +498,9 @@ func (n *ngt) Remove(id uint) error { func (n *ngt) BulkRemove(ids ...uint) error { n.mu.Lock() for _, id := range ids { - if C.ngt_remove_index(n.index, C.ObjectID(id), n.ebuf) == ErrorCode { + oid := C.ObjectID(id) + defer C.free(unsafe.Pointer(&oid)) + if C.ngt_remove_index(n.index, oid, n.ebuf) == ErrorCode { ne := n.ebuf n.mu.Unlock() return n.newGoError(ne) @@ -484,10 +514,12 @@ func (n *ngt) BulkRemove(ids ...uint) error { func (n *ngt) GetVector(id uint) ([]float32, error) { dimension := int(n.dimension) var ret []float32 + oid := C.ObjectID(id) + defer C.free(unsafe.Pointer(&oid)) switch n.objectType { case Float: n.mu.RLock() - results := C.ngt_get_object_as_float(n.ospace, C.ObjectID(id), n.ebuf) + results := C.ngt_get_object_as_float(n.ospace, oid, n.ebuf) n.mu.RUnlock() if results == nil { return nil, n.newGoError(n.ebuf) @@ -498,7 +530,7 @@ func (n *ngt) GetVector(id uint) ([]float32, error) { // } case Uint8: n.mu.RLock() - results := C.ngt_get_object_as_integer(n.ospace, C.ObjectID(id), n.ebuf) + results := C.ngt_get_object_as_integer(n.ospace, oid, n.ebuf) n.mu.RUnlock() if results == nil { return nil, n.newGoError(n.ebuf) diff --git a/pkg/agent/core/ngt/service/ngt.go b/pkg/agent/core/ngt/service/ngt.go index 715ce957d1..26261b7db1 100644 --- a/pkg/agent/core/ngt/service/ngt.go +++ b/pkg/agent/core/ngt/service/ngt.go @@ -542,7 +542,6 @@ func (n *ngt) CreateIndex(ctx context.Context, poolSize uint32) (err error) { } n.indexing.Store(true) atomic.StoreUint64(&n.ic, 0) - n.gc() t := time.Now().UnixNano() defer n.indexing.Store(false) defer n.gc() @@ -591,6 +590,10 @@ func (n *ngt) CreateIndex(ctx context.Context, poolSize uint32) (err error) { } return true }) + for _, uuid := range uuids { + n.ivc.Delete(uuid) + } + n.gc() log.Info("create index insert index phase started") log.Debugf("inserting index: %#v", vecs) oids, errs := n.core.BulkInsert(vecs) @@ -607,7 +610,6 @@ func (n *ngt) CreateIndex(ctx context.Context, poolSize uint32) (err error) { log.Info("create index insert kvs phase started") log.Debugf("uuids = %#v\t\toids = %#v", uuids, oids) for i, uuid := range uuids { - n.ivc.Delete(uuid) if len(oids) > i { oid := uint32(oids[i]) if oid != 0 { From 02fd1912fdf7da4ec63d86da6709a223ce20957e Mon Sep 17 00:00:00 2001 From: kpango Date: Wed, 16 Sep 2020 12:30:45 +0900 Subject: [PATCH 2/8] fix Signed-off-by: kpango --- internal/core/ngt/ngt.go | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/internal/core/ngt/ngt.go b/internal/core/ngt/ngt.go index b4995f0c7b..7e581db98c 100644 --- a/internal/core/ngt/ngt.go +++ b/internal/core/ngt/ngt.go @@ -321,9 +321,10 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search result := make([]SearchResult, rsize) for i := 0; i < rsize; i++ { - idx := C.uint32_t(i) - defer C.free(unsafe.Pointer(&idx)) - d := C.ngt_get_result(results, idx, n.ebuf) + // idx := C.uint32_t(i) + // defer C.free(unsafe.Pointer(&idx)) + // d := C.ngt_get_result(results, idx, n.ebuf) + d := C.ngt_get_result(results, C.uint32_t(i), n.ebuf) if d.id == 0 && d.distance == 0 { result[i] = SearchResult{0, 0, n.newGoError(n.ebuf)} } else { @@ -339,10 +340,11 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search func (n *ngt) Insert(vec []float32) (uint, error) { cvec := (*C.float)(&vec[0]) defer C.free(unsafe.Pointer(cvec)) - cdim := C.uint32_t(n.dimension) - defer C.free(unsafe.Pointer(&cdim)) + // cdim := C.uint32_t(n.dimension) + // defer C.free(unsafe.Pointer(&cdim)) n.mu.Lock() - id := C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf) + // id := C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf) + id := C.ngt_insert_index_as_float(n.index, cvec, C.uint32_t(n.dimension), n.ebuf) n.mu.Unlock() if id == 0 { return 0, n.newGoError(n.ebuf) @@ -382,10 +384,10 @@ func (n *ngt) BulkInsert(vecs [][]float32) ([]uint, []error) { for _, vec := range vecs { cvec := (*C.float)(&vec[0]) defer C.free(unsafe.Pointer(cvec)) - cdim := C.uint32_t(n.dimension) - defer C.free(unsafe.Pointer(&cdim)) + // cdim := C.uint32_t(n.dimension) + // defer C.free(unsafe.Pointer(cdim)) // n.mu.Lock() - id := uint(C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf)) + id := uint(C.ngt_insert_index_as_float(n.index, cvec, C.uint32_t(n.dimension), n.ebuf)) // n.mu.Unlock() if id == 0 { errs = append(errs, n.newGoError(n.ebuf)) @@ -446,10 +448,11 @@ func (n *ngt) CreateIndex(poolSize uint32) error { if poolSize == 0 { poolSize = n.poolSize } - cpool := C.uint32_t(poolSize) - defer C.free(unsafe.Pointer(&cpool)) + // cpool := C.uint32_t(poolSize) + // defer C.free(unsafe.Pointer(&cpool)) n.mu.Lock() - ret := C.ngt_create_index(n.index, cpool, n.ebuf) + ret := C.ngt_create_index(n.index, C.uint32_t(poolSize), n.ebuf) + // ret := C.ngt_create_index(n.index, cpool, n.ebuf) if ret == ErrorCode { ne := n.ebuf n.mu.Unlock() From 4c2b8ae49613dad544d2db2a7646611476413ebc Mon Sep 17 00:00:00 2001 From: kpango Date: Wed, 16 Sep 2020 15:30:01 +0900 Subject: [PATCH 3/8] fix Signed-off-by: kpango --- internal/core/ngt/ngt.go | 54 +++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/internal/core/ngt/ngt.go b/internal/core/ngt/ngt.go index 7e581db98c..5ebbcd09ae 100644 --- a/internal/core/ngt/ngt.go +++ b/internal/core/ngt/ngt.go @@ -281,29 +281,30 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search if radius == 0 { radius = n.radius } - cvec := (*C.float)(&vec[0]) - defer C.free(unsafe.Pointer(cvec)) - csize := *(*C.size_t)(unsafe.Pointer(&size)) - defer C.free(unsafe.Pointer(&csize)) - cepsilon := *(*C.float)(unsafe.Pointer(&epsilon)) - defer C.free(unsafe.Pointer(&cepsilon)) - cradius := *(*C.float)(unsafe.Pointer(&radius)) - defer C.free(unsafe.Pointer(&cradius)) + // cvec := (*C.float)(&vec[0]) + // defer C.free(unsafe.Pointer(cvec)) + // csize := *(*C.size_t)(unsafe.Pointer(&size)) + // defer C.free(unsafe.Pointer(&csize)) + // cepsilon := *(*C.float)(unsafe.Pointer(&epsilon)) + // defer C.free(unsafe.Pointer(&cepsilon)) + // cradius := *(*C.float)(unsafe.Pointer(&radius)) + // defer C.free(unsafe.Pointer(&cradius)) n.mu.RLock() ret := C.ngt_search_index_as_float( n.index, - // *(*C.float)(unsafe.Pointer(&vec[0])), - cvec, + (*C.float)(unsafe.Pointer(&vec[0])), + // cvec, n.dimension, - csize, - cepsilon, - cradius, - // *(*C.size_t)(unsafe.Pointer(&size)), - // *(*C.float)(unsafe.Pointer(&epsilon)), - // *(*C.float)(unsafe.Pointer(&radius)), + // csize, + // cepsilon, + // cradius, + *(*C.size_t)(unsafe.Pointer(&size)), + *(*C.float)(unsafe.Pointer(&epsilon)), + *(*C.float)(unsafe.Pointer(&radius)), results, n.ebuf) + defer C.free(unsafe.Pointer(&ret)) if ret == ErrorCode { // TODO global lock取るのどうする問題 @@ -315,6 +316,7 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search n.mu.RUnlock() rsize := int(C.ngt_get_result_size(results, n.ebuf)) + defer C.free(unsafe.Pointer(&rsize)) if rsize == -1 { return nil, n.newGoError(n.ebuf) } @@ -338,13 +340,14 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search // Insert returns NGT object id. // This only stores not indexing, you must call CreateIndex and SaveIndex. func (n *ngt) Insert(vec []float32) (uint, error) { - cvec := (*C.float)(&vec[0]) - defer C.free(unsafe.Pointer(cvec)) + // cvec := (*C.float)(&vec[0]) + // defer C.free(unsafe.Pointer(cvec)) // cdim := C.uint32_t(n.dimension) // defer C.free(unsafe.Pointer(&cdim)) n.mu.Lock() // id := C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf) - id := C.ngt_insert_index_as_float(n.index, cvec, C.uint32_t(n.dimension), n.ebuf) + id := C.ngt_insert_index_as_float(n.index, (*C.float)(&vec[0]), C.uint32_t(n.dimension), n.ebuf) + defer C.free(unsafe.Pointer(&id)) n.mu.Unlock() if id == 0 { return 0, n.newGoError(n.ebuf) @@ -382,17 +385,17 @@ func (n *ngt) BulkInsert(vecs [][]float32) ([]uint, []error) { n.mu.Lock() for _, vec := range vecs { - cvec := (*C.float)(&vec[0]) - defer C.free(unsafe.Pointer(cvec)) + // cvec := (*C.float)(&vec[0]) + // defer C.free(unsafe.Pointer(&vec)) // cdim := C.uint32_t(n.dimension) // defer C.free(unsafe.Pointer(cdim)) - // n.mu.Lock() - id := uint(C.ngt_insert_index_as_float(n.index, cvec, C.uint32_t(n.dimension), n.ebuf)) - // n.mu.Unlock() + // id := uint(C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf)) + id := C.ngt_insert_index_as_float(n.index, (*C.float)(&vec[0]), C.uint32_t(n.dimension), n.ebuf) + defer C.free(unsafe.Pointer(&id)) if id == 0 { errs = append(errs, n.newGoError(n.ebuf)) } - ids = append(ids, id) + ids = append(ids, uint(id)) } n.mu.Unlock() @@ -452,6 +455,7 @@ func (n *ngt) CreateIndex(poolSize uint32) error { // defer C.free(unsafe.Pointer(&cpool)) n.mu.Lock() ret := C.ngt_create_index(n.index, C.uint32_t(poolSize), n.ebuf) + defer C.free(unsafe.Pointer(&ret)) // ret := C.ngt_create_index(n.index, cpool, n.ebuf) if ret == ErrorCode { ne := n.ebuf From 709a791d962b824bf5b33971b17e2d30ab0b378e Mon Sep 17 00:00:00 2001 From: kpango Date: Wed, 16 Sep 2020 15:58:06 +0900 Subject: [PATCH 4/8] fix Signed-off-by: kpango --- internal/core/ngt/ngt.go | 63 ++++++++++------------------------------ 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/internal/core/ngt/ngt.go b/internal/core/ngt/ngt.go index 5ebbcd09ae..c961b4afbc 100644 --- a/internal/core/ngt/ngt.go +++ b/internal/core/ngt/ngt.go @@ -281,30 +281,20 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search if radius == 0 { radius = n.radius } - // cvec := (*C.float)(&vec[0]) - // defer C.free(unsafe.Pointer(cvec)) - // csize := *(*C.size_t)(unsafe.Pointer(&size)) - // defer C.free(unsafe.Pointer(&csize)) - // cepsilon := *(*C.float)(unsafe.Pointer(&epsilon)) - // defer C.free(unsafe.Pointer(&cepsilon)) - // cradius := *(*C.float)(unsafe.Pointer(&radius)) - // defer C.free(unsafe.Pointer(&cradius)) n.mu.RLock() ret := C.ngt_search_index_as_float( n.index, - (*C.float)(unsafe.Pointer(&vec[0])), - // cvec, + (*C.float)(&vec[0]), n.dimension, - // csize, - // cepsilon, - // cradius, + // C.size_t(size), *(*C.size_t)(unsafe.Pointer(&size)), + // C.float(epsilon), *(*C.float)(unsafe.Pointer(&epsilon)), *(*C.float)(unsafe.Pointer(&radius)), + // C.float(radius), results, n.ebuf) - defer C.free(unsafe.Pointer(&ret)) if ret == ErrorCode { // TODO global lock取るのどうする問題 @@ -316,16 +306,12 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search n.mu.RUnlock() rsize := int(C.ngt_get_result_size(results, n.ebuf)) - defer C.free(unsafe.Pointer(&rsize)) if rsize == -1 { return nil, n.newGoError(n.ebuf) } result := make([]SearchResult, rsize) for i := 0; i < rsize; i++ { - // idx := C.uint32_t(i) - // defer C.free(unsafe.Pointer(&idx)) - // d := C.ngt_get_result(results, idx, n.ebuf) d := C.ngt_get_result(results, C.uint32_t(i), n.ebuf) if d.id == 0 && d.distance == 0 { result[i] = SearchResult{0, 0, n.newGoError(n.ebuf)} @@ -340,14 +326,8 @@ func (n *ngt) Search(vec []float32, size int, epsilon, radius float32) ([]Search // Insert returns NGT object id. // This only stores not indexing, you must call CreateIndex and SaveIndex. func (n *ngt) Insert(vec []float32) (uint, error) { - // cvec := (*C.float)(&vec[0]) - // defer C.free(unsafe.Pointer(cvec)) - // cdim := C.uint32_t(n.dimension) - // defer C.free(unsafe.Pointer(&cdim)) n.mu.Lock() - // id := C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf) id := C.ngt_insert_index_as_float(n.index, (*C.float)(&vec[0]), C.uint32_t(n.dimension), n.ebuf) - defer C.free(unsafe.Pointer(&id)) n.mu.Unlock() if id == 0 { return 0, n.newGoError(n.ebuf) @@ -383,19 +363,16 @@ func (n *ngt) BulkInsert(vecs [][]float32) ([]uint, []error) { ids := make([]uint, 0, len(vecs)) errs := make([]error, 0, len(vecs)) + var id uint n.mu.Lock() for _, vec := range vecs { - // cvec := (*C.float)(&vec[0]) - // defer C.free(unsafe.Pointer(&vec)) - // cdim := C.uint32_t(n.dimension) - // defer C.free(unsafe.Pointer(cdim)) - // id := uint(C.ngt_insert_index_as_float(n.index, cvec, cdim, n.ebuf)) - id := C.ngt_insert_index_as_float(n.index, (*C.float)(&vec[0]), C.uint32_t(n.dimension), n.ebuf) - defer C.free(unsafe.Pointer(&id)) + // n.mu.Lock() + id = uint(C.ngt_insert_index_as_float(n.index, (*C.float)(&vec[0]), C.uint32_t(n.dimension), n.ebuf)) + // n.mu.Unlock() if id == 0 { errs = append(errs, n.newGoError(n.ebuf)) } - ids = append(ids, uint(id)) + ids = append(ids, id) } n.mu.Unlock() @@ -451,12 +428,8 @@ func (n *ngt) CreateIndex(poolSize uint32) error { if poolSize == 0 { poolSize = n.poolSize } - // cpool := C.uint32_t(poolSize) - // defer C.free(unsafe.Pointer(&cpool)) n.mu.Lock() ret := C.ngt_create_index(n.index, C.uint32_t(poolSize), n.ebuf) - defer C.free(unsafe.Pointer(&ret)) - // ret := C.ngt_create_index(n.index, cpool, n.ebuf) if ret == ErrorCode { ne := n.ebuf n.mu.Unlock() @@ -470,8 +443,8 @@ func (n *ngt) CreateIndex(poolSize uint32) error { // SaveIndex stores NGT index to storage. func (n *ngt) SaveIndex() error { if !n.inMemory { - path := C.CString(n.idxPath) - defer C.free(unsafe.Pointer(path)) + path := C.CString(n.idxPath) + defer C.free(unsafe.Pointer(path)) n.mu.Lock() ret := C.ngt_save_index(n.index, path, n.ebuf) if ret == ErrorCode { @@ -487,10 +460,8 @@ func (n *ngt) SaveIndex() error { // Remove removes from NGT index. func (n *ngt) Remove(id uint) error { - oid := C.ObjectID(id) - defer C.free(unsafe.Pointer(&oid)) n.mu.Lock() - ret := C.ngt_remove_index(n.index, oid, n.ebuf) + ret := C.ngt_remove_index(n.index, C.ObjectID(id), n.ebuf) if ret == ErrorCode { ne := n.ebuf n.mu.Unlock() @@ -505,9 +476,7 @@ func (n *ngt) Remove(id uint) error { func (n *ngt) BulkRemove(ids ...uint) error { n.mu.Lock() for _, id := range ids { - oid := C.ObjectID(id) - defer C.free(unsafe.Pointer(&oid)) - if C.ngt_remove_index(n.index, oid, n.ebuf) == ErrorCode { + if C.ngt_remove_index(n.index, C.ObjectID(id), n.ebuf) == ErrorCode { ne := n.ebuf n.mu.Unlock() return n.newGoError(ne) @@ -521,12 +490,10 @@ func (n *ngt) BulkRemove(ids ...uint) error { func (n *ngt) GetVector(id uint) ([]float32, error) { dimension := int(n.dimension) var ret []float32 - oid := C.ObjectID(id) - defer C.free(unsafe.Pointer(&oid)) switch n.objectType { case Float: n.mu.RLock() - results := C.ngt_get_object_as_float(n.ospace, oid, n.ebuf) + results := C.ngt_get_object_as_float(n.ospace, C.ObjectID(id), n.ebuf) n.mu.RUnlock() if results == nil { return nil, n.newGoError(n.ebuf) @@ -537,7 +504,7 @@ func (n *ngt) GetVector(id uint) ([]float32, error) { // } case Uint8: n.mu.RLock() - results := C.ngt_get_object_as_integer(n.ospace, oid, n.ebuf) + results := C.ngt_get_object_as_integer(n.ospace, C.ObjectID(id), n.ebuf) n.mu.RUnlock() if results == nil { return nil, n.newGoError(n.ebuf) From ef17b0d7b4c5ca9d96e69e0458dba00a967be51a Mon Sep 17 00:00:00 2001 From: kpango Date: Wed, 16 Sep 2020 18:41:27 +0900 Subject: [PATCH 5/8] fix Signed-off-by: kpango --- go.mod | 8 ++++---- go.sum | 30 ++++++++++++++++-------------- internal/core/ngt/ngt.go | 4 ++-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index c5e6459bfa..6efde502a4 100755 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/vdaas/vald go 1.15 replace ( - cloud.google.com/go => cloud.google.com/go v0.65.0 + cloud.google.com/go => cloud.google.com/go v0.66.0 github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.34.24 github.com/boltdb/bolt => github.com/boltdb/bolt v1.3.1 @@ -71,11 +71,11 @@ require ( go.uber.org/goleak v1.1.10 golang.org/x/net v0.0.0-20200904194848-62affa334b73 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 - golang.org/x/sys v0.0.0-20200915084602-288bc346aa39 + golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f gonum.org/v1/hdf5 v0.0.0-20200504100616-496fefe91614 gonum.org/v1/plot v0.8.0 - google.golang.org/api v0.31.0 - google.golang.org/genproto v0.0.0-20200914193844-75d14daec038 + google.golang.org/api v0.32.0 + google.golang.org/genproto v0.0.0-20200915202801-9f80d0600517 google.golang.org/grpc v1.31.1 gopkg.in/yaml.v2 v2.3.0 k8s.io/api v0.18.8 diff --git a/go.sum b/go.sum index 2b5603f6c1..1ea4e3596f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.66.0 h1:DZeAkuQGQqnm9Xv36SbMJEU8aFBz4wL04UpMWPWwjzg= +cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= @@ -464,6 +464,7 @@ github.com/yahoojapan/ngtd v0.0.0-20200424071638-9872bbae3700/go.mod h1:K4qaOV0B github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zeebo/xxh3 v0.8.2 h1:8V3CL8YrAiyCw8W9fN8CsZsknxMrbVaLEDva6+ajFUw= github.com/zeebo/xxh3 v0.8.2/go.mod h1:AQY73TOrhF3jNsdiM9zZOb8MThrYbZONHj7ryDBaLpg= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -570,8 +571,9 @@ golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -620,10 +622,10 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200727154430-2d971f7391a4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200915084602-288bc346aa39 h1:356XA7ITklAU2//sYkjFeco+dH1bCRD8XCJ9FIEsvo4= -golang.org/x/sys v0.0.0-20200915084602-288bc346aa39/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f h1:6Sc1XOXTulBN6imkqo6XoAXDEzoQ4/ro6xy7Vn8+rOM= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -676,10 +678,10 @@ golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200828161849-5deb26317202 h1:DrWbY9UUFi/sl/3HkNVoBjDbGfIPZZfgoGsGxOL1EU8= golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c h1:AQsh/7arPVFDBraQa8x7GoVnwnGg1kM7J2ySI0kF5WU= +golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -711,9 +713,9 @@ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.31.0 h1:1w5Sz/puhxFo9lTtip2n47k7toB/U2nCqOKNHd3Yrbo= google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= +google.golang.org/api v0.32.0 h1:Le77IccnTqEa8ryp9wIpX5W3zYm7Gf9LhOp9PHcwFts= +google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -741,11 +743,11 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200914193844-75d14daec038 h1:SnvTpXhVDJGFxzZiHbMUZTh3VjU2Vx2feJ7Zfl5+OIY= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200915202801-9f80d0600517 h1:0V7smU6X2ZVOs8VxtifQqdIMZh6PXWCWztXGdKRE3OI= +google.golang.org/genproto v0.0.0-20200915202801-9f80d0600517/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= diff --git a/internal/core/ngt/ngt.go b/internal/core/ngt/ngt.go index c961b4afbc..0593a16c52 100644 --- a/internal/core/ngt/ngt.go +++ b/internal/core/ngt/ngt.go @@ -443,8 +443,8 @@ func (n *ngt) CreateIndex(poolSize uint32) error { // SaveIndex stores NGT index to storage. func (n *ngt) SaveIndex() error { if !n.inMemory { - path := C.CString(n.idxPath) - defer C.free(unsafe.Pointer(path)) + path := C.CString(n.idxPath) + defer C.free(unsafe.Pointer(path)) n.mu.Lock() ret := C.ngt_save_index(n.index, path, n.ebuf) if ret == ErrorCode { From 9561bb79f45339cbceacf8d6675d47f4da8b8a9e Mon Sep 17 00:00:00 2001 From: kpango Date: Wed, 16 Sep 2020 21:04:30 +0900 Subject: [PATCH 6/8] fix Signed-off-by: kpango --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6efde502a4..12baf1c52c 100755 --- a/go.mod +++ b/go.mod @@ -71,7 +71,7 @@ require ( go.uber.org/goleak v1.1.10 golang.org/x/net v0.0.0-20200904194848-62affa334b73 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 - golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f + golang.org/x/sys v0.0.0-20200916084744-dbad9cb7cb7a gonum.org/v1/hdf5 v0.0.0-20200504100616-496fefe91614 gonum.org/v1/plot v0.8.0 google.golang.org/api v0.32.0 diff --git a/go.sum b/go.sum index 1ea4e3596f..423f9c3b73 100644 --- a/go.sum +++ b/go.sum @@ -624,8 +624,8 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200727154430-2d971f7391a4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f h1:6Sc1XOXTulBN6imkqo6XoAXDEzoQ4/ro6xy7Vn8+rOM= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916084744-dbad9cb7cb7a h1:chkwkn8HYWVtTE5DCQNKYlkyptadXYY0+PuyaVdyMo4= +golang.org/x/sys v0.0.0-20200916084744-dbad9cb7cb7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= From 3a39dbd434cb9b57098c32be316e6f27b730baa7 Mon Sep 17 00:00:00 2001 From: kpango Date: Thu, 17 Sep 2020 13:06:57 +0900 Subject: [PATCH 7/8] fix Signed-off-by: kpango --- go.mod | 22 +++++++++++----------- go.sum | 43 +++++++++++++++++++++---------------------- hack/go.mod.default | 12 ++++++------ 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/go.mod b/go.mod index 12baf1c52c..d6c4566990 100755 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 replace ( cloud.google.com/go => cloud.google.com/go v0.66.0 github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible - github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.34.24 + github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.34.25 github.com/boltdb/bolt => github.com/boltdb/bolt v1.3.1 github.com/chzyer/logex => github.com/chzyer/logex v1.1.11-0.20170329064859-445be9e134b2 github.com/coreos/etcd => go.etcd.io/etcd v3.3.25+incompatible @@ -26,12 +26,12 @@ replace ( golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a google.golang.org/grpc => google.golang.org/grpc v1.32.0 google.golang.org/protobuf => google.golang.org/protobuf v1.25.0 - k8s.io/api => k8s.io/api v0.18.8 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.8 - k8s.io/apimachinery => k8s.io/apimachinery v0.18.8 - k8s.io/client-go => k8s.io/client-go v0.18.8 - k8s.io/metrics => k8s.io/metrics v0.18.8 - sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.2 + k8s.io/api => k8s.io/api v0.18.9 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.9 + k8s.io/apimachinery => k8s.io/apimachinery v0.18.9 + k8s.io/client-go => k8s.io/client-go v0.18.9 + k8s.io/metrics => k8s.io/metrics v0.18.9 + sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.3 ) require ( @@ -75,12 +75,12 @@ require ( gonum.org/v1/hdf5 v0.0.0-20200504100616-496fefe91614 gonum.org/v1/plot v0.8.0 google.golang.org/api v0.32.0 - google.golang.org/genproto v0.0.0-20200915202801-9f80d0600517 + google.golang.org/genproto v0.0.0-20200916143405-f6a2fa72f0c4 google.golang.org/grpc v1.31.1 gopkg.in/yaml.v2 v2.3.0 - k8s.io/api v0.18.8 - k8s.io/apimachinery v0.18.8 - k8s.io/client-go v0.18.8 + k8s.io/api v0.18.9 + k8s.io/apimachinery v0.18.9 + k8s.io/client-go v0.18.9 k8s.io/metrics v0.0.0-00010101000000-000000000000 sigs.k8s.io/controller-runtime v0.0.0-00010101000000-000000000000 ) diff --git a/go.sum b/go.sum index 423f9c3b73..4f9c53bf85 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.34.24 h1:eTBgLksUJNLk5EwBl/lUweXjBZHbxvfcvqUxAJu7Fqg= -github.com/aws/aws-sdk-go v1.34.24/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.25 h1:yHNez503p+NuQ5QdMKjwEIkwTa2u+TeUAPAqCVdFu4I= +github.com/aws/aws-sdk-go v1.34.25/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -109,9 +109,9 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.4.1 h1:7dLaJvASGRD7X49jSCSXXHwKPm0ZN9r9kJD+p+vS7dM= github.com/envoyproxy/protoc-gen-validate v0.4.1/go.mod h1:E+IEazqdaWv3FrnGtZIu3b9fPFMK8AzeTTrk9SfVwWs= -github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= -github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= @@ -264,7 +264,6 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= @@ -746,8 +745,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200915202801-9f80d0600517 h1:0V7smU6X2ZVOs8VxtifQqdIMZh6PXWCWztXGdKRE3OI= -google.golang.org/genproto v0.0.0-20200915202801-9f80d0600517/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200916143405-f6a2fa72f0c4 h1:0FQbRyP6f/LVRsofCaQD4BMMd5kRAXMo/WvispzB940= +google.golang.org/genproto v0.0.0-20200916143405-f6a2fa72f0c4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= @@ -787,17 +786,17 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.18.8 h1:aIKUzJPb96f3fKec2lxtY7acZC9gQNDLVhfSGpxBAC4= -k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= -k8s.io/apiextensions-apiserver v0.18.8 h1:pkqYPKTHa0/3lYwH7201RpF9eFm0lmZDFBNzhN+k/sA= -k8s.io/apiextensions-apiserver v0.18.8/go.mod h1:7f4ySEkkvifIr4+BRrRWriKKIJjPyg9mb/p63dJKnlM= -k8s.io/apimachinery v0.18.8 h1:jimPrycCqgx2QPearX3to1JePz7wSbVLq+7PdBTTwQ0= -k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= -k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM= -k8s.io/client-go v0.18.8 h1:SdbLpIxk5j5YbFr1b7fq8S7mDgDjYmUxSbszyoesoDM= -k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU= -k8s.io/code-generator v0.18.8/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU= +k8s.io/api v0.18.9 h1:7VDtivqwbvLOf8hmXSd/PDSSbpCBq49MELg84EYBYiQ= +k8s.io/api v0.18.9/go.mod h1:9u/h6sUh6FxfErv7QqetX1EB3yBMIYOBXzdcf0Gf0rc= +k8s.io/apiextensions-apiserver v0.18.9 h1:tVEf8rVKh5BnXORnYYCztjbf6CSyGNMt/rAIEyfU00Q= +k8s.io/apiextensions-apiserver v0.18.9/go.mod h1:JagmAhU0TVENzgUZqHJsjCSDh7YuV5o6g01G1Fwh7zI= +k8s.io/apimachinery v0.18.9 h1:3ZABKQx3F3xPWlsGhCfUl8W+JXRRblV6Wo2A3zn0pvY= +k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= +k8s.io/apiserver v0.18.9/go.mod h1:vXQzMtUCLsGg1Bh+7Jo2mZKHpHZFCZn8eTNSepcIA1M= +k8s.io/client-go v0.18.9 h1:sPHX49yOtUqv1fl49TwV3f8cC0N3etSnwgFGsIsXnZc= +k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY= +k8s.io/code-generator v0.18.9/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= +k8s.io/component-base v0.18.9/go.mod h1:tUo4qZtV8m7t/U+0DgY+fcnn4BFZ480fZdzxOkWH4zk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -808,16 +807,16 @@ k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 h1:Oh3Mzx5pJ+yIumsAD0MOECPVeXsVot0UkiaCGVyfGQY= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/metrics v0.18.8 h1:Obf262GVd2Uy+WbPkOXNiZroI5mT8zYoKK3Y/8KF7Yc= -k8s.io/metrics v0.18.8/go.mod h1:j7JzZdiyhLP2BsJm/Fzjs+j5Lb1Y7TySjhPWqBPwRXA= +k8s.io/metrics v0.18.9 h1:jQNSfNL64ma5aUzd7jtNiCB2+yuN05IATIEIpVPU5/8= +k8s.io/metrics v0.18.9/go.mod h1:zFnHxkmOAc4EywyiWFCSwMPmtvvMStlvWFZTL9BqGWU= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA= -sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E= +sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE= +sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= diff --git a/hack/go.mod.default b/hack/go.mod.default index 01f750d448..b77bed01e7 100755 --- a/hack/go.mod.default +++ b/hack/go.mod.default @@ -26,10 +26,10 @@ replace ( golang.org/x/crypto => golang.org/x/crypto latest google.golang.org/grpc => google.golang.org/grpc latest google.golang.org/protobuf => google.golang.org/protobuf latest - k8s.io/api => k8s.io/api v0.18.8 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.8 - k8s.io/apimachinery => k8s.io/apimachinery v0.18.8 - k8s.io/client-go => k8s.io/client-go v0.18.8 - k8s.io/metrics => k8s.io/metrics v0.18.8 - sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.2 + k8s.io/api => k8s.io/api v0.18.9 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.9 + k8s.io/apimachinery => k8s.io/apimachinery v0.18.9 + k8s.io/client-go => k8s.io/client-go v0.18.9 + k8s.io/metrics => k8s.io/metrics v0.18.9 + sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.3 ) From 0a0c1041508ba6559ce1f503cbc663685c3874db Mon Sep 17 00:00:00 2001 From: kpango Date: Thu, 17 Sep 2020 14:21:21 +0900 Subject: [PATCH 8/8] fix Signed-off-by: kpango --- apis/docs/docs.md | 1058 ++++++++--------- .../controller/replication_manager.pb.go | 69 +- .../replication_manager.swagger.json | 4 +- 3 files changed, 566 insertions(+), 565 deletions(-) diff --git a/apis/docs/docs.md b/apis/docs/docs.md index 0f160ec298..daea6b7817 100644 --- a/apis/docs/docs.md +++ b/apis/docs/docs.md @@ -3,9 +3,47 @@ ## Table of Contents +- [core/agent.proto](#core/agent.proto) + - [Agent](#core.Agent) + +- [sidecar/sidecar.proto](#sidecar/sidecar.proto) + - [Sidecar](#sidecar.Sidecar) + - [discoverer.proto](#discoverer.proto) - [Discoverer](#discoverer.Discoverer) +- [errors.proto](#errors.proto) + - [Errors](#errors.Errors) + - [Errors.RPC](#errors.Errors.RPC) + +- [egress/egress_filter.proto](#egress/egress_filter.proto) + - [EgressFilter](#egress_filter.EgressFilter) + +- [ingress/ingress_filter.proto](#ingress/ingress_filter.proto) + - [IngressFilter](#ingress_filter.IngressFilter) + +- [vald/vald.proto](#vald/vald.proto) + - [Vald](#vald.Vald) + +- [backup/backup_manager.proto](#backup/backup_manager.proto) + - [Backup](#backup_manager.Backup) + +- [compressor/compressor.proto](#compressor/compressor.proto) + - [Backup](#compressor.Backup) + +- [index/index_manager.proto](#index/index_manager.proto) + - [Index](#index_manager.Index) + +- [replication/agent/replication_manager.proto](#replication/agent/replication_manager.proto) + - [Replication](#replication_manager.Replication) + +- [replication/controller/replication_manager.proto](#replication/controller/replication_manager.proto) + - [ReplicationController](#replication_manager.ReplicationController) + +- [traffic/traffic_manager.proto](#traffic/traffic_manager.proto) +- [meta.proto](#meta.proto) + - [Meta](#meta_manager.Meta) + - [payload.proto](#payload.proto) - [Backup](#payload.Backup) - [Backup.Compressed](#payload.Backup.Compressed) @@ -67,52 +105,14 @@ - [Search.Request](#payload.Search.Request) - [Search.Response](#payload.Search.Response) -- [meta.proto](#meta.proto) - - [Meta](#meta_manager.Meta) - -- [core/agent.proto](#core/agent.proto) - - [Agent](#core.Agent) - -- [sidecar/sidecar.proto](#sidecar/sidecar.proto) - - [Sidecar](#sidecar.Sidecar) - -- [traffic/traffic_manager.proto](#traffic/traffic_manager.proto) -- [compressor/compressor.proto](#compressor/compressor.proto) - - [Backup](#compressor.Backup) - -- [index/index_manager.proto](#index/index_manager.proto) - - [Index](#index_manager.Index) - -- [replication/agent/replication_manager.proto](#replication/agent/replication_manager.proto) - - [Replication](#replication_manager.Replication) - -- [replication/controller/replication_manager.proto](#replication/controller/replication_manager.proto) - - [ReplicationController](#replication_manager.ReplicationController) - -- [backup/backup_manager.proto](#backup/backup_manager.proto) - - [Backup](#backup_manager.Backup) - -- [egress/egress_filter.proto](#egress/egress_filter.proto) - - [EgressFilter](#egress_filter.EgressFilter) - -- [ingress/ingress_filter.proto](#ingress/ingress_filter.proto) - - [IngressFilter](#ingress_filter.IngressFilter) - -- [errors.proto](#errors.proto) - - [Errors](#errors.Errors) - - [Errors.RPC](#errors.Errors.RPC) - -- [vald/vald.proto](#vald/vald.proto) - - [Vald](#vald.Vald) - - [Scalar Value Types](#scalar-value-types) - +

Top

-## discoverer.proto +## core/agent.proto @@ -122,307 +122,440 @@ - + -### Discoverer +### Agent | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| -| Pods | [.payload.Discoverer.Request](#payload.Discoverer.Request) | [.payload.Info.Pods](#payload.Info.Pods) | | -| Nodes | [.payload.Discoverer.Request](#payload.Discoverer.Request) | [.payload.Info.Nodes](#payload.Info.Nodes) | | +| Exists | [.payload.Object.ID](#payload.Object.ID) | [.payload.Object.ID](#payload.Object.ID) | | +| Search | [.payload.Search.Request](#payload.Search.Request) | [.payload.Search.Response](#payload.Search.Response) | | +| SearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) | [.payload.Search.Response](#payload.Search.Response) | | +| StreamSearch | [.payload.Search.Request](#payload.Search.Request) stream | [.payload.Search.Response](#payload.Search.Response) stream | | +| StreamSearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) stream | [.payload.Search.Response](#payload.Search.Response) stream | | +| Insert | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | +| StreamInsert | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | +| MultiInsert | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | +| Update | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | +| StreamUpdate | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | +| MultiUpdate | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | +| Remove | [.payload.Object.ID](#payload.Object.ID) | [.payload.Empty](#payload.Empty) | | +| StreamRemove | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Empty](#payload.Empty) stream | | +| MultiRemove | [.payload.Object.IDs](#payload.Object.IDs) | [.payload.Empty](#payload.Empty) | | +| GetObject | [.payload.Object.ID](#payload.Object.ID) | [.payload.Object.Vector](#payload.Object.Vector) | | +| StreamGetObject | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Object.Vector](#payload.Object.Vector) stream | | +| CreateIndex | [.payload.Control.CreateIndexRequest](#payload.Control.CreateIndexRequest) | [.payload.Empty](#payload.Empty) | | +| SaveIndex | [.payload.Empty](#payload.Empty) | [.payload.Empty](#payload.Empty) | | +| CreateAndSaveIndex | [.payload.Control.CreateIndexRequest](#payload.Control.CreateIndexRequest) | [.payload.Empty](#payload.Empty) | | +| IndexInfo | [.payload.Empty](#payload.Empty) | [.payload.Info.Index.Count](#payload.Info.Index.Count) | | - +

Top

-## payload.proto +## sidecar/sidecar.proto + - + -### Backup + + +### Sidecar +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| + - -### Backup.Compressed + +

Top

+## discoverer.proto + + + - -### Backup.Compressed.MetaVector + +### Discoverer -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuid | [string](#string) | | | -| meta | [string](#string) | | | -| vector | [bytes](#bytes) | | | -| ips | [string](#string) | repeated | | +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Pods | [.payload.Discoverer.Request](#payload.Discoverer.Request) | [.payload.Info.Pods](#payload.Info.Pods) | | +| Nodes | [.payload.Discoverer.Request](#payload.Discoverer.Request) | [.payload.Info.Nodes](#payload.Info.Nodes) | | + + +

Top

+## errors.proto - -### Backup.Compressed.MetaVectors + +### Errors -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| vectors | [Backup.Compressed.MetaVector](#payload.Backup.Compressed.MetaVector) | repeated | | - + -### Backup.GetVector +### Errors.RPC +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [string](#string) | | | +| msg | [string](#string) | | | +| details | [string](#string) | repeated | | +| instance | [string](#string) | | | +| status | [int64](#int64) | | | +| error | [string](#string) | | | +| roots | [Errors.RPC](#errors.Errors.RPC) | repeated | | - -### Backup.GetVector.Owner + + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ip | [string](#string) | | | + + +

Top

+## egress/egress_filter.proto - + -### Backup.GetVector.Request + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuid | [string](#string) | | | + +### EgressFilter +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Filter | [.payload.Search.Response](#payload.Search.Response) | [.payload.Search.Response](#payload.Search.Response) | | +| StreamFilter | [.payload.Object.Distance](#payload.Object.Distance) stream | [.payload.Object.Distance](#payload.Object.Distance) stream | | + - -### Backup.IP + +

Top

+## ingress/ingress_filter.proto + + + - + -### Backup.IP.Register +### IngressFilter +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| + + +

Top

- +## vald/vald.proto -### Backup.IP.Register.Request + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuid | [string](#string) | | | -| ips | [string](#string) | repeated | | + + +### Vald +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Exists | [.payload.Object.ID](#payload.Object.ID) | [.payload.Object.ID](#payload.Object.ID) | | +| Search | [.payload.Search.Request](#payload.Search.Request) | [.payload.Search.Response](#payload.Search.Response) | | +| SearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) | [.payload.Search.Response](#payload.Search.Response) | | +| StreamSearch | [.payload.Search.Request](#payload.Search.Request) stream | [.payload.Search.Response](#payload.Search.Response) stream | | +| StreamSearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) stream | [.payload.Search.Response](#payload.Search.Response) stream | | +| Insert | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | +| StreamInsert | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | +| MultiInsert | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | +| Update | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | +| StreamUpdate | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | +| MultiUpdate | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | +| Upsert | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | +| StreamUpsert | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | +| MultiUpsert | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | +| Remove | [.payload.Object.ID](#payload.Object.ID) | [.payload.Empty](#payload.Empty) | | +| StreamRemove | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Empty](#payload.Empty) stream | | +| MultiRemove | [.payload.Object.IDs](#payload.Object.IDs) | [.payload.Empty](#payload.Empty) | | +| GetObject | [.payload.Object.ID](#payload.Object.ID) | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) | | +| StreamGetObject | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) stream | | - + -### Backup.IP.Remove + +

Top

+## backup/backup_manager.proto + + - + -### Backup.IP.Remove.Request + - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ips | [string](#string) | repeated | | - +### Backup +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| GetVector | [.payload.Backup.GetVector.Request](#payload.Backup.GetVector.Request) | [.payload.Backup.Compressed.MetaVector](#payload.Backup.Compressed.MetaVector) | | +| Locations | [.payload.Backup.Locations.Request](#payload.Backup.Locations.Request) | [.payload.Info.IPs](#payload.Info.IPs) | | +| Register | [.payload.Backup.Compressed.MetaVector](#payload.Backup.Compressed.MetaVector) | [.payload.Empty](#payload.Empty) | | +| RegisterMulti | [.payload.Backup.Compressed.MetaVectors](#payload.Backup.Compressed.MetaVectors) | [.payload.Empty](#payload.Empty) | | +| Remove | [.payload.Backup.Remove.Request](#payload.Backup.Remove.Request) | [.payload.Empty](#payload.Empty) | | +| RemoveMulti | [.payload.Backup.Remove.RequestMulti](#payload.Backup.Remove.RequestMulti) | [.payload.Empty](#payload.Empty) | | +| RegisterIPs | [.payload.Backup.IP.Register.Request](#payload.Backup.IP.Register.Request) | [.payload.Empty](#payload.Empty) | | +| RemoveIPs | [.payload.Backup.IP.Remove.Request](#payload.Backup.IP.Remove.Request) | [.payload.Empty](#payload.Empty) | | + - -### Backup.Locations + +

Top

+## compressor/compressor.proto + + + - + -### Backup.Locations.Request +### Backup +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| GetVector | [.payload.Backup.GetVector.Request](#payload.Backup.GetVector.Request) | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) | | +| Locations | [.payload.Backup.Locations.Request](#payload.Backup.Locations.Request) | [.payload.Info.IPs](#payload.Info.IPs) | | +| Register | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) | [.payload.Empty](#payload.Empty) | | +| RegisterMulti | [.payload.Backup.MetaVectors](#payload.Backup.MetaVectors) | [.payload.Empty](#payload.Empty) | | +| Remove | [.payload.Backup.Remove.Request](#payload.Backup.Remove.Request) | [.payload.Empty](#payload.Empty) | | +| RemoveMulti | [.payload.Backup.Remove.RequestMulti](#payload.Backup.Remove.RequestMulti) | [.payload.Empty](#payload.Empty) | | +| RegisterIPs | [.payload.Backup.IP.Register.Request](#payload.Backup.IP.Register.Request) | [.payload.Empty](#payload.Empty) | | +| RemoveIPs | [.payload.Backup.IP.Remove.Request](#payload.Backup.IP.Remove.Request) | [.payload.Empty](#payload.Empty) | | -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuid | [string](#string) | | | + + +

Top

+## index/index_manager.proto - + -### Backup.MetaVector + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuid | [string](#string) | | | -| meta | [string](#string) | | | -| vector | [float](#float) | repeated | | -| ips | [string](#string) | repeated | | + +### Index +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| IndexInfo | [.payload.Empty](#payload.Empty) | [.payload.Info.Index.Count](#payload.Info.Index.Count) | | + - -### Backup.MetaVectors + +

Top

+## replication/agent/replication_manager.proto -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| vectors | [Backup.MetaVector](#payload.Backup.MetaVector) | repeated | | + + + + +### Replication - -### Backup.Remove +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Recover | [.payload.Replication.Recovery](#payload.Replication.Recovery) | [.payload.Empty](#payload.Empty) | | +| Rebalance | [.payload.Replication.Rebalance](#payload.Replication.Rebalance) | [.payload.Empty](#payload.Empty) | | +| AgentInfo | [.payload.Empty](#payload.Empty) | [.payload.Replication.Agents](#payload.Replication.Agents) | | + + +

Top

+## replication/controller/replication_manager.proto - + -### Backup.Remove.Request + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuid | [string](#string) | | | + +### ReplicationController +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| ReplicationInfo | [.payload.Empty](#payload.Empty) | [.payload.Replication.Agents](#payload.Replication.Agents) | | + - -### Backup.Remove.RequestMulti + +

Top

+## traffic/traffic_manager.proto -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuids | [string](#string) | repeated | | + + + + - + +

Top

-### Control +## meta.proto + + + + - +### Meta -### Control.CreateIndexRequest +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| GetMeta | [.payload.Meta.Key](#payload.Meta.Key) | [.payload.Meta.Val](#payload.Meta.Val) | | +| GetMetas | [.payload.Meta.Keys](#payload.Meta.Keys) | [.payload.Meta.Vals](#payload.Meta.Vals) | | +| GetMetaInverse | [.payload.Meta.Val](#payload.Meta.Val) | [.payload.Meta.Key](#payload.Meta.Key) | | +| GetMetasInverse | [.payload.Meta.Vals](#payload.Meta.Vals) | [.payload.Meta.Keys](#payload.Meta.Keys) | | +| SetMeta | [.payload.Meta.KeyVal](#payload.Meta.KeyVal) | [.payload.Empty](#payload.Empty) | | +| SetMetas | [.payload.Meta.KeyVals](#payload.Meta.KeyVals) | [.payload.Empty](#payload.Empty) | | +| DeleteMeta | [.payload.Meta.Key](#payload.Meta.Key) | [.payload.Meta.Val](#payload.Meta.Val) | | +| DeleteMetas | [.payload.Meta.Keys](#payload.Meta.Keys) | [.payload.Meta.Vals](#payload.Meta.Vals) | | +| DeleteMetaInverse | [.payload.Meta.Val](#payload.Meta.Val) | [.payload.Meta.Key](#payload.Meta.Key) | | +| DeleteMetasInverse | [.payload.Meta.Vals](#payload.Meta.Vals) | [.payload.Meta.Keys](#payload.Meta.Keys) | | + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| pool_size | [uint32](#uint32) | | | + +

Top

+## payload.proto - + -### Discoverer +### Backup @@ -430,105 +563,102 @@ - + -### Discoverer.Request +### Backup.Compressed -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | -| namespace | [string](#string) | | | -| node | [string](#string) | | | + +### Backup.Compressed.MetaVector - -### Empty +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| uuid | [string](#string) | | | +| meta | [string](#string) | | | +| vector | [bytes](#bytes) | | | +| ips | [string](#string) | repeated | | - + -### Info +### Backup.Compressed.MetaVectors +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| vectors | [Backup.Compressed.MetaVector](#payload.Backup.Compressed.MetaVector) | repeated | | - -### Info.CPU + +### Backup.GetVector -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| limit | [double](#double) | | | -| request | [double](#double) | | | -| usage | [double](#double) | | | - + -### Info.IPs +### Backup.GetVector.Owner | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ip | [string](#string) | repeated | | +| ip | [string](#string) | | | - + -### Info.Index +### Backup.GetVector.Request +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| uuid | [string](#string) | | | - -### Info.Index.Count + +### Backup.IP -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| stored | [uint32](#uint32) | | | -| uncommitted | [uint32](#uint32) | | | -| indexing | [bool](#bool) | | | - + -### Info.Index.UUID +### Backup.IP.Register @@ -536,127 +666,108 @@ - + -### Info.Index.UUID.Committed +### Backup.IP.Register.Request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | uuid | [string](#string) | | | +| ips | [string](#string) | repeated | | - - -### Info.Index.UUID.Uncommitted - + +### Backup.IP.Remove -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| uuid | [string](#string) | | | - + -### Info.Memory +### Backup.IP.Remove.Request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| limit | [double](#double) | | | -| request | [double](#double) | | | -| usage | [double](#double) | | | - - +| ips | [string](#string) | repeated | | - -### Info.Node + +### Backup.Locations -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | -| internal_addr | [string](#string) | | | -| external_addr | [string](#string) | | | -| cpu | [Info.CPU](#payload.Info.CPU) | | | -| memory | [Info.Memory](#payload.Info.Memory) | | | -| Pods | [Info.Pods](#payload.Info.Pods) | | | - + -### Info.Nodes +### Backup.Locations.Request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| nodes | [Info.Node](#payload.Info.Node) | repeated | | +| uuid | [string](#string) | | | - + -### Info.Pod +### Backup.MetaVector | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| app_name | [string](#string) | | | -| name | [string](#string) | | | -| namespace | [string](#string) | | | -| ip | [string](#string) | | | -| cpu | [Info.CPU](#payload.Info.CPU) | | | -| memory | [Info.Memory](#payload.Info.Memory) | | | -| node | [Info.Node](#payload.Info.Node) | | | +| uuid | [string](#string) | | | +| meta | [string](#string) | | | +| vector | [float](#float) | repeated | | +| ips | [string](#string) | repeated | | - + -### Info.Pods +### Backup.MetaVectors | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| pods | [Info.Pod](#payload.Info.Pod) | repeated | | +| vectors | [Backup.MetaVector](#payload.Backup.MetaVector) | repeated | | - + -### Meta +### Backup.Remove @@ -664,245 +775,298 @@ - + -### Meta.Key +### Backup.Remove.Request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | | +| uuid | [string](#string) | | | - + -### Meta.KeyVal +### Backup.Remove.RequestMulti | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | | -| val | [string](#string) | | | +| uuids | [string](#string) | repeated | | - + + +### Control + + + -### Meta.KeyVals + + + + + +### Control.CreateIndexRequest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| kvs | [Meta.KeyVal](#payload.Meta.KeyVal) | repeated | | +| pool_size | [uint32](#uint32) | | | - + + +### Discoverer + + + -### Meta.Keys + + + + + +### Discoverer.Request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| keys | [string](#string) | repeated | | +| name | [string](#string) | | | +| namespace | [string](#string) | | | +| node | [string](#string) | | | - + -### Meta.Val +### Empty -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| val | [string](#string) | | | + + +### Info + + - -### Meta.Vals + + + + +### Info.CPU | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| vals | [string](#string) | repeated | | +| limit | [double](#double) | | | +| request | [double](#double) | | | +| usage | [double](#double) | | | - + -### Object +### Info.IPs +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ip | [string](#string) | repeated | | - -### Object.Distance + +### Info.Index -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [string](#string) | | | -| distance | [float](#float) | | | - + -### Object.ID +### Info.Index.Count | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [string](#string) | | | +| stored | [uint32](#uint32) | | | +| uncommitted | [uint32](#uint32) | | | +| indexing | [bool](#bool) | | | - + + +### Info.Index.UUID + + + -### Object.IDs + + + + + +### Info.Index.UUID.Committed | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ids | [string](#string) | repeated | | +| uuid | [string](#string) | | | - + -### Object.Vector +### Info.Index.UUID.Uncommitted | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [string](#string) | | | -| vector | [float](#float) | repeated | | +| uuid | [string](#string) | | | - + -### Object.Vectors +### Info.Memory | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| vectors | [Object.Vector](#payload.Object.Vector) | repeated | | +| limit | [double](#double) | | | +| request | [double](#double) | | | +| usage | [double](#double) | | | - + + +### Info.Node -### Replication +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | | +| internal_addr | [string](#string) | | | +| external_addr | [string](#string) | | | +| cpu | [Info.CPU](#payload.Info.CPU) | | | +| memory | [Info.Memory](#payload.Info.Memory) | | | +| Pods | [Info.Pods](#payload.Info.Pods) | | | + - + -### Replication.Agents +### Info.Nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| agents | [string](#string) | repeated | | -| removed_agents | [string](#string) | repeated | | -| replicating_agent | [string](#string) | repeated | | +| nodes | [Info.Node](#payload.Info.Node) | repeated | | - + -### Replication.Rebalance +### Info.Pod | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| high_usage_agents | [string](#string) | repeated | | -| low_usage_agents | [string](#string) | repeated | | +| app_name | [string](#string) | | | +| name | [string](#string) | | | +| namespace | [string](#string) | | | +| ip | [string](#string) | | | +| cpu | [Info.CPU](#payload.Info.CPU) | | | +| memory | [Info.Memory](#payload.Info.Memory) | | | +| node | [Info.Node](#payload.Info.Node) | | | - + -### Replication.Recovery +### Info.Pods | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| deleted_agents | [string](#string) | repeated | | +| pods | [Info.Pod](#payload.Info.Pod) | repeated | | - + -### Search +### Meta @@ -910,485 +1074,321 @@ - + -### Search.Config +### Meta.Key | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| num | [uint32](#uint32) | | | -| radius | [float](#float) | | | -| epsilon | [float](#float) | | | -| timeout | [int64](#int64) | | | +| key | [string](#string) | | | - + -### Search.IDRequest +### Meta.KeyVal | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [string](#string) | | | -| config | [Search.Config](#payload.Search.Config) | | | +| key | [string](#string) | | | +| val | [string](#string) | | | - + -### Search.Request +### Meta.KeyVals | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| vector | [float](#float) | repeated | | -| config | [Search.Config](#payload.Search.Config) | | | +| kvs | [Meta.KeyVal](#payload.Meta.KeyVal) | repeated | | - + -### Search.Response +### Meta.Keys | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| results | [Object.Distance](#payload.Object.Distance) | repeated | | +| keys | [string](#string) | repeated | | - - + - +### Meta.Val - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| val | [string](#string) | | | - -

Top

-## meta.proto - - - + +### Meta.Vals - -### Meta +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| vals | [string](#string) | repeated | | -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| GetMeta | [.payload.Meta.Key](#payload.Meta.Key) | [.payload.Meta.Val](#payload.Meta.Val) | | -| GetMetas | [.payload.Meta.Keys](#payload.Meta.Keys) | [.payload.Meta.Vals](#payload.Meta.Vals) | | -| GetMetaInverse | [.payload.Meta.Val](#payload.Meta.Val) | [.payload.Meta.Key](#payload.Meta.Key) | | -| GetMetasInverse | [.payload.Meta.Vals](#payload.Meta.Vals) | [.payload.Meta.Keys](#payload.Meta.Keys) | | -| SetMeta | [.payload.Meta.KeyVal](#payload.Meta.KeyVal) | [.payload.Empty](#payload.Empty) | | -| SetMetas | [.payload.Meta.KeyVals](#payload.Meta.KeyVals) | [.payload.Empty](#payload.Empty) | | -| DeleteMeta | [.payload.Meta.Key](#payload.Meta.Key) | [.payload.Meta.Val](#payload.Meta.Val) | | -| DeleteMetas | [.payload.Meta.Keys](#payload.Meta.Keys) | [.payload.Meta.Vals](#payload.Meta.Vals) | | -| DeleteMetaInverse | [.payload.Meta.Val](#payload.Meta.Val) | [.payload.Meta.Key](#payload.Meta.Key) | | -| DeleteMetasInverse | [.payload.Meta.Vals](#payload.Meta.Vals) | [.payload.Meta.Keys](#payload.Meta.Keys) | | - - -

Top

-## core/agent.proto - - - - - - - - - - - -### Agent - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Exists | [.payload.Object.ID](#payload.Object.ID) | [.payload.Object.ID](#payload.Object.ID) | | -| Search | [.payload.Search.Request](#payload.Search.Request) | [.payload.Search.Response](#payload.Search.Response) | | -| SearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) | [.payload.Search.Response](#payload.Search.Response) | | -| StreamSearch | [.payload.Search.Request](#payload.Search.Request) stream | [.payload.Search.Response](#payload.Search.Response) stream | | -| StreamSearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) stream | [.payload.Search.Response](#payload.Search.Response) stream | | -| Insert | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | -| StreamInsert | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | -| MultiInsert | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | -| Update | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | -| StreamUpdate | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | -| MultiUpdate | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | -| Remove | [.payload.Object.ID](#payload.Object.ID) | [.payload.Empty](#payload.Empty) | | -| StreamRemove | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Empty](#payload.Empty) stream | | -| MultiRemove | [.payload.Object.IDs](#payload.Object.IDs) | [.payload.Empty](#payload.Empty) | | -| GetObject | [.payload.Object.ID](#payload.Object.ID) | [.payload.Object.Vector](#payload.Object.Vector) | | -| StreamGetObject | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Object.Vector](#payload.Object.Vector) stream | | -| CreateIndex | [.payload.Control.CreateIndexRequest](#payload.Control.CreateIndexRequest) | [.payload.Empty](#payload.Empty) | | -| SaveIndex | [.payload.Empty](#payload.Empty) | [.payload.Empty](#payload.Empty) | | -| CreateAndSaveIndex | [.payload.Control.CreateIndexRequest](#payload.Control.CreateIndexRequest) | [.payload.Empty](#payload.Empty) | | -| IndexInfo | [.payload.Empty](#payload.Empty) | [.payload.Info.Index.Count](#payload.Info.Index.Count) | | - - + +### Object - -

Top

- -## sidecar/sidecar.proto - - - + - +### Object.Distance -### Sidecar -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | | +| distance | [float](#float) | | | - - -

Top

-## traffic/traffic_manager.proto + - +### Object.ID - - - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | | - -

Top

-## compressor/compressor.proto - - - - - + +### Object.IDs - -### Backup +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ids | [string](#string) | repeated | | -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| GetVector | [.payload.Backup.GetVector.Request](#payload.Backup.GetVector.Request) | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) | | -| Locations | [.payload.Backup.Locations.Request](#payload.Backup.Locations.Request) | [.payload.Info.IPs](#payload.Info.IPs) | | -| Register | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) | [.payload.Empty](#payload.Empty) | | -| RegisterMulti | [.payload.Backup.MetaVectors](#payload.Backup.MetaVectors) | [.payload.Empty](#payload.Empty) | | -| Remove | [.payload.Backup.Remove.Request](#payload.Backup.Remove.Request) | [.payload.Empty](#payload.Empty) | | -| RemoveMulti | [.payload.Backup.Remove.RequestMulti](#payload.Backup.Remove.RequestMulti) | [.payload.Empty](#payload.Empty) | | -| RegisterIPs | [.payload.Backup.IP.Register.Request](#payload.Backup.IP.Register.Request) | [.payload.Empty](#payload.Empty) | | -| RemoveIPs | [.payload.Backup.IP.Remove.Request](#payload.Backup.IP.Remove.Request) | [.payload.Empty](#payload.Empty) | | - - -

Top

-## index/index_manager.proto + +### Object.Vector - - - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | | +| vector | [float](#float) | repeated | | - -### Index -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| IndexInfo | [.payload.Empty](#payload.Empty) | [.payload.Info.Index.Count](#payload.Info.Index.Count) | | - + +### Object.Vectors - -

Top

-## replication/agent/replication_manager.proto +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| vectors | [Object.Vector](#payload.Object.Vector) | repeated | | - - - - + ### Replication -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Recover | [.payload.Replication.Recovery](#payload.Replication.Recovery) | [.payload.Empty](#payload.Empty) | | -| Rebalance | [.payload.Replication.Rebalance](#payload.Replication.Rebalance) | [.payload.Empty](#payload.Empty) | | -| AgentInfo | [.payload.Empty](#payload.Empty) | [.payload.Replication.Agents](#payload.Replication.Agents) | | - - - - - - -

Top

- -## replication/controller/replication_manager.proto - - - - - - - - -### ReplicationController -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| ReplicationInfo | [.payload.Empty](#payload.Empty) | [.payload.Replication.Agents](#payload.Replication.Agents) | | + - +### Replication.Agents - -

Top

+| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| agents | [string](#string) | repeated | | +| removed_agents | [string](#string) | repeated | | +| replicating_agent | [string](#string) | repeated | | -## backup/backup_manager.proto - - - + - +### Replication.Rebalance -### Backup -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| GetVector | [.payload.Backup.GetVector.Request](#payload.Backup.GetVector.Request) | [.payload.Backup.Compressed.MetaVector](#payload.Backup.Compressed.MetaVector) | | -| Locations | [.payload.Backup.Locations.Request](#payload.Backup.Locations.Request) | [.payload.Info.IPs](#payload.Info.IPs) | | -| Register | [.payload.Backup.Compressed.MetaVector](#payload.Backup.Compressed.MetaVector) | [.payload.Empty](#payload.Empty) | | -| RegisterMulti | [.payload.Backup.Compressed.MetaVectors](#payload.Backup.Compressed.MetaVectors) | [.payload.Empty](#payload.Empty) | | -| Remove | [.payload.Backup.Remove.Request](#payload.Backup.Remove.Request) | [.payload.Empty](#payload.Empty) | | -| RemoveMulti | [.payload.Backup.Remove.RequestMulti](#payload.Backup.Remove.RequestMulti) | [.payload.Empty](#payload.Empty) | | -| RegisterIPs | [.payload.Backup.IP.Register.Request](#payload.Backup.IP.Register.Request) | [.payload.Empty](#payload.Empty) | | -| RemoveIPs | [.payload.Backup.IP.Remove.Request](#payload.Backup.IP.Remove.Request) | [.payload.Empty](#payload.Empty) | | +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| high_usage_agents | [string](#string) | repeated | | +| low_usage_agents | [string](#string) | repeated | | - - -

Top

-## egress/egress_filter.proto + - +### Replication.Recovery - - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| deleted_agents | [string](#string) | repeated | | - -### EgressFilter -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Filter | [.payload.Search.Response](#payload.Search.Response) | [.payload.Search.Response](#payload.Search.Response) | | -| StreamFilter | [.payload.Object.Distance](#payload.Object.Distance) stream | [.payload.Object.Distance](#payload.Object.Distance) stream | | - + +### Search - -

Top

-## ingress/ingress_filter.proto - - - + - +### Search.Config -### IngressFilter -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| num | [uint32](#uint32) | | | +| radius | [float](#float) | | | +| epsilon | [float](#float) | | | +| timeout | [int64](#int64) | | | - - -

Top

-## errors.proto + +### Search.IDRequest - -### Errors +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | | +| config | [Search.Config](#payload.Search.Config) | | | - + -### Errors.RPC +### Search.Request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| type | [string](#string) | | | -| msg | [string](#string) | | | -| details | [string](#string) | repeated | | -| instance | [string](#string) | | | -| status | [int64](#int64) | | | -| error | [string](#string) | | | -| roots | [Errors.RPC](#errors.Errors.RPC) | repeated | | +| vector | [float](#float) | repeated | | +| config | [Search.Config](#payload.Search.Config) | | | - - + - +### Search.Response - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| results | [Object.Distance](#payload.Object.Distance) | repeated | | - -

Top

-## vald/vald.proto - - - - -### Vald - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Exists | [.payload.Object.ID](#payload.Object.ID) | [.payload.Object.ID](#payload.Object.ID) | | -| Search | [.payload.Search.Request](#payload.Search.Request) | [.payload.Search.Response](#payload.Search.Response) | | -| SearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) | [.payload.Search.Response](#payload.Search.Response) | | -| StreamSearch | [.payload.Search.Request](#payload.Search.Request) stream | [.payload.Search.Response](#payload.Search.Response) stream | | -| StreamSearchByID | [.payload.Search.IDRequest](#payload.Search.IDRequest) stream | [.payload.Search.Response](#payload.Search.Response) stream | | -| Insert | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | -| StreamInsert | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | -| MultiInsert | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | -| Update | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | -| StreamUpdate | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | -| MultiUpdate | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | -| Upsert | [.payload.Object.Vector](#payload.Object.Vector) | [.payload.Empty](#payload.Empty) | | -| StreamUpsert | [.payload.Object.Vector](#payload.Object.Vector) stream | [.payload.Empty](#payload.Empty) stream | | -| MultiUpsert | [.payload.Object.Vectors](#payload.Object.Vectors) | [.payload.Empty](#payload.Empty) | | -| Remove | [.payload.Object.ID](#payload.Object.ID) | [.payload.Empty](#payload.Empty) | | -| StreamRemove | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Empty](#payload.Empty) stream | | -| MultiRemove | [.payload.Object.IDs](#payload.Object.IDs) | [.payload.Empty](#payload.Empty) | | -| GetObject | [.payload.Object.ID](#payload.Object.ID) | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) | | -| StreamGetObject | [.payload.Object.ID](#payload.Object.ID) stream | [.payload.Backup.MetaVector](#payload.Backup.MetaVector) stream | | + diff --git a/apis/grpc/manager/replication/controller/replication_manager.pb.go b/apis/grpc/manager/replication/controller/replication_manager.pb.go index e81ed391d6..d984cef219 100644 --- a/apis/grpc/manager/replication/controller/replication_manager.pb.go +++ b/apis/grpc/manager/replication/controller/replication_manager.pb.go @@ -46,24 +46,25 @@ func init() { } var fileDescriptor_ca7dddd9e8833d57 = []byte{ - // 271 bytes of a gzipped FileDescriptorProto + // 274 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x28, 0x4a, 0x2d, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x4f, 0xce, 0xcf, 0x2b, 0x29, 0xca, 0xcf, 0xc9, 0x49, 0x2d, 0xd2, 0x47, 0x12, 0x8e, 0xcf, 0x4d, 0xcc, 0x4b, 0x4c, 0x4f, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc6, 0x22, 0x25, 0xc5, 0x5b, 0x90, 0x58, 0x99, 0x93, 0x9f, 0x98, 0x02, 0x51, 0x23, 0x25, 0x93, 0x9e, 0x9f, 0x9f, 0x9e, 0x93, 0xaa, 0x9f, 0x58, 0x90, 0xa9, 0x9f, 0x98, 0x97, 0x97, 0x5f, 0x02, 0x56, 0x5d, 0x0c, 0x95, 0xe5, 0x29, 0x48, 0xd2, 0x4f, 0x2f, 0xcc, - 0x81, 0xf0, 0x8c, 0xf2, 0xb8, 0xb8, 0x83, 0x10, 0x26, 0x0a, 0x45, 0x72, 0xf1, 0x23, 0x71, 0x3d, - 0xf3, 0xd2, 0xf2, 0x85, 0xf8, 0xf4, 0x60, 0xa6, 0xbb, 0xe6, 0x16, 0x94, 0x54, 0x4a, 0x49, 0xc3, - 0xf9, 0x48, 0x2a, 0xf5, 0x1c, 0xd3, 0x53, 0xf3, 0x4a, 0x8a, 0x95, 0x24, 0x9b, 0x2e, 0x3f, 0x99, - 0xcc, 0x24, 0x2c, 0x24, 0x88, 0xec, 0x05, 0xfd, 0xcc, 0xbc, 0xb4, 0x7c, 0x29, 0x96, 0x0d, 0x0f, - 0xe4, 0x99, 0x9c, 0xe6, 0x33, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, - 0x72, 0x8c, 0x5c, 0xba, 0xf9, 0x45, 0xe9, 0x7a, 0x65, 0x29, 0x89, 0x89, 0xc5, 0x7a, 0x65, 0x89, - 0x39, 0x29, 0x7a, 0x30, 0xcf, 0x22, 0xe9, 0xd6, 0x43, 0x84, 0x8b, 0x93, 0x42, 0x58, 0x62, 0x4e, - 0x0a, 0x92, 0xb5, 0xbe, 0x10, 0xe5, 0xce, 0x70, 0x15, 0x01, 0x8c, 0x51, 0x76, 0xe9, 0x99, 0x25, - 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x60, 0x93, 0xf5, 0x41, 0x26, 0x83, 0x02, 0xa3, - 0x58, 0x3f, 0xbd, 0xa8, 0x20, 0x59, 0x1f, 0x6a, 0x87, 0x3e, 0xf6, 0xb0, 0x4f, 0x62, 0x03, 0x07, - 0x8c, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xde, 0x29, 0x2e, 0x9c, 0x01, 0x00, 0x00, + 0x81, 0xf0, 0x8c, 0x2a, 0xb8, 0x44, 0x83, 0x10, 0x26, 0x3a, 0xc3, 0x9d, 0x20, 0x14, 0xc9, 0xc5, + 0x8f, 0x24, 0xe1, 0x99, 0x97, 0x96, 0x2f, 0xc4, 0xa7, 0x07, 0xb3, 0xc7, 0x35, 0xb7, 0xa0, 0xa4, + 0x52, 0x4a, 0x1a, 0xce, 0x47, 0x52, 0xa9, 0xe7, 0x98, 0x9e, 0x9a, 0x57, 0x52, 0xac, 0x24, 0xd9, + 0x74, 0xf9, 0xc9, 0x64, 0x26, 0x61, 0x21, 0x41, 0x64, 0xcf, 0xe8, 0x67, 0xe6, 0xa5, 0xe5, 0x4b, + 0xb1, 0x6c, 0x78, 0x20, 0xcf, 0xe4, 0x34, 0x9f, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, + 0x18, 0x1f, 0x3c, 0x92, 0x63, 0xe4, 0xd2, 0xcd, 0x2f, 0x4a, 0xd7, 0x2b, 0x4b, 0x49, 0x4c, 0x2c, + 0xd6, 0x2b, 0x4b, 0xcc, 0x49, 0xd1, 0x83, 0x79, 0x1b, 0x49, 0xb7, 0x1e, 0x22, 0x84, 0x9c, 0x14, + 0xc2, 0x12, 0x73, 0x52, 0x90, 0xac, 0xf5, 0x85, 0x28, 0x47, 0x78, 0x20, 0x80, 0x31, 0xca, 0x2e, + 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x6c, 0xb2, 0x3e, 0xc8, 0x64, + 0x50, 0xb0, 0x14, 0xeb, 0xa7, 0x17, 0x15, 0x24, 0xeb, 0x43, 0xed, 0xd0, 0xc7, 0x1e, 0x0b, 0x49, + 0x6c, 0xe0, 0x20, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc5, 0xa0, 0x9e, 0x80, 0xa6, 0x01, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -74,72 +75,72 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// ReplicationClient is the client API for Replication service. +// ReplicationControllerClient is the client API for ReplicationController service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ReplicationClient interface { +type ReplicationControllerClient interface { ReplicationInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Replication_Agents, error) } -type replicationClient struct { +type replicationControllerClient struct { cc *grpc.ClientConn } -func NewReplicationClient(cc *grpc.ClientConn) ReplicationClient { - return &replicationClient{cc} +func NewReplicationControllerClient(cc *grpc.ClientConn) ReplicationControllerClient { + return &replicationControllerClient{cc} } -func (c *replicationClient) ReplicationInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Replication_Agents, error) { +func (c *replicationControllerClient) ReplicationInfo(ctx context.Context, in *payload.Empty, opts ...grpc.CallOption) (*payload.Replication_Agents, error) { out := new(payload.Replication_Agents) - err := c.cc.Invoke(ctx, "/replication_manager.Replication/ReplicationInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/replication_manager.ReplicationController/ReplicationInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } -// ReplicationServer is the server API for Replication service. -type ReplicationServer interface { +// ReplicationControllerServer is the server API for ReplicationController service. +type ReplicationControllerServer interface { ReplicationInfo(context.Context, *payload.Empty) (*payload.Replication_Agents, error) } -// UnimplementedReplicationServer can be embedded to have forward compatible implementations. -type UnimplementedReplicationServer struct { +// UnimplementedReplicationControllerServer can be embedded to have forward compatible implementations. +type UnimplementedReplicationControllerServer struct { } -func (*UnimplementedReplicationServer) ReplicationInfo(ctx context.Context, req *payload.Empty) (*payload.Replication_Agents, error) { +func (*UnimplementedReplicationControllerServer) ReplicationInfo(ctx context.Context, req *payload.Empty) (*payload.Replication_Agents, error) { return nil, status.Errorf(codes.Unimplemented, "method ReplicationInfo not implemented") } -func RegisterReplicationServer(s *grpc.Server, srv ReplicationServer) { - s.RegisterService(&_Replication_serviceDesc, srv) +func RegisterReplicationControllerServer(s *grpc.Server, srv ReplicationControllerServer) { + s.RegisterService(&_ReplicationController_serviceDesc, srv) } -func _Replication_ReplicationInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ReplicationController_ReplicationInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(payload.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ReplicationServer).ReplicationInfo(ctx, in) + return srv.(ReplicationControllerServer).ReplicationInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/replication_manager.Replication/ReplicationInfo", + FullMethod: "/replication_manager.ReplicationController/ReplicationInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReplicationServer).ReplicationInfo(ctx, req.(*payload.Empty)) + return srv.(ReplicationControllerServer).ReplicationInfo(ctx, req.(*payload.Empty)) } return interceptor(ctx, in, info, handler) } -var _Replication_serviceDesc = grpc.ServiceDesc{ - ServiceName: "replication_manager.Replication", - HandlerType: (*ReplicationServer)(nil), +var _ReplicationController_serviceDesc = grpc.ServiceDesc{ + ServiceName: "replication_manager.ReplicationController", + HandlerType: (*ReplicationControllerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ReplicationInfo", - Handler: _Replication_ReplicationInfo_Handler, + Handler: _ReplicationController_ReplicationInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/apis/swagger/manager/replication/controller/replication/controller/replication_manager.swagger.json b/apis/swagger/manager/replication/controller/replication/controller/replication_manager.swagger.json index 4458e0e07f..c4d8bed43a 100644 --- a/apis/swagger/manager/replication/controller/replication/controller/replication_manager.swagger.json +++ b/apis/swagger/manager/replication/controller/replication/controller/replication_manager.swagger.json @@ -13,7 +13,7 @@ "paths": { "/replication/info": { "get": { - "operationId": "Replication_ReplicationInfo", + "operationId": "ReplicationController_ReplicationInfo", "responses": { "200": { "description": "A successful response.", @@ -29,7 +29,7 @@ } }, "tags": [ - "Replication" + "ReplicationController" ] } }