Skip to content

Commit

Permalink
enhance: [2.4] Move collection meta check to server side (#835)
Browse files Browse the repository at this point in the history
Move collection/partition validation logic to server side in case of
frequent check rpc.

---------

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Oct 23, 2024
1 parent bc438db commit 54663ca
Show file tree
Hide file tree
Showing 20 changed files with 974 additions and 887 deletions.
30 changes: 0 additions & 30 deletions client/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,6 @@ func (c *GrpcClient) DropCollection(ctx context.Context, collName string, opts .
if c.Service == nil {
return ErrClientNotReady
}
if err := c.checkCollectionExists(ctx, collName); err != nil {
return err
}

req := &milvuspb.DropCollectionRequest{
CollectionName: collName,
Expand Down Expand Up @@ -350,10 +347,6 @@ func (c *GrpcClient) GetCollectionStatistics(ctx context.Context, collName strin
return nil, ErrClientNotReady
}

if err := c.checkCollectionExists(ctx, collName); err != nil {
return nil, err
}

req := &milvuspb.GetCollectionStatisticsRequest{
CollectionName: collName,
}
Expand All @@ -372,9 +365,6 @@ func (c *GrpcClient) ShowCollection(ctx context.Context, collName string) (*enti
if c.Service == nil {
return nil, ErrClientNotReady
}
if err := c.checkCollectionExists(ctx, collName); err != nil {
return nil, err
}

req := &milvuspb.ShowCollectionsRequest{
Type: milvuspb.ShowType_InMemory,
Expand Down Expand Up @@ -404,10 +394,6 @@ func (c *GrpcClient) RenameCollection(ctx context.Context, collName, newName str
return ErrClientNotReady
}

if err := c.checkCollectionExists(ctx, collName); err != nil {
return err
}

req := &milvuspb.RenameCollectionRequest{
OldName: collName,
NewName: newName,
Expand All @@ -425,10 +411,6 @@ func (c *GrpcClient) LoadCollection(ctx context.Context, collName string, async
return ErrClientNotReady
}

if err := c.checkCollectionExists(ctx, collName); err != nil {
return err
}

req := &milvuspb.LoadCollectionRequest{
CollectionName: collName,
}
Expand Down Expand Up @@ -471,9 +453,6 @@ func (c *GrpcClient) ReleaseCollection(ctx context.Context, collName string, opt
if c.Service == nil {
return ErrClientNotReady
}
if err := c.checkCollectionExists(ctx, collName); err != nil {
return err
}

req := &milvuspb.ReleaseCollectionRequest{
DbName: "", // reserved
Expand Down Expand Up @@ -537,9 +516,6 @@ func (c *GrpcClient) GetLoadingProgress(ctx context.Context, collName string, pa
if c.Service == nil {
return 0, ErrClientNotReady
}
if err := c.checkCollectionExists(ctx, collName); err != nil {
return 0, err
}

req := &milvuspb.GetLoadingProgressRequest{
CollectionName: collName,
Expand All @@ -558,9 +534,6 @@ func (c *GrpcClient) GetLoadState(ctx context.Context, collName string, partitio
if c.Service == nil {
return 0, ErrClientNotReady
}
if err := c.checkCollectionExists(ctx, collName); err != nil {
return 0, err
}

req := &milvuspb.GetLoadStateRequest{
CollectionName: collName,
Expand All @@ -579,9 +552,6 @@ func (c *GrpcClient) AlterCollection(ctx context.Context, collName string, attrs
if c.Service == nil {
return ErrClientNotReady
}
if err := c.checkCollectionExists(ctx, collName); err != nil {
return err
}

if len(attrs) == 0 {
return errors.New("no collection attribute provided")
Expand Down
Loading

0 comments on commit 54663ca

Please sign in to comment.