You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2023/06/12 06:00:51 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #20544: [improvement](hdfs) add parquet footer cache and hdfs file handle cache

github-actions[bot] commented on code in PR #20544:
URL: https://github.com/apache/doris/pull/20544#discussion_r1226125262


##########
be/test/util/lru_multi_cache_test.cpp:
##########
@@ -0,0 +1,473 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you 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.
+//
+// This file is copied from
+// https://github.com/apache/impala/blob/master/be/src/util/lru-multi-cache-test.cc
+// and modified by Doris
+
+#include "util/lru_multi_cache.inline.h"
+
+#include <gtest/gtest-message.h>
+#include <gtest/gtest-test-part.h>
+#include "gtest/gtest_pred_impl.h"
+
+#include <memory>
+
+struct CollidingKey {
+  CollidingKey(const std::string& s) : s(s) {}
+  CollidingKey(const char* s) : s(s) {}
+  std::string s;
+};
+
+bool operator==(const CollidingKey& k1, const CollidingKey& k2) {
+  return k1.s == k2.s;
+}
+
+template <>
+struct std::hash<CollidingKey> {
+  size_t operator()(const CollidingKey& k) const noexcept { return 0; }
+};
+
+namespace doris {
+
+struct TestType {
+  // Testing emplace_and_get with perfect forwarding
+  explicit TestType(int i, float) : i(i) {}
+  int i;
+
+  // Making sure nothing is being copied or moved
+  TestType(const TestType&) = delete;
+  TestType(TestType&&) = delete;
+
+  TestType& operator=(const TestType&) = delete;
+  TestType& operator=(const TestType&&) = delete;
+};
+
+class LruMultiCacheTest: public testing::Test {
+public:
+    virtual void SetUp() {

Review Comment:
   warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
   
   ```suggestion
       void SetUp() override {
   ```
   



##########
be/test/util/lru_multi_cache_test.cpp:
##########
@@ -0,0 +1,473 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you 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.
+//
+// This file is copied from
+// https://github.com/apache/impala/blob/master/be/src/util/lru-multi-cache-test.cc
+// and modified by Doris
+
+#include "util/lru_multi_cache.inline.h"

Review Comment:
   warning: 'util/lru_multi_cache.inline.h' file not found [clang-diagnostic-error]
   ```cpp
   #include "util/lru_multi_cache.inline.h"
            ^
   ```
   



##########
be/test/util/lru_multi_cache_test.cpp:
##########
@@ -0,0 +1,473 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you 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.
+//
+// This file is copied from
+// https://github.com/apache/impala/blob/master/be/src/util/lru-multi-cache-test.cc
+// and modified by Doris
+
+#include "util/lru_multi_cache.inline.h"
+
+#include <gtest/gtest-message.h>
+#include <gtest/gtest-test-part.h>
+#include "gtest/gtest_pred_impl.h"
+
+#include <memory>
+
+struct CollidingKey {
+  CollidingKey(const std::string& s) : s(s) {}
+  CollidingKey(const char* s) : s(s) {}
+  std::string s;
+};
+
+bool operator==(const CollidingKey& k1, const CollidingKey& k2) {
+  return k1.s == k2.s;
+}
+
+template <>
+struct std::hash<CollidingKey> {
+  size_t operator()(const CollidingKey& k) const noexcept { return 0; }
+};
+
+namespace doris {
+
+struct TestType {
+  // Testing emplace_and_get with perfect forwarding
+  explicit TestType(int i, float) : i(i) {}
+  int i;
+
+  // Making sure nothing is being copied or moved
+  TestType(const TestType&) = delete;
+  TestType(TestType&&) = delete;
+
+  TestType& operator=(const TestType&) = delete;
+  TestType& operator=(const TestType&&) = delete;
+};
+
+class LruMultiCacheTest: public testing::Test {
+public:
+    virtual void SetUp() {
+    }
+
+    virtual void TearDown() {}

Review Comment:
   warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
   
   ```suggestion
       void TearDown() override {}
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org