repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/backoff_timer.go | pkg/util/typeutil/backoff_timer.go | package typeutil
import (
"time"
"github.com/cenkalti/backoff/v4"
)
var _ BackoffTimerConfigFetcher = BackoffTimerConfig{}
// BackoffTimerConfigFetcher is the interface to fetch backoff timer configuration
type BackoffTimerConfigFetcher interface {
DefaultInterval() time.Duration
BackoffConfig() BackoffConfig
}... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/skip_list.go | pkg/util/typeutil/skip_list.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/string_util_test.go | pkg/util/typeutil/string_util_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/version.go | pkg/util/typeutil/version.go | package typeutil
import (
"fmt"
"strconv"
)
// Version is a interface for version comparison.
type Version interface {
// GT returns true if v > v2.
GT(Version) bool
// EQ returns true if v == v2.
EQ(Version) bool
// String returns the string representation of the version.
String() string
}
// VersionInt64... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/string_util.go | pkg/util/typeutil/string_util.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/ordered_map.go | pkg/util/typeutil/ordered_map.go | package typeutil
type OrderedMap[K comparable, V any] struct {
keys []K
values map[K]V
}
func NewOrderedMap[K comparable, V any]() *OrderedMap[K, V] {
o := OrderedMap[K, V]{}
o.keys = []K{}
o.values = map[K]V{}
return &o
}
func (o *OrderedMap[K, V]) Get(key K) (V, bool) {
val, exists := o.values[key]
retur... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/schema_typed.go | pkg/util/typeutil/schema_typed.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/gen_empty_field_data.go | pkg/util/typeutil/gen_empty_field_data.go | package typeutil
import (
"fmt"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
)
func genEmptyBoolFieldData(field *schemapb.FieldSchema) *schemapb.FieldData {
return &schemapb.FieldData{
Type: field.GetDataType(),
FieldName: field.GetName(),
Field: &schemapb.FieldData_Scalars{
Scalars: &sche... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/ids_checker.go | pkg/util/typeutil/ids_checker.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/chan.go | pkg/util/typeutil/chan.go | package typeutil
// IsChanClosed returns whether input signal channel is closed or not.
// this method accept `chan struct{}` type only in case of passing msg channels by mistake.
func IsChanClosed(ch <-chan struct{}) bool {
select {
case <-ch:
return true
default:
return false
}
}
| go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/schema_test.go | pkg/util/typeutil/schema_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | true |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/typeutil/schema.go | pkg/util/typeutil/schema.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | true |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/cooldown_notifier_test.go | pkg/util/syncutil/cooldown_notifier_test.go | package syncutil
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestCooldownNotifier(t *testing.T) {
n := NewCooldownNotifier[int](10*time.Millisecond, 1)
n.Notify(1)
n.Notify(2)
k := <-n.Chan()
assert.Equal(t, 1, k)
select {
case <-n.Chan():
t.Errorf("should be blocked")
default... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/closed_lock.go | pkg/util/syncutil/closed_lock.go | package syncutil
import "sync"
type ClosableLock struct {
mu sync.Mutex
closed bool
}
func (l *ClosableLock) LockIfNotClosed() bool {
l.mu.Lock()
if l.closed {
l.mu.Unlock()
return false
}
return true
}
func (l *ClosableLock) Unlock() {
l.mu.Unlock()
}
func (l *ClosableLock) Close() {
l.mu.Lock()
... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/future.go | pkg/util/syncutil/future.go | package syncutil
import (
"context"
)
// Future is a future value that can be set and retrieved.
type Future[T any] struct {
ch chan struct{}
value T
}
// NewFuture creates a new future.
func NewFuture[T any]() *Future[T] {
return &Future[T]{
ch: make(chan struct{}),
}
}
// Set sets the value of the futur... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/async_task_notifier.go | pkg/util/syncutil/async_task_notifier.go | package syncutil
import "context"
// NewAsyncTaskNotifier creates a new async task notifier.
func NewAsyncTaskNotifier[T any]() *AsyncTaskNotifier[T] {
ctx, cancel := context.WithCancel(context.Background())
return &AsyncTaskNotifier[T]{
ctx: ctx,
cancel: cancel,
future: NewFuture[T](),
}
}
// AsyncTaskN... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/context_condition_variable.go | pkg/util/syncutil/context_condition_variable.go | package syncutil
import (
"context"
"sync"
)
// NewContextCond creates a new condition variable that can be used with context.
// Broadcast is implemented using a channel, so the performance may not be as good as sync.Cond.
func NewContextCond(l sync.Locker) *ContextCond {
return &ContextCond{L: l}
}
// ContextCo... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/context_condition_variable_test.go | pkg/util/syncutil/context_condition_variable_test.go | package syncutil
import (
"context"
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestContextCond(t *testing.T) {
cv := NewContextCond(&sync.Mutex{})
cv.L.Lock()
go func() {
time.Sleep(10 * time.Millisecond)
cv.LockAndBroadcast()
cv.L.Unlock()
}()
// Acquire lock before wait.
a... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/versioned_notifier.go | pkg/util/syncutil/versioned_notifier.go | package syncutil
import (
"context"
"sync"
)
const (
VersionedListenAtEarliest versionedListenAt = -1
VersionedListenAtLatest versionedListenAt = -2
)
// versionedListenerAt is the position where the listener starts to listen.
type versionedListenAt int
// NewVersionedNotifier creates a new VersionedNotifier.... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/future_test.go | pkg/util/syncutil/future_test.go | package syncutil
import (
"testing"
"time"
)
func TestFuture_SetAndGet(t *testing.T) {
f := NewFuture[int]()
go func() {
time.Sleep(1 * time.Second) // Simulate some work
f.Set(42)
}()
val := f.Get()
if val != 42 {
t.Errorf("Expected value 42, got %d", val)
}
}
func TestFuture_Done(t *testing.T) {
f ... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/async_task_notifier_test.go | pkg/util/syncutil/async_task_notifier_test.go | package syncutil
import (
"testing"
"github.com/cockroachdb/errors"
"github.com/stretchr/testify/assert"
)
func TestAsyncTaskNotifier(t *testing.T) {
n := NewAsyncTaskNotifier[error]()
assert.NotNil(t, n.Context())
select {
case <-n.FinishChan():
t.Errorf("should not done")
return
case <-n.Context().Don... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/cooldown_notifier.go | pkg/util/syncutil/cooldown_notifier.go | package syncutil
import (
"sync"
"time"
)
// NewCooldownNotifier creates a new CooldownNotifier with the specified cooldown duration and buffer size.
func NewCooldownNotifier[T any](cooldown time.Duration, buffed int) *CooldownNotifier[T] {
return &CooldownNotifier[T]{
cooldown: cooldown,
notifier: make(chan T... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/syncutil/versioned_notifier_test.go | pkg/util/syncutil/versioned_notifier_test.go | package syncutil
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestLatestVersionedNotifier(t *testing.T) {
vn := NewVersionedNotifier()
// Create a listener at the latest version
listener := vn.Listen(VersionedListenAtLatest)
useWaitChanListener := vn.Listen(VersionedListen... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/replicateutil/util.go | pkg/util/replicateutil/util.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/replicateutil/config_validator.go | pkg/util/replicateutil/config_validator.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/replicateutil/config_helper_test.go | pkg/util/replicateutil/config_helper_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/replicateutil/config_validator_test.go | pkg/util/replicateutil/config_validator_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/replicateutil/config_helper.go | pkg/util/replicateutil/config_helper.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/testutils/gen_data.go | pkg/util/testutils/gen_data.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | true |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/testutils/prometheus_metric.go | pkg/util/testutils/prometheus_metric.go | package testutils
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/testutil"
"github.com/stretchr/testify/suite"
)
// PromMetricsSuite is a util suite wrapper providing prometheus metrics assertion functions.
type PromMetricsSuite struct {
suite.Suite
}
fu... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/gc/gc_tuner.go | pkg/util/gc/gc_tuner.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/lock/key_lock.go | pkg/util/lock/key_lock.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/lock/mutex.go | pkg/util/lock/mutex.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/lock/metric_mutex.go | pkg/util/lock/metric_mutex.go | package lock
import (
"sync"
"time"
"github.com/cockroachdb/errors"
"go.uber.org/zap"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/metrics"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)
type MetricsLockManager struct {
rwLocks map[string]*MetricsRWMutex
}
type Metri... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/lock/metrics_mutex_test.go | pkg/util/lock/metrics_mutex_test.go | package lock
import (
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)
func TestMetricsLockLock(t *testing.T) {
params := paramtable.Get()
lManager := &MetricsLockManager{
rwLocks: make(map[string]*MetricsRWMutex, 0),
}
params.Init(paramt... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/lock/key_lock_test.go | pkg/util/lock/key_lock_test.go | package lock
import (
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestKeyLock(t *testing.T) {
keys := []string{"Milvus", "Blazing", "Fast"}
keyLock := NewKeyLock[string]()
keyLock.Lock(keys[0])
keyLock.Lock(keys[1])
keyLock.Lock(keys[2])
// should work
wg := sync.WaitGroup{}
wg... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/lock/mutex_deadlock.go | pkg/util/lock/mutex_deadlock.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/tsoutil/tso.go | pkg/util/tsoutil/tso.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/tsoutil/tso_test.go | pkg/util/tsoutil/tso_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/crypto/crypto_test.go | pkg/util/crypto/crypto_test.go | package crypto
import (
"testing"
"github.com/stretchr/testify/assert"
"golang.org/x/crypto/bcrypt"
)
//func BenchmarkPasswordVerify(b *testing.B) {
// correctPassword := "test_my_pass_new"
// credInfo := &internalpb.CredentialInfo{
// Username: "root",
// Sha256Password: "bcca79df9650cef1d7ed9f63449d7f8a... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/crypto/crypto.go | pkg/util/crypto/crypto.go | package crypto
import (
"crypto/md5" // #nosec
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"golang.org/x/crypto/bcrypt"
)
func SHA256(src string, salt string) string {
h := sha256.New()
h.Write([]byte(src + salt))
sum := h.Sum(nil)
s := hex.EncodeToString(sum)
return s
}
// PasswordEncrypt encrypt p... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/etcd/etcd_server.go | pkg/util/etcd/etcd_server.go | package etcd
import (
"sync"
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/server/v3/embed"
"go.etcd.io/etcd/server/v3/etcdserver/api/v3client"
"go.uber.org/zap"
"github.com/milvus-io/milvus/pkg/v2/log"
)
// EtcdServer is the singleton of embedded etcd server
var (
initOnce sync.Once
closeOnce sy... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/etcd/etcd_util.go | pkg/util/etcd/etcd_util.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/etcd/etcd_util_test.go | pkg/util/etcd/etcd_util_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/netutil/listener.go | pkg/util/netutil/listener.go | package netutil
import (
"crypto/tls"
"fmt"
"net"
"github.com/milvus-io/milvus/pkg/v2/util/funcutil"
)
// NewListener creates a new listener that listens on the specified network and IP address.
func NewListener(opts ...Opt) (*NetListener, error) {
config := getNetListenerConfig(opts...)
if config.tlsConfig !=... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/netutil/listener_test.go | pkg/util/netutil/listener_test.go | package netutil
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestListener(t *testing.T) {
l, err := NewListener(
OptIP("127.0.0.1"),
OptPort(0),
)
assert.NoError(t, err)
assert.NotNil(t, l)
assert.NotZero(t, l.Port())
assert.Equal(t, l.Address(), fmt.Sprintf("127.0.0.1:%d", l.Por... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/logutil/logutil_test.go | pkg/util/logutil/logutil_test.go | package logutil
import (
"testing"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/milvus-io/milvus/pkg/v2/log"
)
func TestName(t *testing.T) {
conf := &log.Config{Level: "debug", DisableTimestamp: true}
logger, _, _ := log.InitTestLogger(t, conf, zap.AddCallerSki... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/logutil/logutil.go | pkg/util/logutil/logutil.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/logutil/grpc_interceptor_test.go | pkg/util/logutil/grpc_interceptor_test.go | package logutil
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc/metadata"
"github.com/milvus-io/milvus/pkg/v2/log"
)
func TestCtxWithLevelAndTrace(t *testing.T) {
t.Run("debug level", func(t *testing.T) {
ctx := withMetaData(context.TODO()... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/logutil/grpc_interceptor.go | pkg/util/logutil/grpc_interceptor.go | package logutil
import (
"context"
"strconv"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"github.com/milvus-io/milvus/pkg/v2/common"
"github.com/milvus-... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/timestamptz/timestamptz.go | pkg/util/timestamptz/timestamptz.go | package timestamptz
import (
"bytes"
"fmt"
"strings"
"time"
"github.com/cockroachdb/errors"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/pkg/v2/common"
"github.com/milvus-io/milvus/pkg/v2/util/funcutil"
)
// Define max/min offset boundaries in seconds for validation, e... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/util/timestamptz/timestamptz_test.go | pkg/util/timestamptz/timestamptz_test.go | package timestamptz
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
// TestValidateAndNormalizeTimestampTz tests the function for string validation and normalization.
func TestValidateAndNormalizeTimestampTz(t *testing.T) {
testCases := []struct {
name string
inputStr str... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_database_test.go | pkg/mq/msgstream/msg_for_database_test.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_alias.go | pkg/mq/msgstream/msg_for_alias.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg.go | pkg/mq/msgstream/msg.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_database.go | pkg/mq/msgstream/msg_for_database.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/factory_stream_test.go | pkg/mq/msgstream/factory_stream_test.go | package msgstream
import (
"context"
"fmt"
"log"
"reflect"
"runtime"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
"github.com/milvus-io/milvus/pkg/v2/mq/common... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mq_factory_test.go | pkg/mq/msgstream/mq_factory_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_import.go | pkg/mq/msgstream/msg_for_import.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/common_mq_factory.go | pkg/mq/msgstream/common_mq_factory.go | package msgstream
import (
"context"
"github.com/cockroachdb/errors"
"github.com/milvus-io/milvus/pkg/v2/mq/common"
"github.com/milvus-io/milvus/pkg/v2/mq/msgstream/mqwrapper"
)
var _ Factory = &CommonFactory{}
// CommonFactory is a Factory for creating message streams with common logic.
//
// It contains a fu... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_user_role_test.go | pkg/mq/msgstream/msg_for_user_role_test.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msgstream_util.go | pkg/mq/msgstream/msgstream_util.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mock_msgstream.go | pkg/mq/msgstream/mock_msgstream.go | // Code generated by mockery v2.53.3. DO NOT EDIT.
package msgstream
import (
context "context"
common "github.com/milvus-io/milvus/pkg/v2/mq/common"
mock "github.com/stretchr/testify/mock"
msgpb "github.com/milvus-io/milvus-proto/go-api/v2/msgpb"
)
// MockMsgStream is an autogenerated mock type for the MsgSt... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mock_mq_factory.go | pkg/mq/msgstream/mock_mq_factory.go | package msgstream
import "context"
type MockMqFactory struct {
Factory
NewMsgStreamFunc func(ctx context.Context) (MsgStream, error)
}
func NewMockMqFactory() *MockMqFactory {
return &MockMqFactory{}
}
func (m MockMqFactory) NewMsgStream(ctx context.Context) (MsgStream, error) {
return m.NewMsgStreamFunc(ctx)
}... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/trace.go | pkg/mq/msgstream/trace.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mq_msgstream_test.go | pkg/mq/msgstream/mq_msgstream_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_test.go | pkg/mq/msgstream/msg_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_partition_test.go | pkg/mq/msgstream/msg_for_partition_test.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/factory_test.go | pkg/mq/msgstream/factory_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/unmarshal.go | pkg/mq/msgstream/unmarshal.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/stream_test.go | pkg/mq/msgstream/stream_test.go | package msgstream
import (
"context"
"math/rand"
"reflect"
"runtime"
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/mq/common"
"github.com/milvus-io/milvus/pkg/v2/mq/msgstream/mqwrapper"
"github.... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/repack_func.go | pkg/mq/msgstream/repack_func.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_index.go | pkg/mq/msgstream/msg_for_index.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_collection.go | pkg/mq/msgstream/msg_for_collection.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mock_msgstream_factory.go | pkg/mq/msgstream/mock_msgstream_factory.go | // Code generated by mockery v2.53.3. DO NOT EDIT.
package msgstream
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// MockFactory is an autogenerated mock type for the Factory type
type MockFactory struct {
mock.Mock
}
type MockFactory_Expecter struct {
mock *mock.Mock
}
func (_m *MockF... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_index_test.go | pkg/mq/msgstream/msg_for_index_test.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msgstream_util_test.go | pkg/mq/msgstream/msgstream_util_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/wasted_mock_msgstream.go | pkg/mq/msgstream/wasted_mock_msgstream.go | package msgstream
import "context"
type WastedMockMsgStream struct {
MsgStream
AsProducerFunc func(channels []string)
BroadcastMarkFunc func(*MsgPack) (map[string][]MessageID, error)
BroadcastFunc func(*MsgPack) error
ChanFunc func() <-chan *ConsumeMsgPack
}
func NewWastedMockMsgStream() *Wasted... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msgstream.go | pkg/mq/msgstream/msgstream.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_import_test.go | pkg/mq/msgstream/msg_for_import_test.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mq_factory.go | pkg/mq/msgstream/mq_factory.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/unmarshal_test.go | pkg/mq/msgstream/unmarshal_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_user_role.go | pkg/mq/msgstream/msg_for_user_role.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/stream_bench_test.go | pkg/mq/msgstream/stream_bench_test.go | package msgstream
import (
"context"
"fmt"
"math/rand"
"sync"
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/v2/mq/common"
"github.com/milvus-io/milvus/pkg/v2/mq/msgstream/mqwrapper"
"github.com/milvus-io/milvus/pkg/v2/util/funcutil"
)
func benchmarkProduceAndConsume(b *tes... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mq_msgstream.go | pkg/mq/msgstream/mq_msgstream.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_collection_test.go | pkg/mq/msgstream/msg_for_collection_test.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/msg_for_partition.go | pkg/mq/msgstream/msg_for_partition.go | /*
* Licensed to the LF AI & Data foundation under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/client.go | pkg/mq/msgstream/mqwrapper/client.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/producer.go | pkg/mq/msgstream/mqwrapper/producer.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/consumer.go | pkg/mq/msgstream/mqwrapper/consumer.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/rmq/rmq_producer.go | pkg/mq/msgstream/mqwrapper/rmq/rmq_producer.go | // Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/rmq/rmq_client_test.go | pkg/mq/msgstream/mqwrapper/rmq/rmq_client_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/rmq/rmq_client.go | pkg/mq/msgstream/mqwrapper/rmq/rmq_client.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/rmq/rmq_consumer.go | pkg/mq/msgstream/mqwrapper/rmq/rmq_consumer.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/wp/wp_id.go | pkg/mq/msgstream/mqwrapper/wp/wp_id.go | package wp
import (
"github.com/zilliztech/woodpecker/woodpecker/log"
"github.com/milvus-io/milvus/pkg/v2/mq/common"
)
func NewWoodpeckerID(id *log.LogMessageId) *woodpeckerID {
return &woodpeckerID{
messageID: id,
}
}
type woodpeckerID struct {
messageID *log.LogMessageId
}
func (w *woodpeckerID) Woodpecke... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/pulsar/pulsar_message.go | pkg/mq/msgstream/mqwrapper/pulsar/pulsar_message.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/pulsar/pulsar_id.go | pkg/mq/msgstream/mqwrapper/pulsar/pulsar_id.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/pulsar/pulsar_producer_test.go | pkg/mq/msgstream/mqwrapper/pulsar/pulsar_producer_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/pulsar/pulsar_client_test.go | pkg/mq/msgstream/mqwrapper/pulsar/pulsar_client_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/pkg/mq/msgstream/mqwrapper/pulsar/pulsar_consumer_test.go | pkg/mq/msgstream/mqwrapper/pulsar/pulsar_consumer_test.go | // Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.