@@ -141,7 +141,7 @@ MilvusClientImpl::LoadCollection(const std::string& collection_name, int replica
141
141
};
142
142
143
143
auto wait_for_status = [this , &collection_name, &progress_monitor](const proto::common::Status&) {
144
- return waitForStatus (
144
+ return WaitForStatus (
145
145
[&collection_name, this ](Progress& progress) -> Status {
146
146
CollectionsInfo collections_info;
147
147
auto collection_names = std::vector<std::string>{collection_name};
@@ -259,7 +259,7 @@ MilvusClientImpl::ShowCollections(const std::vector<std::string>& collection_nam
259
259
};
260
260
261
261
auto post = [&collections_info](const proto::milvus::ShowCollectionsResponse& response) {
262
- for (size_t i = 0 ; i < response.collection_ids_size (); i++) {
262
+ for (int i = 0 ; i < response.collection_ids_size (); i++) {
263
263
auto inmemory_percentage = 0 ;
264
264
if (response.inmemory_percentages_size () > i) {
265
265
inmemory_percentage = response.inmemory_percentages (i);
@@ -331,7 +331,7 @@ MilvusClientImpl::LoadPartitions(const std::string& collection_name, const std::
331
331
};
332
332
333
333
auto wait_for_status = [this , &collection_name, &partition_names, &progress_monitor](const proto::common::Status&) {
334
- return waitForStatus (
334
+ return WaitForStatus (
335
335
[&collection_name, &partition_names, this ](Progress& progress) -> Status {
336
336
PartitionsInfo partitions_info;
337
337
auto status = ShowPartitions (collection_name, partition_names, partitions_info);
@@ -422,7 +422,7 @@ MilvusClientImpl::ShowPartitions(const std::string& collection_name, const std::
422
422
if (count > 0 ) {
423
423
partitions_info.reserve (count);
424
424
}
425
- for (size_t i = 0 ; i < count; ++i) {
425
+ for (int i = 0 ; i < count; ++i) {
426
426
partitions_info.emplace_back (response.partition_names (i), response.partitionids (i),
427
427
response.created_timestamps (i), response.inmemory_percentages (i));
428
428
}
@@ -499,7 +499,7 @@ MilvusClientImpl::CreateIndex(const std::string& collection_name, const IndexDes
499
499
};
500
500
501
501
auto wait_for_status = [&collection_name, &index_desc, &progress_monitor, this ](const proto::common::Status&) {
502
- return waitForStatus (
502
+ return WaitForStatus (
503
503
[&collection_name, &index_desc, this ](Progress& progress) -> Status {
504
504
IndexState index_state;
505
505
auto status = GetIndexState (collection_name, index_desc.FieldName (), index_state);
@@ -539,13 +539,13 @@ MilvusClientImpl::DescribeIndex(const std::string& collection_name, const std::s
539
539
540
540
auto post = [&index_desc](const proto::milvus::DescribeIndexResponse& response) {
541
541
auto count = response.index_descriptions_size ();
542
- for (size_t i = 0 ; i < count; ++i) {
542
+ for (int i = 0 ; i < count; ++i) {
543
543
auto & field_name = response.index_descriptions (i).field_name ();
544
544
auto & index_name = response.index_descriptions (i).index_name ();
545
545
index_desc.SetFieldName (field_name);
546
546
index_desc.SetIndexName (index_name);
547
547
auto index_params_size = response.index_descriptions (i).params_size ();
548
- for (size_t j = 0 ; j < index_params_size; ++j) {
548
+ for (int j = 0 ; j < index_params_size; ++j) {
549
549
const auto & key = response.index_descriptions (i).params (j).key ();
550
550
const auto & value = response.index_descriptions (i).params (j).value ();
551
551
if (key == milvus::KeyIndexType ()) {
@@ -759,19 +759,20 @@ MilvusClientImpl::Search(const SearchArguments& arguments, SearchResults& result
759
759
const auto & scores = result_data.scores ();
760
760
const auto & fields_data = result_data.fields_data ();
761
761
auto num_of_queries = result_data.num_queries ();
762
- std::vector<int64_t > topks (num_of_queries, result_data.top_k ());
762
+ std::vector<int > topks{};
763
+ topks.reserve (result_data.topks_size ());
763
764
for (int i = 0 ; i < result_data.topks_size (); ++i) {
764
- topks[i] = result_data.topks (i);
765
+ topks. emplace_back ( result_data.topks (i) );
765
766
}
766
767
std::vector<SingleResult> single_results;
767
768
single_results.reserve (num_of_queries);
768
- size_t offset{0 };
769
- for (int64_t i = 0 ; i < num_of_queries; ++i) {
769
+ int offset{0 };
770
+ for (int i = 0 ; i < num_of_queries; ++i) {
770
771
std::vector<float > item_scores;
771
772
std::vector<FieldDataPtr> item_field_data;
772
773
auto item_topk = topks[i];
773
774
item_scores.reserve (item_topk);
774
- for (int64_t j = 0 ; j < item_topk; ++j) {
775
+ for (int j = 0 ; j < item_topk; ++j) {
775
776
item_scores.emplace_back (scores.at (offset + j));
776
777
}
777
778
item_field_data.reserve (fields_data.size ());
@@ -842,7 +843,7 @@ MilvusClientImpl::CalcDistance(const CalcDistanceArguments& arguments, DistanceA
842
843
}
843
844
844
845
// suppose vectors is not empty, already checked by Validate()
845
- data_array->set_dim (vectors[0 ].size ());
846
+ data_array->set_dim (static_cast < int >( vectors[0 ].size () ));
846
847
} else {
847
848
auto data_ptr = std::static_pointer_cast<BinaryVecFieldData>(arg_vectors);
848
849
auto & str = *data_array->mutable_binary_vector ();
@@ -853,7 +854,7 @@ MilvusClientImpl::CalcDistance(const CalcDistanceArguments& arguments, DistanceA
853
854
for (auto & vector : vectors) {
854
855
str.append (vector);
855
856
}
856
- data_array->set_dim (dimensions);
857
+ data_array->set_dim (static_cast < int >( dimensions) );
857
858
}
858
859
859
860
} else if (arg_vectors->Type () == DataType::INT64) {
@@ -960,7 +961,7 @@ MilvusClientImpl::Flush(const std::vector<std::string>& collection_names, const
960
961
return Status::OK ();
961
962
}
962
963
963
- return waitForStatus (
964
+ return WaitForStatus (
964
965
[&segment_count, &flush_segments, &finished_count, this ](Progress& p) -> Status {
965
966
p.total_ = segment_count;
966
967
@@ -1117,7 +1118,7 @@ MilvusClientImpl::ManualCompaction(const std::string& collection_name, uint64_t
1117
1118
return status;
1118
1119
}
1119
1120
1120
- auto pre = [&collection_name, & travel_timestamp, &collection_desc]() {
1121
+ auto pre = [&travel_timestamp, &collection_desc]() {
1121
1122
proto::milvus::ManualCompactionRequest rpc_request;
1122
1123
rpc_request.set_collectionid (collection_desc.ID ());
1123
1124
rpc_request.set_timetravel (travel_timestamp);
@@ -1223,7 +1224,7 @@ MilvusClientImpl::ListCredUsers(std::vector<std::string>& users) {
1223
1224
}
1224
1225
1225
1226
Status
1226
- MilvusClientImpl::waitForStatus ( std::function<Status(Progress&)> query_function,
1227
+ MilvusClientImpl::WaitForStatus ( const std::function<Status(Progress&)>& query_function,
1227
1228
const ProgressMonitor& progress_monitor) {
1228
1229
// no need to check
1229
1230
if (progress_monitor.CheckTimeout () == 0 ) {
0 commit comments