Skip to content

Commit 418fdcc

Browse files
committed
MilvusClientV2 for clean/expandable interfaces
Signed-off-by: yhmo <[email protected]>
1 parent fe2a0fb commit 418fdcc

File tree

207 files changed

+13897
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+13897
-29
lines changed

src/impl/MilvusClientImpl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,7 @@ MilvusClientImpl::GetCompactionState(int64_t compaction_id, CompactionState& com
15831583
compaction_state.SetExecutingPlan(response.executingplanno());
15841584
compaction_state.SetTimeoutPlan(response.timeoutplanno());
15851585
compaction_state.SetCompletedPlan(response.completedplanno());
1586+
compaction_state.SetFailedPlan(response.failedplanno());
15861587
switch (response.state()) {
15871588
case proto::common::CompactionState::Completed:
15881589
compaction_state.SetState(CompactionStateCode::COMPLETED);
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Licensed to the LF AI & Data foundation under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
#include "milvus/request/alias/AlterAliasRequest.h"
18+
19+
namespace milvus {
20+
21+
const std::string&
22+
AlterAliasRequest::DatabaseName() const {
23+
return db_name_;
24+
}
25+
26+
void
27+
AlterAliasRequest::SetDatabaseName(const std::string& db_name) {
28+
db_name_ = db_name;
29+
}
30+
31+
AlterAliasRequest&
32+
AlterAliasRequest::WithDatabaseName(const std::string& db_name) {
33+
SetDatabaseName(db_name);
34+
return *this;
35+
}
36+
37+
const std::string&
38+
AlterAliasRequest::CollectionName() const {
39+
return collection_name_;
40+
}
41+
42+
void
43+
AlterAliasRequest::SetCollectionName(const std::string& collection_name) {
44+
collection_name_ = collection_name;
45+
}
46+
47+
AlterAliasRequest&
48+
AlterAliasRequest::WithCollectionName(const std::string& collection_name) {
49+
SetCollectionName(collection_name);
50+
return *this;
51+
}
52+
53+
const std::string&
54+
AlterAliasRequest::Alias() const {
55+
return alias_;
56+
}
57+
58+
void
59+
AlterAliasRequest::SetAlias(const std::string& alias) {
60+
alias_ = alias;
61+
}
62+
63+
AlterAliasRequest&
64+
AlterAliasRequest::WithAlias(const std::string& alias) {
65+
SetAlias(alias);
66+
return *this;
67+
}
68+
69+
} // namespace milvus
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Licensed to the LF AI & Data foundation under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
#include "milvus/request/alias/CreateAliasRequest.h"
18+
19+
namespace milvus {
20+
21+
const std::string&
22+
CreateAliasRequest::DatabaseName() const {
23+
return db_name_;
24+
}
25+
26+
void
27+
CreateAliasRequest::SetDatabaseName(const std::string& db_name) {
28+
db_name_ = db_name;
29+
}
30+
31+
CreateAliasRequest&
32+
CreateAliasRequest::WithDatabaseName(const std::string& db_name) {
33+
SetDatabaseName(db_name);
34+
return *this;
35+
}
36+
37+
const std::string&
38+
CreateAliasRequest::CollectionName() const {
39+
return collection_name_;
40+
}
41+
42+
void
43+
CreateAliasRequest::SetCollectionName(const std::string& collection_name) {
44+
collection_name_ = collection_name;
45+
}
46+
47+
CreateAliasRequest&
48+
CreateAliasRequest::WithCollectionName(const std::string& collection_name) {
49+
SetCollectionName(collection_name);
50+
return *this;
51+
}
52+
53+
const std::string&
54+
CreateAliasRequest::Alias() const {
55+
return alias_;
56+
}
57+
58+
void
59+
CreateAliasRequest::SetAlias(const std::string& alias) {
60+
alias_ = alias;
61+
}
62+
63+
CreateAliasRequest&
64+
CreateAliasRequest::WithAlias(const std::string& alias) {
65+
SetAlias(alias);
66+
return *this;
67+
}
68+
69+
} // namespace milvus
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Licensed to the LF AI & Data foundation under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
#include "milvus/request/alias/DescribeAliasRequest.h"
18+
19+
namespace milvus {
20+
21+
const std::string&
22+
DescribeAliasRequest::DatabaseName() const {
23+
return db_name_;
24+
}
25+
26+
void
27+
DescribeAliasRequest::SetDatabaseName(const std::string& db_name) {
28+
db_name_ = db_name;
29+
}
30+
31+
DescribeAliasRequest&
32+
DescribeAliasRequest::WithDatabaseName(const std::string& db_name) {
33+
SetDatabaseName(db_name);
34+
return *this;
35+
}
36+
37+
const std::string&
38+
DescribeAliasRequest::Alias() const {
39+
return alias_;
40+
}
41+
42+
void
43+
DescribeAliasRequest::SetAlias(const std::string& alias) {
44+
alias_ = alias;
45+
}
46+
47+
DescribeAliasRequest&
48+
DescribeAliasRequest::WithAlias(const std::string& alias) {
49+
SetAlias(alias);
50+
return *this;
51+
}
52+
53+
} // namespace milvus
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Licensed to the LF AI & Data foundation under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
#include "milvus/request/alias/DropAliasRequest.h"
18+
19+
namespace milvus {
20+
21+
const std::string&
22+
DropAliasRequest::DatabaseName() const {
23+
return db_name_;
24+
}
25+
26+
void
27+
DropAliasRequest::SetDatabaseName(const std::string& db_name) {
28+
db_name_ = db_name;
29+
}
30+
31+
DropAliasRequest&
32+
DropAliasRequest::WithDatabaseName(const std::string& db_name) {
33+
SetDatabaseName(db_name);
34+
return *this;
35+
}
36+
37+
const std::string&
38+
DropAliasRequest::Alias() const {
39+
return alias_;
40+
}
41+
42+
void
43+
DropAliasRequest::SetAlias(const std::string& alias) {
44+
alias_ = alias;
45+
}
46+
47+
DropAliasRequest&
48+
DropAliasRequest::WithAlias(const std::string& alias) {
49+
SetAlias(alias);
50+
return *this;
51+
}
52+
53+
} // namespace milvus
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Licensed to the LF AI & Data foundation under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
#include "milvus/request/alias/ListAliasesRequest.h"
18+
19+
namespace milvus {
20+
21+
// Constructor is default, so no implementation needed.
22+
23+
// Returns the database name
24+
const std::string&
25+
ListAliasesRequest::DatabaseName() const {
26+
return db_name_;
27+
}
28+
29+
// Sets the database name
30+
void
31+
ListAliasesRequest::SetDatabaseName(const std::string& db_name) {
32+
db_name_ = db_name;
33+
}
34+
35+
// Fluent-style setter for the database name
36+
ListAliasesRequest&
37+
ListAliasesRequest::WithDatabaseName(const std::string& db_name) {
38+
db_name_ = db_name;
39+
return *this;
40+
}
41+
42+
// Returns the collection name
43+
const std::string&
44+
ListAliasesRequest::CollectionName() const {
45+
return collection_name_;
46+
}
47+
48+
// Sets the collection name
49+
void
50+
ListAliasesRequest::SetCollectionName(const std::string& collection_name) {
51+
collection_name_ = collection_name;
52+
}
53+
54+
// Fluent-style setter for the collection name
55+
ListAliasesRequest&
56+
ListAliasesRequest::WithCollectionName(const std::string& collection_name) {
57+
collection_name_ = collection_name;
58+
return *this;
59+
}
60+
61+
} // namespace milvus
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Licensed to the LF AI & Data foundation under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
#include "milvus/request/collection/AlterCollectionFieldPropertiesRequest.h"
18+
19+
#include <memory>
20+
21+
namespace milvus {
22+
23+
AlterCollectionFieldPropertiesRequest&
24+
AlterCollectionFieldPropertiesRequest::WithDatabaseName(const std::string& db_name) {
25+
SetDatabaseName(db_name);
26+
return *this;
27+
}
28+
29+
AlterCollectionFieldPropertiesRequest&
30+
AlterCollectionFieldPropertiesRequest::WithCollectionName(const std::string& collection_name) {
31+
SetCollectionName(collection_name);
32+
return *this;
33+
}
34+
35+
const std::string&
36+
AlterCollectionFieldPropertiesRequest::FieldName() const {
37+
return field_name_;
38+
}
39+
40+
void
41+
AlterCollectionFieldPropertiesRequest::SetFieldName(const std::string& field_name) {
42+
field_name_ = field_name;
43+
}
44+
45+
AlterCollectionFieldPropertiesRequest&
46+
AlterCollectionFieldPropertiesRequest::WithFieldName(const std::string& field_name) {
47+
SetFieldName(field_name);
48+
return *this;
49+
}
50+
51+
const std::unordered_map<std::string, std::string>&
52+
AlterCollectionFieldPropertiesRequest::Properties() const {
53+
return properties_;
54+
}
55+
56+
void
57+
AlterCollectionFieldPropertiesRequest::SetProperties(std::unordered_map<std::string, std::string>&& properties) {
58+
properties_ = std::move(properties);
59+
}
60+
61+
AlterCollectionFieldPropertiesRequest&
62+
AlterCollectionFieldPropertiesRequest::WithProperties(std::unordered_map<std::string, std::string>&& properties) {
63+
SetProperties(std::move(properties));
64+
return *this;
65+
}
66+
67+
} // namespace milvus

0 commit comments

Comments
 (0)