enhance: remove resource type from file resource config (#45103)

File resource type was useless till now, remove it before new release.
relate: https://github.com/milvus-io/milvus/issues/43687

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
aoiasd 2025-11-03 10:15:32 +08:00 committed by GitHub
parent 00d8d2c33d
commit ed69375f00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 906 additions and 752 deletions

2
go.mod
View File

@ -21,7 +21,7 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/klauspost/compress v1.17.9
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.4-0.20251013093953-f3e0a710c654
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.5-0.20251027081602-a82e5bb087cc
github.com/minio/minio-go/v7 v7.0.73
github.com/panjf2000/ants/v2 v2.11.3 // indirect
github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81 // indirect

2
go.sum
View File

@ -796,6 +796,8 @@ github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZz
github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.4-0.20251013093953-f3e0a710c654 h1:p604i9izeR8eWrQhOFmcmxhNhYlsvTkkmph4b2GbOeg=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.4-0.20251013093953-f3e0a710c654/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.5-0.20251027081602-a82e5bb087cc h1:0OmsEPmSXgaKoNWbX69uxiLqnNxATT7kdpbjPzmlULw=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.5-0.20251027081602-a82e5bb087cc/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs=
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs=
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY=
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI=

View File

@ -2040,7 +2040,6 @@ func (s *Server) AddFileResource(ctx context.Context, req *milvuspb.AddFileResou
ID: id,
Name: req.GetName(),
Path: req.GetPath(),
Type: req.GetType(),
}
err = s.meta.AddFileResource(ctx, resource)

View File

@ -1789,7 +1789,6 @@ func TestServer_AddFileResource(t *testing.T) {
Base: &commonpb.MsgBase{},
Name: "test_resource",
Path: "/path/to/resource",
Type: commonpb.FileResourceType_ANALYZER_DICTIONARY,
}
mockCatalog.EXPECT().SaveFileResource(mock.Anything, mock.MatchedBy(func(resource *model.FileResource) bool {
@ -1874,7 +1873,6 @@ func TestServer_AddFileResource(t *testing.T) {
ID: 1,
Name: "test_resource",
Path: "/existing/path",
Type: commonpb.FileResourceType_ANALYZER_DICTIONARY,
}
server := &Server{
@ -1908,7 +1906,6 @@ func TestServer_RemoveFileResource(t *testing.T) {
ID: 1,
Name: "test_resource",
Path: "/path/to/resource",
Type: commonpb.FileResourceType_ANALYZER_DICTIONARY,
}
server := &Server{
@ -1973,7 +1970,6 @@ func TestServer_RemoveFileResource(t *testing.T) {
ID: 1,
Name: "test_resource",
Path: "/path/to/resource",
Type: commonpb.FileResourceType_ANALYZER_DICTIONARY,
}
server := &Server{
@ -2028,13 +2024,11 @@ func TestServer_ListFileResources(t *testing.T) {
ID: 1,
Name: "resource1",
Path: "/path/to/resource1",
Type: commonpb.FileResourceType_ANALYZER_DICTIONARY,
}
resource2 := &model.FileResource{
ID: 2,
Name: "resource2",
Path: "/path/to/resource2",
Type: commonpb.FileResourceType_ANALYZER_DICTIONARY,
}
server := &Server{

View File

@ -267,7 +267,7 @@ func (node *DataNode) CompactionV2(ctx context.Context, req *datapb.CompactionPl
[]int64{partitionkey.GetFieldID(), pk.GetFieldID()},
)
case datapb.CompactionType_ClusteringPartitionKeySortCompaction:
//TODO
// TODO
default:
log.Warn("Unknown compaction type", zap.String("type", req.GetType().String()))
return merr.Status(merr.WrapErrParameterInvalidMsg("Unknown compaction type: %v", req.GetType().String())), nil

View File

@ -1,7 +1,6 @@
package model
import (
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
pb "github.com/milvus-io/milvus/pkg/v2/proto/datapb"
)
@ -9,7 +8,6 @@ type FileResource struct {
ID int64
Name string
Path string
Type commonpb.FileResourceType
}
func (resource *FileResource) Marshal() *pb.FileResourceInfo {
@ -21,7 +19,6 @@ func (resource *FileResource) Marshal() *pb.FileResourceInfo {
ResourceId: resource.ID,
Name: resource.Name,
Path: resource.Path,
Type: resource.Type,
}
}
@ -34,6 +31,5 @@ func UnmarshalFileResourceInfo(resource *pb.FileResourceInfo) *FileResource {
ID: resource.ResourceId,
Name: resource.Name,
Path: resource.Path,
Type: resource.Type,
}
}

View File

@ -92,6 +92,65 @@ func (_c *MockProxy_AddCollectionField_Call) RunAndReturn(run func(context.Conte
return _c
}
// AddCollectionFunction provides a mock function with given fields: _a0, _a1
func (_m *MockProxy) AddCollectionFunction(_a0 context.Context, _a1 *milvuspb.AddCollectionFunctionRequest) (*commonpb.Status, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for AddCollectionFunction")
}
var r0 *commonpb.Status
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AddCollectionFunctionRequest) (*commonpb.Status, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AddCollectionFunctionRequest) *commonpb.Status); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*commonpb.Status)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.AddCollectionFunctionRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockProxy_AddCollectionFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddCollectionFunction'
type MockProxy_AddCollectionFunction_Call struct {
*mock.Call
}
// AddCollectionFunction is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *milvuspb.AddCollectionFunctionRequest
func (_e *MockProxy_Expecter) AddCollectionFunction(_a0 interface{}, _a1 interface{}) *MockProxy_AddCollectionFunction_Call {
return &MockProxy_AddCollectionFunction_Call{Call: _e.mock.On("AddCollectionFunction", _a0, _a1)}
}
func (_c *MockProxy_AddCollectionFunction_Call) Run(run func(_a0 context.Context, _a1 *milvuspb.AddCollectionFunctionRequest)) *MockProxy_AddCollectionFunction_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*milvuspb.AddCollectionFunctionRequest))
})
return _c
}
func (_c *MockProxy_AddCollectionFunction_Call) Return(_a0 *commonpb.Status, _a1 error) *MockProxy_AddCollectionFunction_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockProxy_AddCollectionFunction_Call) RunAndReturn(run func(context.Context, *milvuspb.AddCollectionFunctionRequest) (*commonpb.Status, error)) *MockProxy_AddCollectionFunction_Call {
_c.Call.Return(run)
return _c
}
// AddFileResource provides a mock function with given fields: _a0, _a1
func (_m *MockProxy) AddFileResource(_a0 context.Context, _a1 *milvuspb.AddFileResourceRequest) (*commonpb.Status, error) {
ret := _m.Called(_a0, _a1)
@ -446,6 +505,65 @@ func (_c *MockProxy_AlterCollectionField_Call) RunAndReturn(run func(context.Con
return _c
}
// AlterCollectionFunction provides a mock function with given fields: _a0, _a1
func (_m *MockProxy) AlterCollectionFunction(_a0 context.Context, _a1 *milvuspb.AlterCollectionFunctionRequest) (*commonpb.Status, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for AlterCollectionFunction")
}
var r0 *commonpb.Status
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AlterCollectionFunctionRequest) (*commonpb.Status, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.AlterCollectionFunctionRequest) *commonpb.Status); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*commonpb.Status)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.AlterCollectionFunctionRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockProxy_AlterCollectionFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AlterCollectionFunction'
type MockProxy_AlterCollectionFunction_Call struct {
*mock.Call
}
// AlterCollectionFunction is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *milvuspb.AlterCollectionFunctionRequest
func (_e *MockProxy_Expecter) AlterCollectionFunction(_a0 interface{}, _a1 interface{}) *MockProxy_AlterCollectionFunction_Call {
return &MockProxy_AlterCollectionFunction_Call{Call: _e.mock.On("AlterCollectionFunction", _a0, _a1)}
}
func (_c *MockProxy_AlterCollectionFunction_Call) Run(run func(_a0 context.Context, _a1 *milvuspb.AlterCollectionFunctionRequest)) *MockProxy_AlterCollectionFunction_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*milvuspb.AlterCollectionFunctionRequest))
})
return _c
}
func (_c *MockProxy_AlterCollectionFunction_Call) Return(_a0 *commonpb.Status, _a1 error) *MockProxy_AlterCollectionFunction_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockProxy_AlterCollectionFunction_Call) RunAndReturn(run func(context.Context, *milvuspb.AlterCollectionFunctionRequest) (*commonpb.Status, error)) *MockProxy_AlterCollectionFunction_Call {
_c.Call.Return(run)
return _c
}
// AlterDatabase provides a mock function with given fields: _a0, _a1
func (_m *MockProxy) AlterDatabase(_a0 context.Context, _a1 *milvuspb.AlterDatabaseRequest) (*commonpb.Status, error) {
ret := _m.Called(_a0, _a1)
@ -2144,6 +2262,65 @@ func (_c *MockProxy_DropCollection_Call) RunAndReturn(run func(context.Context,
return _c
}
// DropCollectionFunction provides a mock function with given fields: _a0, _a1
func (_m *MockProxy) DropCollectionFunction(_a0 context.Context, _a1 *milvuspb.DropCollectionFunctionRequest) (*commonpb.Status, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for DropCollectionFunction")
}
var r0 *commonpb.Status
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropCollectionFunctionRequest) (*commonpb.Status, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.DropCollectionFunctionRequest) *commonpb.Status); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*commonpb.Status)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.DropCollectionFunctionRequest) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockProxy_DropCollectionFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropCollectionFunction'
type MockProxy_DropCollectionFunction_Call struct {
*mock.Call
}
// DropCollectionFunction is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 *milvuspb.DropCollectionFunctionRequest
func (_e *MockProxy_Expecter) DropCollectionFunction(_a0 interface{}, _a1 interface{}) *MockProxy_DropCollectionFunction_Call {
return &MockProxy_DropCollectionFunction_Call{Call: _e.mock.On("DropCollectionFunction", _a0, _a1)}
}
func (_c *MockProxy_DropCollectionFunction_Call) Run(run func(_a0 context.Context, _a1 *milvuspb.DropCollectionFunctionRequest)) *MockProxy_DropCollectionFunction_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*milvuspb.DropCollectionFunctionRequest))
})
return _c
}
func (_c *MockProxy_DropCollectionFunction_Call) Return(_a0 *commonpb.Status, _a1 error) *MockProxy_DropCollectionFunction_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockProxy_DropCollectionFunction_Call) RunAndReturn(run func(context.Context, *milvuspb.DropCollectionFunctionRequest) (*commonpb.Status, error)) *MockProxy_DropCollectionFunction_Call {
_c.Call.Return(run)
return _c
}
// DropDatabase provides a mock function with given fields: _a0, _a1
func (_m *MockProxy) DropDatabase(_a0 context.Context, _a1 *milvuspb.DropDatabaseRequest) (*commonpb.Status, error) {
ret := _m.Called(_a0, _a1)

View File

@ -1829,7 +1829,6 @@ func TestProxy_AddFileResource(t *testing.T) {
Base: &commonpb.MsgBase{},
Name: "test_resource",
Path: "/path/to/resource",
Type: commonpb.FileResourceType_ANALYZER_DICTIONARY,
}
resp, err := proxy.AddFileResource(context.Background(), req)

View File

@ -21,7 +21,7 @@ require (
github.com/jolestar/go-commons-pool/v2 v2.1.2
github.com/json-iterator/go v1.1.12
github.com/klauspost/compress v1.17.9
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.4-0.20251013093953-f3e0a710c654
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.5-0.20251027081602-a82e5bb087cc
github.com/minio/minio-go/v7 v7.0.73
github.com/panjf2000/ants/v2 v2.11.3
github.com/prometheus/client_golang v1.20.5

View File

@ -607,6 +607,8 @@ github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZz
github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.4-0.20251013093953-f3e0a710c654 h1:p604i9izeR8eWrQhOFmcmxhNhYlsvTkkmph4b2GbOeg=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.4-0.20251013093953-f3e0a710c654/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.5-0.20251027081602-a82e5bb087cc h1:0OmsEPmSXgaKoNWbX69uxiLqnNxATT7kdpbjPzmlULw=
github.com/milvus-io/milvus-proto/go-api/v2 v2.6.5-0.20251027081602-a82e5bb087cc/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.73 h1:qr2vi96Qm7kZ4v7LLebjte+MQh621fFWnv93p12htEo=

View File

@ -1134,5 +1134,4 @@ message FileResourceInfo {
string name = 1;
string path = 2;
int64 resource_id = 3;
common.FileResourceType type = 4;
}

File diff suppressed because it is too large Load Diff