From adc6dc38bf5afa47c53f402345bc85e2c7a4b142 Mon Sep 17 00:00:00 2001 From: JinHai-CN Date: Mon, 27 Apr 2020 10:25:07 +0800 Subject: [PATCH] Fix compiling error Signed-off-by: JinHai-CN --- SUPPORT.md | 2 -- codecov.yaml | 3 -- core/src/server/web_impl/utils/Util.cpp | 39 ------------------------- core/src/server/web_impl/utils/Util.h | 36 +++++++++++++++++++++++ 4 files changed, 36 insertions(+), 44 deletions(-) create mode 100644 core/src/server/web_impl/utils/Util.h diff --git a/SUPPORT.md b/SUPPORT.md index 70ecbc18..b1951f30 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -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. diff --git a/codecov.yaml b/codecov.yaml index 1a3f8fdf..2ddf708b 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -3,9 +3,6 @@ coverage: notify: require_ci_to_pass: yes - - - precision: 2 round: down range: "70...100" diff --git a/core/src/server/web_impl/utils/Util.cpp b/core/src/server/web_impl/utils/Util.cpp index aa1a1820..040d2f1c 100644 --- a/core/src/server/web_impl/utils/Util.cpp +++ b/core/src/server/web_impl/utils/Util.cpp @@ -17,45 +17,6 @@ namespace milvus { namespace server { namespace web { -Status -CopyRowRecords(const OList::ObjectWrapper>::ObjectWrapper& records, std::vector& vectors) { - size_t tal_size = 0; - records->forEach([&tal_size](const OList::ObjectWrapper& row_item) { tal_size += row_item->count(); }); - - vectors.resize(tal_size); - size_t index_offset = 0; - records->forEach([&vectors, &index_offset](const OList::ObjectWrapper& row_item) { - row_item->forEach( - [&vectors, &index_offset](const OFloat32& item) { vectors[index_offset++] = item->getValue(); }); - }); - - return Status::OK(); -} - -Status -CopyBinRowRecords(const OList::ObjectWrapper>::ObjectWrapper& records, std::vector& vectors) { - size_t tal_size = 0; - records->forEach([&tal_size](const OList::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::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(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()); diff --git a/core/src/server/web_impl/utils/Util.h b/core/src/server/web_impl/utils/Util.h new file mode 100644 index 00000000..4aa83c21 --- /dev/null +++ b/core/src/server/web_impl/utils/Util.h @@ -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 +#include + +#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 -- GitLab