mirror of https://github.com/milvus-io/milvus.git
parent
238967826c
commit
adc6dc38bf
|
@ -11,6 +11,4 @@ We use GitHub for tracking bugs and feature requests. If you need any support fo
|
|||
[Slack](https://join.slack.com/t/milvusio/shared_invite/enQtNzY1OTQ0NDI3NjMzLWNmYmM1NmNjOTQ5MGI5NDhhYmRhMGU5M2NhNzhhMDMzY2MzNDdlYjM5ODQ5MmE3ODFlYzU3YjJkNmVlNDQ2ZTk): The #general channel is the place where people offer support.
|
||||
|
||||
## Other
|
||||
|
||||
|
||||
[Bootcamp](https://github.com/milvus-io/bootcamp): It provides more scenario-based applications and demos of Milvus.
|
||||
|
|
|
@ -3,9 +3,6 @@ coverage:
|
|||
notify:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
|
||||
|
||||
|
||||
precision: 2
|
||||
round: down
|
||||
range: "70...100"
|
||||
|
|
|
@ -17,45 +17,6 @@ namespace milvus {
|
|||
namespace server {
|
||||
namespace web {
|
||||
|
||||
Status
|
||||
CopyRowRecords(const OList<OList<OFloat32>::ObjectWrapper>::ObjectWrapper& records, std::vector<float>& vectors) {
|
||||
size_t tal_size = 0;
|
||||
records->forEach([&tal_size](const OList<OFloat32>::ObjectWrapper& row_item) { tal_size += row_item->count(); });
|
||||
|
||||
vectors.resize(tal_size);
|
||||
size_t index_offset = 0;
|
||||
records->forEach([&vectors, &index_offset](const OList<OFloat32>::ObjectWrapper& row_item) {
|
||||
row_item->forEach(
|
||||
[&vectors, &index_offset](const OFloat32& item) { vectors[index_offset++] = item->getValue(); });
|
||||
});
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status
|
||||
CopyBinRowRecords(const OList<OList<OInt64>::ObjectWrapper>::ObjectWrapper& records, std::vector<uint8_t>& vectors) {
|
||||
size_t tal_size = 0;
|
||||
records->forEach([&tal_size](const OList<OInt64>::ObjectWrapper& item) { tal_size += item->count(); });
|
||||
|
||||
vectors.resize(tal_size);
|
||||
size_t index_offset = 0;
|
||||
bool oor = false;
|
||||
records->forEach([&vectors, &index_offset, &oor](const OList<OInt64>::ObjectWrapper& row_item) {
|
||||
row_item->forEach([&vectors, &index_offset, &oor](const OInt64& item) {
|
||||
if (!oor) {
|
||||
int64_t value = item->getValue();
|
||||
if (0 > value || value > 255) {
|
||||
oor = true;
|
||||
} else {
|
||||
vectors[index_offset++] = static_cast<uint8_t>(value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status
|
||||
ParseQueryInteger(const OQueryParams& query_params, const std::string& key, int64_t& value, bool nullable) {
|
||||
auto query = query_params.get(key.c_str());
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
// Copyright (C) 2019-2020 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 law or agreed to in writing, software distributed under the License
|
||||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "db/Types.h"
|
||||
#include "server/web_impl/Types.h"
|
||||
#include "utils/Status.h"
|
||||
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
namespace web {
|
||||
|
||||
Status
|
||||
ParseQueryInteger(const OQueryParams& query_params, const std::string& key, int64_t& value, bool nullable = true);
|
||||
|
||||
Status
|
||||
ParseQueryStr(const OQueryParams& query_params, const std::string& key, std::string& value, bool nullable = true);
|
||||
|
||||
Status
|
||||
ParseQueryBool(const OQueryParams& query_params, const std::string& key, bool& value, bool nullable = true);
|
||||
|
||||
} // namespace web
|
||||
} // namespace server
|
||||
} // namespace milvus
|
Loading…
Reference in New Issue