mirror of https://github.com/milvus-io/milvus.git
parent
b1d6d52c36
commit
c41bc0dede
|
@ -205,7 +205,7 @@ func CalcHammingBatch(dim int64, left []byte, lIndex int64, right []byte, result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func CalcHammingDistance(dim int64, left []byte, right []byte) ([]int32, error) {
|
func CalcHammingDistance(dim int64, left, right []byte) ([]int32, error) {
|
||||||
if dim <= 0 {
|
if dim <= 0 {
|
||||||
err := errors.New("Invalid dimension")
|
err := errors.New("Invalid dimension")
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -313,7 +313,7 @@ func (gp *BaseTable) Load(key string) (string, error) {
|
||||||
return gp.params.Load(strings.ToLower(key))
|
return gp.params.Load(strings.ToLower(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gp *BaseTable) LoadWithDefault(key string, defaultValue string) string {
|
func (gp *BaseTable) LoadWithDefault(key, defaultValue string) string {
|
||||||
return gp.params.LoadWithDefault(strings.ToLower(key), defaultValue)
|
return gp.params.LoadWithDefault(strings.ToLower(key), defaultValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ func LogError(span opentracing.Span, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// InfoFromSpan is a method return span details.
|
// InfoFromSpan is a method return span details.
|
||||||
func InfoFromSpan(span opentracing.Span) (traceID string, sampled bool, found bool) {
|
func InfoFromSpan(span opentracing.Span) (traceID string, sampled, found bool) {
|
||||||
if span != nil {
|
if span != nil {
|
||||||
if spanContext, ok := span.Context().(jaeger.SpanContext); ok {
|
if spanContext, ok := span.Context().(jaeger.SpanContext); ok {
|
||||||
traceID = spanContext.TraceID().String()
|
traceID = spanContext.TraceID().String()
|
||||||
|
|
|
@ -16,7 +16,7 @@ import "github.com/milvus-io/milvus/internal/proto/commonpb"
|
||||||
// CompareIndexParams compares indexParam1 with indexParam2. When all keys of indexParam1 exist in indexParam2,
|
// CompareIndexParams compares indexParam1 with indexParam2. When all keys of indexParam1 exist in indexParam2,
|
||||||
// and the corresponding value are the same as in indexParam2, return true
|
// and the corresponding value are the same as in indexParam2, return true
|
||||||
// Otherwise return false
|
// Otherwise return false
|
||||||
func CompareIndexParams(indexParam1 []*commonpb.KeyValuePair, indexParam2 []*commonpb.KeyValuePair) bool {
|
func CompareIndexParams(indexParam1, indexParam2 []*commonpb.KeyValuePair) bool {
|
||||||
if indexParam1 == nil && indexParam2 == nil {
|
if indexParam1 == nil && indexParam2 == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,6 @@ func ParseTimestamp(data []byte) (time.Time, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubTimeByWallClock returns the duration between two different timestamps.
|
// SubTimeByWallClock returns the duration between two different timestamps.
|
||||||
func SubTimeByWallClock(after time.Time, before time.Time) time.Duration {
|
func SubTimeByWallClock(after, before time.Time) time.Duration {
|
||||||
return time.Duration(after.UnixNano() - before.UnixNano())
|
return time.Duration(after.UnixNano() - before.UnixNano())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue