From 2c6fcacdbd73bae9e34548378698e3a31f9ff884 Mon Sep 17 00:00:00 2001 From: dongwei Date: Sun, 26 Apr 2020 23:21:06 +0800 Subject: [PATCH 1/4] delete unused file Signed-off-by: dongwei --- core/src/server/web_impl/utils/Util.h | 42 --------------------------- 1 file changed, 42 deletions(-) delete mode 100644 core/src/server/web_impl/utils/Util.h diff --git a/core/src/server/web_impl/utils/Util.h b/core/src/server/web_impl/utils/Util.h deleted file mode 100644 index 9ceaa37ace..0000000000 --- a/core/src/server/web_impl/utils/Util.h +++ /dev/null @@ -1,42 +0,0 @@ -// 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 -CopyRowRecords(const OList::ObjectWrapper>::ObjectWrapper& records, std::vector& vectors); - -Status -CopyBinRowRecords(const OList::ObjectWrapper>::ObjectWrapper& records, std::vector& vectors); - -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 From 238967826cc7e3bfe986d2c11e7d28cda63f74f9 Mon Sep 17 00:00:00 2001 From: dongwei Date: Sun, 26 Apr 2020 23:53:48 +0800 Subject: [PATCH 2/4] aaa --- SUPPORT.md | 2 ++ codecov.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/SUPPORT.md b/SUPPORT.md index b1951f309b..70ecbc18d1 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -11,4 +11,6 @@ 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 2ddf708b04..1a3f8fdf80 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -3,6 +3,9 @@ coverage: notify: require_ci_to_pass: yes + + + precision: 2 round: down range: "70...100" From adc6dc38bf5afa47c53f402345bc85e2c7a4b142 Mon Sep 17 00:00:00 2001 From: JinHai-CN Date: Mon, 27 Apr 2020 10:25:07 +0800 Subject: [PATCH 3/4] 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 70ecbc18d1..b1951f309b 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 1a3f8fdf80..2ddf708b04 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 aa1a1820b3..040d2f1caa 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 0000000000..4aa83c21d3 --- /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 From 7b1b75a90d980f217caef185aa0b634d3ffd1e38 Mon Sep 17 00:00:00 2001 From: JinHai-CN Date: Mon, 27 Apr 2020 10:26:05 +0800 Subject: [PATCH 4/4] Fix lint error Signed-off-by: JinHai-CN --- core/src/server/web_impl/utils/Util.h | 54 +++++++++++++-------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/core/src/server/web_impl/utils/Util.h b/core/src/server/web_impl/utils/Util.h index 4aa83c21d3..d337862987 100644 --- a/core/src/server/web_impl/utils/Util.h +++ b/core/src/server/web_impl/utils/Util.h @@ -1,36 +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. +// 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 +#pragma once -#include -#include +#include +#include -#include "db/Types.h" -#include "server/web_impl/Types.h" -#include "utils/Status.h" +#include "db/Types.h" +#include "server/web_impl/Types.h" +#include "utils/Status.h" -namespace milvus { -namespace server { -namespace web { +namespace milvus { +namespace server { +namespace web { -Status -ParseQueryInteger(const OQueryParams& query_params, const std::string& key, int64_t& value, bool nullable = true); +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 +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); +Status +ParseQueryBool(const OQueryParams& query_params, const std::string& key, bool& value, bool nullable = true); -} // namespace web -} // namespace server +} // namespace web +} // namespace server } // namespace milvus