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/internal/util/streamingutil/util/topic.go | internal/util/streamingutil/util/topic.go | package util
import (
"fmt"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
"github.com/milvus-io/milvus/pkg/v2/util/typeutil"
)
// GetAllTopicsFromConfiguration gets all topics from configuration.
// It's a utility function to fetch all topics from configuration.
func GetAllTopicsFromConfiguration() typeuti... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/util/topic_test.go | internal/util/streamingutil/util/topic_test.go | package util
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)
func TestGetAllTopicsFromConfiguration(t *testing.T) {
paramtable.Init()
topics := GetAllTopicsFromConfiguration()
assert.Len(t, topics, 16)
paramtable.Get().CommonCfg.PreCreatedTopicEn... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/util/wal_selector_test.go | internal/util/streamingutil/util/wal_selector_test.go | package util
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/v2/streaming/util/message"
)
func TestValidateWALType(t *testing.T) {
_, err := validateWALName(false, message.WALNameRocksmq.String())
assert.Error(t, err)
}
func TestSelectWALType(t *testing.T) {
assert.Eq... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/discoverer/discoverer.go | internal/util/streamingutil/service/discoverer/discoverer.go | package discoverer
import (
"context"
"fmt"
"strings"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/attributes"
"github.com/milvus-io/milvus/pkg/v2/util/typeutil"
)
// Discoverer is the interface for the discoverer.
// Do not promise
// 1. concurrent safe.
... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/discoverer/session_discoverer_test.go | internal/util/streamingutil/service/discoverer/session_discoverer_test.go | package discoverer
import (
"context"
"fmt"
"io"
"net"
"testing"
"github.com/blang/semver/v4"
"github.com/stretchr/testify/assert"
clientv3 "go.etcd.io/etcd/client/v3"
"github.com/milvus-io/milvus/internal/json"
kvfactory "github.com/milvus-io/milvus/internal/util/dependency/kv"
"github.com/milvus-io/milv... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/discoverer/channel_assignment_discoverer_test.go | internal/util/streamingutil/service/discoverer/channel_assignment_discoverer_test.go | package discoverer
import (
"context"
"io"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/attributes"
"github.com/milvus-io/milvus/pkg/v2/mocks/streaming/util/mock_types"
"github.com/milvus-io/milvus/pkg/v2/st... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/discoverer/session_discoverer.go | internal/util/streamingutil/service/discoverer/session_discoverer.go | package discoverer
import (
"context"
"net"
"strconv"
"github.com/blang/semver/v4"
"github.com/cockroachdb/errors"
clientv3 "go.etcd.io/etcd/client/v3"
"go.uber.org/zap"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/json"
"github.com/milvus-io/milvus/internal/util/sessionutil"
"g... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/discoverer/channel_assignment_discoverer.go | internal/util/streamingutil/service/discoverer/channel_assignment_discoverer.go | package discoverer
import (
"context"
"go.uber.org/zap"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/attributes"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/streaming/util/types"
"github.com/milvus-io/milvus/pkg/v2/util/typ... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/pick_server_id_test.go | internal/util/streamingutil/service/contextutil/pick_server_id_test.go | package contextutil
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
func TestWithPickServerID(t *testing.T) {
ctx := context.Background()
ctx = WithPickServerID(ctx, 1)
serverID, ok := GetPickServerID(ctx)
assert.True(t, ok)
assert.EqualValues(t, 1, serverID)
}
func TestGetPickServerID(t... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/create_producer.go | internal/util/streamingutil/service/contextutil/create_producer.go | package contextutil
import (
"context"
"encoding/base64"
"fmt"
"github.com/cockroachdb/errors"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
const createProducerKey = "create-producer"
// WithCreateProducer attaches create produ... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/cluster_id_test.go | internal/util/streamingutil/service/contextutil/cluster_id_test.go | package contextutil
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/metadata"
)
func TestWithClusterID(t *testing.T) {
ctx := WithClusterID(context.Background(), "test-cluster-id")
md, ok := metadata.FromOutgoingContext(ctx)
assert.True(t, ok)
assert.NotNil(t, md)
... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/create_consumer.go | internal/util/streamingutil/service/contextutil/create_consumer.go | package contextutil
import (
"context"
"encoding/base64"
"fmt"
"github.com/cockroachdb/errors"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
const (
createConsumerKey = "create-consumer"
)
// WithCreateConsumer attaches create ... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/create_producer_test.go | internal/util/streamingutil/service/contextutil/create_producer_test.go | package contextutil
import (
"context"
"encoding/base64"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/metadata"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
func TestWithCreateProducer(t *testing.T) {
req := &streamingpb.CreateProducerRequest{
Pchannel: &streamingpb.PC... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/pick_server_id.go | internal/util/streamingutil/service/contextutil/pick_server_id.go | package contextutil
import (
"context"
)
type (
pickResultKeyType int
)
var pickResultServerIDKey pickResultKeyType = 0
// WithPickServerID returns a new context with the pick result.
func WithPickServerID(ctx context.Context, serverID int64) context.Context {
return context.WithValue(ctx, pickResultServerIDKey,... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/create_consumer_test.go | internal/util/streamingutil/service/contextutil/create_consumer_test.go | package contextutil
import (
"context"
"encoding/base64"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/metadata"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
func TestWithCreateConsumer(t *testing.T) {
req := &streamingpb.CreateConsumerRequest{
Pchannel: &streamingpb.PC... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/contextutil/cluster_id.go | internal/util/streamingutil/service/contextutil/cluster_id.go | package contextutil
import (
"context"
"github.com/cockroachdb/errors"
"google.golang.org/grpc/metadata"
)
const clusterIDKey = "cluster-id"
// WithClusterID attaches cluster id to context.
func WithClusterID(ctx context.Context, clusterID string) context.Context {
return metadata.AppendToOutgoingContext(ctx, c... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/balancer/base.go | internal/util/streamingutil/service/balancer/base.go | /*
*
* Copyright 2017 gRPC authors.
*
* 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 law or agree... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/balancer/balancer.go | internal/util/streamingutil/service/balancer/balancer.go | /*
*
* Copyright 2017 gRPC authors.
*
* 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 law or agree... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/balancer/balancer_test.go | internal/util/streamingutil/service/balancer/balancer_test.go | /*
*
* Copyright 2020 gRPC authors.
*
* 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 law or agree... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/balancer/picker/server_id_picker.go | internal/util/streamingutil/service/balancer/picker/server_id_picker.go | package picker
import (
"strconv"
"github.com/cockroachdb/errors"
"go.uber.org/atomic"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/base"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"github.com/milvus-io/milvus/internal/util/streamin... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/balancer/picker/server_id_picker_test.go | internal/util/streamingutil/service/balancer/picker/server_id_picker_test.go | package picker
import (
"context"
"testing"
"github.com/cockroachdb/errors"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/base"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/attributes"
bbalancer "... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/balancer/picker/server_id_builder.go | internal/util/streamingutil/service/balancer/picker/server_id_builder.go | package picker
import (
"go.uber.org/atomic"
"go.uber.org/zap"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/base"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/attributes"
bbalancer "github.com/milvus-io/milvus/internal/util/streamingutil/service/balancer"
"github.com/m... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/resolver/watch_based_grpc_resolver_test.go | internal/util/streamingutil/service/resolver/watch_based_grpc_resolver_test.go | package resolver
import (
"testing"
"github.com/cockroachdb/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/mocks/google.golang.org/grpc/mock_resolver"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/resolver/resolver.go | internal/util/streamingutil/service/resolver/resolver.go | package resolver
import (
"context"
"github.com/cockroachdb/errors"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/discoverer"
)
type VersionedState = discoverer.VersionedState
var (
ErrCanceled = errors.New("canceled")
ErrInterrupted = errors.New("inter... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/resolver/resolver_with_discoverer_test.go | internal/util/streamingutil/service/resolver/resolver_with_discoverer_test.go | package resolver
import (
"context"
"testing"
"time"
"github.com/cockroachdb/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/attributes"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/mocks/google.golang.org/grpc/mock_resolver"... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/resolver/resolver_with_discoverer.go | internal/util/streamingutil/service/resolver/resolver_with_discoverer.go | package resolver
import (
"context"
"sync"
"time"
"github.com/cockroachdb/errors"
"go.uber.org/zap"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/discoverer"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/util/syncutil"
"github.com/milvus-io/milvus/pkg/v2/uti... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/resolver/watch_based_grpc_resolver.go | internal/util/streamingutil/service/resolver/watch_based_grpc_resolver.go | package resolver
import (
"github.com/cockroachdb/errors"
"go.uber.org/zap"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/util/typeutil"
)
var _ resolver.Resolver = (*watchBasedGRPCResolver)(nil)
// newWatchBasedGRPCResolver creates a new watch b... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/resolver/builder.go | internal/util/streamingutil/service/resolver/builder.go | package resolver
import (
"time"
"github.com/cockroachdb/errors"
clientv3 "go.etcd.io/etcd/client/v3"
"go.uber.org/zap"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/util/streamingutil/service/discoverer"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/s... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/resolver/builder_test.go | internal/util/streamingutil/service/resolver/builder_test.go | package resolver
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/resolver"
"github.com/milvus-io/milvus/internal/mocks/google.golang.org/grpc/mock_resolver"
"github.com/milvus-io/milvus/internal/mocks/util/streamingutil/service/mock_... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/interceptor/client.go | internal/util/streamingutil/service/interceptor/client.go | package interceptor
import (
"context"
"strings"
"google.golang.org/grpc"
"github.com/milvus-io/milvus/internal/util/streamingutil/status"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
// NewStreamingServiceUnaryClientInterceptor returns a new unary client interceptor for error handling.
func NewStr... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/interceptor/server_test.go | internal/util/streamingutil/service/interceptor/server_test.go | package interceptor
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/internal/util/streamingutil/status"
"github.com/milvus-io/milvus/pkg/v2/util/merr"
)
func TestConvertMilvusErrorIntoStreamingError(t *testing.T) {
err := merr.WrapErrNodeNotMatch(1, 2)
err = convertMilvusE... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/interceptor/server.go | internal/util/streamingutil/service/interceptor/server.go | package interceptor
import (
"context"
"strings"
"github.com/cockroachdb/errors"
"google.golang.org/grpc"
"github.com/milvus-io/milvus/internal/util/streamingutil/status"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
"github.com/milvus-io/milvus/pkg/v2/util/merr"
)
// NewStreamingServiceUnaryServerI... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/lazygrpc/conn_test.go | internal/util/streamingutil/service/lazygrpc/conn_test.go | package lazygrpc
import (
"context"
"net"
"testing"
"time"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/test/bufconn"
)
func TestLazyConn(t *testing.T) {
listener := bufconn.Listen(1024)
s := grpc.NewServer()
go s.Serve... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/lazygrpc/service.go | internal/util/streamingutil/service/lazygrpc/service.go | package lazygrpc
import (
"context"
"google.golang.org/grpc"
)
// WithServiceCreator creates a lazy grpc service with a service creator.
func WithServiceCreator[T any](conn Conn, serviceCreator func(grpc.ClientConnInterface) T) Service[T] {
return &serviceImpl[T]{
Conn: conn,
serviceCreator: service... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/lazygrpc/conn.go | internal/util/streamingutil/service/lazygrpc/conn.go | package lazygrpc
import (
"context"
"time"
"github.com/cenkalti/backoff/v4"
"github.com/cockroachdb/errors"
"go.uber.org/zap"
"google.golang.org/grpc"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/util/syncutil"
)
var ErrClosed = errors.New("lazy grpc conn closed")
// NewConn... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/attributes/attributes_test.go | internal/util/streamingutil/service/attributes/attributes_test.go | package attributes
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/internal/util/sessionutil"
"github.com/milvus-io/milvus/pkg/v2/streaming/util/types"
)
func TestAttributes(t *testing.T) {
attr := new(Attributes)
serverID := GetServerID(attr)
assert.Nil(t, serverID)
ass... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/service/attributes/attributes.go | internal/util/streamingutil/service/attributes/attributes.go | package attributes
import (
"google.golang.org/grpc/attributes"
"github.com/milvus-io/milvus/internal/util/sessionutil"
"github.com/milvus-io/milvus/pkg/v2/streaming/util/types"
)
type attributesKeyType int
const (
serverIDKey attributesKeyType = iota
channelAssignmentInfoKey
sessionKey
)
type Attributes = a... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/checker.go | internal/util/streamingutil/status/checker.go | package status
import (
"context"
"github.com/cockroachdb/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// Check if the error is canceled.
// Used in client side.
func IsCanceled(err error) bool {
if err == nil {
return false
}
if errors.Is(err, context.DeadlineExceeded) {
retur... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/checker_test.go | internal/util/streamingutil/status/checker_test.go | package status
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func TestIsCanceled(t *testing.T) {
assert.False(t, IsCanceled(nil))
assert.True(t, IsCanceled(context.DeadlineExceeded))
assert.True(t, IsCanceled(context.Cancele... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/rpc_error.go | internal/util/streamingutil/status/rpc_error.go | package status
import (
"context"
"fmt"
"io"
"github.com/cockroachdb/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
var streamingErrorToGRPCStatus = map[streamingpb.StreamingCode]codes.Code{
streamingpb.StreamingCode_STREAMING_... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/streaming_error_test.go | internal/util/streamingutil/status/streaming_error_test.go | package status
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
func TestStreamingError(t *testing.T) {
streamingErr := NewOnShutdownError("test")
assert.Contains(t, streamingErr.Error(), "code: STREAMING_CODE_ON_SHUTDOWN, cause: test")
assert.Fa... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/client_stream_wrapper_test.go | internal/util/streamingutil/status/client_stream_wrapper_test.go | package status
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/milvus-io/milvus/internal/mocks/google.golang.org/mock_grpc"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
func TestClientStreamWrapper(t *testing.T) {
s := mock_grpc.New... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/streaming_error.go | internal/util/streamingutil/status/streaming_error.go | package status
import (
"fmt"
"github.com/cockroachdb/errors"
"github.com/cockroachdb/redact"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
"github.com/milvus-io/milvus/pkg/v2/streaming/util/message"
)
var _ error = (*StreamingError)(nil)
// StreamingError is the error type for streaming internal mod... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/rpc_error_test.go | internal/util/streamingutil/status/rpc_error_test.go | package status
import (
"context"
"testing"
"github.com/cockroachdb/errors"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
"github.com/milvus-io/milvus/pkg/v2/proto/streamingpb"
)
func TestStreamingStatus(t *testing.T) {
err := ConvertStreamingError("test", nil)
assert.Nil(t, err)
err ... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/streamingutil/status/client_stream_wrapper.go | internal/util/streamingutil/status/client_stream_wrapper.go | package status
import (
"google.golang.org/grpc"
)
// NewClientStreamWrapper returns a grpc.ClientStream that wraps the given stream.
func NewClientStreamWrapper(method string, stream grpc.ClientStream) grpc.ClientStream {
if stream == nil {
return nil
}
return &clientStreamWrapper{
method: method,
Cl... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/segcore_init_test.go | internal/util/segcore/segcore_init_test.go | package segcore
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetIndexEngineInfo(t *testing.T) {
r := GetIndexEngineInfo()
assert.NotZero(t, r.CurrentIndexVersion)
assert.Zero(t, r.MinIndexVersion)
}
| go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/plan_test.go | internal/util/segcore/plan_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/internal/util/segcore/reduce_test.go | internal/util/segcore/reduce_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/internal/util/segcore/jemalloc_stats.go | internal/util/segcore/jemalloc_stats.go | // Copyright (C) 2019-2025 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/internal/util/segcore/plan.go | internal/util/segcore/plan.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/internal/util/segcore/jemalloc_stats_test.go | internal/util/segcore/jemalloc_stats_test.go | // Copyright (C) 2019-2025 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/internal/util/segcore/collection_test.go | internal/util/segcore/collection_test.go | package segcore_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/mocks/util/mock_segcore"
"github.com/milvus-io/milvus/internal/util/segcore"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)
func Tes... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/reduce.go | internal/util/segcore/reduce.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/internal/util/segcore/trace.go | internal/util/segcore/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/internal/util/segcore/cgo_util_test.go | internal/util/segcore/cgo_util_test.go | package segcore
import (
"runtime"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus/pkg/v2/proto/cgopb"
)
func TestConsumeCStatusIntoError(t *testing.T) {
err := ConsumeCStatusIntoError(nil)
assert.NoError(t, err)
}
func TestGetLocalUsedSize(t *t... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/segment.go | internal/util/segcore/segment.go | package segcore
/*
#cgo pkg-config: milvus_core
#include "common/type_c.h"
#include "futures/future_c.h"
#include "segcore/collection_c.h"
#include "segcore/plan_c.h"
#include "segcore/reduce_c.h"
*/
import "C"
import (
"context"
"fmt"
"runtime"
"unsafe"
"github.com/cockroachdb/errors"
"google.golang.org/prot... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/collection.go | internal/util/segcore/collection.go | package segcore
/*
#cgo pkg-config: milvus_core
#include "segcore/collection_c.h"
#include "segcore/segment_c.h"
#include "storage/storage_c.h"
*/
import "C"
import (
"unsafe"
"github.com/cockroachdb/errors"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/sche... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/requests_test.go | internal/util/segcore/requests_test.go | package segcore
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/v2/proto/datapb"
)
func TestLoadFieldDataRequest(t *testing.T) {
req := &LoadFieldDataRequest{
Fields: []LoadFieldDataInfo{{
Field: &datapb.FieldBinlog{
FieldID: 1,
Binlogs: []*datapb.Binlog{
... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/requests.go | internal/util/segcore/requests.go | package segcore
/*
#cgo pkg-config: milvus_core
#include "common/type_c.h"
#include "segcore/load_field_data_c.h"
*/
import "C"
import (
"unsafe"
"github.com/cockroachdb/errors"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus/internal/storage"
"github.com/milvus-io/milvus/i... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/responses.go | internal/util/segcore/responses.go | package segcore
/*
#cgo pkg-config: milvus_core
#include "segcore/plan_c.h"
#include "segcore/reduce_c.h"
*/
import "C"
import (
"github.com/milvus-io/milvus/pkg/v2/proto/segcorepb"
)
type SearchResult struct {
cSearchResult C.CSearchResult
}
func (r *SearchResult) Release() {
C.DeleteSearchResult(r.cSearchResu... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/segcore_init.go | internal/util/segcore/segcore_init.go | package segcore
import (
_ "github.com/milvus-io/milvus/internal/util/cgo"
)
/*
#cgo pkg-config: milvus_core
#include "segcore/segcore_init_c.h"
*/
import "C"
// IndexEngineInfo contains all the information about the index engine.
type IndexEngineInfo struct {
MinIndexVersion int32
CurrentIndexVersion int32... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/cgo_util.go | internal/util/segcore/cgo_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/internal/util/segcore/segment_test.go | internal/util/segcore/segment_test.go | package segcore_test
import (
"context"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/mocks/util/mock_segcore... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/segment_interface.go | internal/util/segcore/segment_interface.go | package segcore
/*
#cgo pkg-config: milvus_core
#include "common/type_c.h"
*/
import "C"
import "context"
// CSegment is the interface of a segcore segment.
// TODO: We should separate the interface of CGrowingSegment and CSealedSegment,
// Because they have different implementations, GrowingSegment will only be u... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/segcore/cgo_util_test_only.go | internal/util/segcore/cgo_util_test_only.go | //go:build test
// +build test
package segcore
/*
#cgo pkg-config: milvus_core
#include "common/protobuf_utils_c.h"
*/
import "C"
import (
"reflect"
"unsafe"
)
func CreateProtoLayout() *C.ProtoLayout {
ptr := C.CreateProtoLayout()
layout := unsafe.Pointer(reflect.ValueOf(ptr).Pointer())
return (*C.ProtoLayout... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/exprutil/expr_checker.go | internal/util/exprutil/expr_checker.go | package exprutil
import (
"math"
"github.com/cockroachdb/errors"
"github.com/samber/lo"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/pkg/v2/proto/planpb"
"github.com/milvus-io/milvus/pkg/v2/util/typeutil"
)
type KeyType int64
const (
PartitionKey KeyType = iota
Clust... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/exprutil/expr_checker_test.go | internal/util/exprutil/expr_checker_test.go | package exprutil
import (
"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/schemapb"
"github.com/milvus-io/milvus/internal/parser/planparserv2"
"github.com/milvus-io/milvus/i... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/initcore/init_core.go | internal/util/initcore/init_core.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/internal/util/initcore/util.go | internal/util/initcore/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/internal/util/initcore/query_node.go | internal/util/initcore/query_node.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/internal/util/initcore/init_core_test.go | internal/util/initcore/init_core_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/internal/util/nullutil/nullutil.go | internal/util/nullutil/nullutil.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/internal/util/quota/quota_constant_test.go | internal/util/quota/quota_constant_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/internal/util/quota/quota_constant.go | internal/util/quota/quota_constant.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/internal/util/fileresource/manager_test.go | internal/util/fileresource/manager_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... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/fileresource/util.go | internal/util/fileresource/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... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/fileresource/manager.go | internal/util/fileresource/manager.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... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/optimizers/query_hook_test.go | internal/util/searchutil/optimizers/query_hook_test.go | package optimizers
import (
"context"
"testing"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus/internal/mocks/util/searchutil/mock_optimizers"
"github.com/milvus-io/milvus/pkg/v2/common"
"github.com/milvus-io/milvus/pkg/v... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/optimizers/query_hook.go | internal/util/searchutil/optimizers/query_hook.go | package optimizers
import (
"context"
"fmt"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
"github.com/milvus-io/milvus/pkg/v2/common"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/metrics"
"github.com/milvus-io/milvus/pkg/v2/proto/planpb"
"github.com/milvus-io/milvus/pk... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/fifo_policy.go | internal/util/searchutil/scheduler/fifo_policy.go | package scheduler
import (
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)
var _ schedulePolicy = &fifoPolicy{}
// newFIFOPolicy create a new fifo schedule policy.
func newFIFOPolicy() schedulePolicy {
return &fifoPolicy{
queue: newMergeTaskQueue(""),
}
}
// fifoPolicy is a fifo policy with merge queue.... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/policy_test.go | internal/util/searchutil/scheduler/policy_test.go | package scheduler
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)
func TestUserTaskPollingPolicy(t *testing.T) {
paramtable.Init()
testCommonPolicyOperation(t, newUserTaskPollingPolicy())
testCrossUserMerge(t, newUserTaskPollingPolicy())
}
... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/concurrent_safe_scheduler_test.go | internal/util/searchutil/scheduler/concurrent_safe_scheduler_test.go | package scheduler
import (
"context"
"fmt"
"math/rand"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"go.uber.org/atomic"
"github.com/milvus-io/milvus/pkg/v2/util/conc"
"github.com/milvus-io/milvus/pkg/v2/util/lifetime"
"github.com/milvus-io/milvus/pkg/v2/util/p... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/queues_test.go | internal/util/searchutil/scheduler/queues_test.go | package scheduler
import (
"fmt"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestMergeTaskQueue(t *testing.T) {
q := newMergeTaskQueue("test_user")
assert.Equal(t, 0, q.len())
assert.Nil(t, q.front())
q.pop()
assert.Nil(t, q.front())
assert.Equal(t, 0, q.len())
assert.False(t, q.expire(5*... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/queues.go | internal/util/searchutil/scheduler/queues.go | package scheduler
import (
"container/ring"
"time"
)
func newMergeTaskQueue(group string) *mergeTaskQueue {
return &mergeTaskQueue{
name: group,
tasks: make([]Task, 0),
cleanupTimestamp: time.Now(),
}
}
type mergeTaskQueue struct {
name string
tasks []Task
c... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/mock_task_test.go | internal/util/searchutil/scheduler/mock_task_test.go | package scheduler
import (
"context"
"math/rand"
"time"
"github.com/milvus-io/milvus/pkg/v2/proto/internalpb"
"github.com/milvus-io/milvus/pkg/v2/util/timerecord"
)
var (
_ Task = &MockTask{}
_ MergeTask = &MockTask{}
)
type mockTaskConfig struct {
ctx context.Context
mergeAble bool
nq ... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/concurrent_safe_scheduler.go | internal/util/searchutil/scheduler/concurrent_safe_scheduler.go | package scheduler
import (
"fmt"
"sync"
"go.uber.org/atomic"
"go.uber.org/zap"
"github.com/milvus-io/milvus/internal/querynodev2/collector"
"github.com/milvus-io/milvus/pkg/v2/log"
"github.com/milvus-io/milvus/pkg/v2/metrics"
"github.com/milvus-io/milvus/pkg/v2/util/conc"
"github.com/milvus-io/milvus/pkg/v2... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/tasks.go | internal/util/searchutil/scheduler/tasks.go | package scheduler
import "github.com/milvus-io/milvus/pkg/v2/proto/internalpb"
const (
schedulePolicyNameFIFO = "fifo"
schedulePolicyNameUserTaskPolling = "user-task-polling"
)
// NewScheduler create a scheduler by policyName.
func NewScheduler(policyName string) Scheduler {
switch policyName {
case "... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/searchutil/scheduler/user_task_polling_policy.go | internal/util/searchutil/scheduler/user_task_polling_policy.go | package scheduler
import (
"fmt"
"time"
"github.com/milvus-io/milvus/pkg/v2/util/merr"
"github.com/milvus-io/milvus/pkg/v2/util/paramtable"
)
var _ schedulePolicy = &userTaskPollingPolicy{}
// newUserTaskPollingPolicy create a new user task polling schedule policy.
func newUserTaskPollingPolicy() *userTaskPolli... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/mock/grpcclient.go | internal/util/mock/grpcclient.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/internal/util/mock/grpc_rootcoord_client.go | internal/util/mock/grpc_rootcoord_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/internal/util/mock/grpc_datanode_client.go | internal/util/mock/grpc_datanode_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/internal/util/mock/health_watch_server.go | internal/util/mock/health_watch_server.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/internal/util/mock/grpc_querycoord_client.go | internal/util/mock/grpc_querycoord_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/internal/util/mock/grpc_querynode_client.go | internal/util/mock/grpc_querynode_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/internal/util/importutilv2/mock_reader.go | internal/util/importutilv2/mock_reader.go | // Code generated by mockery v2.30.1. DO NOT EDIT.
package importutilv2
import (
storage "github.com/milvus-io/milvus/internal/storage"
mock "github.com/stretchr/testify/mock"
)
// MockReader is an autogenerated mock type for the Reader type
type MockReader struct {
mock.Mock
}
type MockReader_Expecter struct {
... | go | Apache-2.0 | 9d9fe2273adea818132bd2c5b9710bdecc8c8a85 | 2026-01-07T08:35:46.736408Z | false |
milvus-io/milvus | https://github.com/milvus-io/milvus/blob/9d9fe2273adea818132bd2c5b9710bdecc8c8a85/internal/util/importutilv2/option.go | internal/util/importutilv2/option.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/internal/util/importutilv2/reader.go | internal/util/importutilv2/reader.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/internal/util/importutilv2/util.go | internal/util/importutilv2/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/internal/util/importutilv2/option_test.go | internal/util/importutilv2/option_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/internal/util/importutilv2/reader_test.go | internal/util/importutilv2/reader_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.