chaoyli closed pull request #419: Remove olap root path and related unit test 
since it is useless.
URL: https://github.com/apache/incubator-doris/pull/419
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index d9ecb49d..19371677 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -1684,7 +1684,7 @@ OLAPStatus SchemaChangeHandler::_create_new_tablet(
         }
         is_tablet_added = true;
 
-        // 4. Register tablet into OLAPRootPath, so that we can manage tablet 
from
+        // 4. Register tablet into store, so that we can manage tablet from
         // the perspective of root path.
         // Example: unregister all tables when a bad disk found.
         res = StorageEngine::get_instance()->register_tablet_into_root_path(
diff --git a/be/src/olap/store.h b/be/src/olap/store.h
index 6131acbe..d2454266 100644
--- a/be/src/olap/store.h
+++ b/be/src/olap/store.h
@@ -29,7 +29,6 @@
 
 namespace doris {
 
-class OLAPRootPath;
 class StorageEngine;
 
 // A OlapStore used to manange data in same path.
@@ -103,7 +102,6 @@ class OlapStore {
                 TSchemaHash schema_hash, const std::string& header);
 
 private:
-    friend class OLAPRootPath;
     friend class StorageEngine;
     
     std::string _path;
diff --git a/be/test/agent/heartbeat_server_test.cpp 
b/be/test/agent/heartbeat_server_test.cpp
index 5eaf1c50..76c575b9 100644
--- a/be/test/agent/heartbeat_server_test.cpp
+++ b/be/test/agent/heartbeat_server_test.cpp
@@ -21,7 +21,6 @@
 #include "gen_cpp/HeartbeatService_types.h"
 #include "gen_cpp/Types_types.h"
 #include "agent/heartbeat_server.h"
-#include "olap/mock_olap_rootpath.h"
 #include "util/logging.h"
 
 using ::testing::_;
@@ -42,27 +41,6 @@ TEST(HeartbeatTest, TestHeartbeat){
     ori_master_info.network_address.port = 0;
     HeartbeatServer heartbeat_server(&ori_master_info);
 
-    MockOLAPRootPath mock_olap_rootpath;
-    OLAPRootPath* ori_olap_rootpath;
-    ori_olap_rootpath = heartbeat_server._olap_rootpath_instance;
-    heartbeat_server._olap_rootpath_instance = &mock_olap_rootpath;
-    
-    // No cluster id yet
-    EXPECT_CALL(mock_olap_rootpath, set_cluster_id(_))
-            .Times(1)
-            .WillOnce(Return(OLAPStatus::OLAP_ERR_OTHER_ERROR));
-    TMasterInfo master_info;
-    master_info.cluster_id = 1;
-    master_info.epoch = 10;
-    master_info.network_address.hostname = "host";
-    master_info.network_address.port = 12345;
-    heartbeat_server.heartbeat(heartbeat_result, master_info);
-    EXPECT_EQ(TStatusCode::RUNTIME_ERROR, 
heartbeat_result.status.status_code); 
-
-    // New cluster heartbeat
-    EXPECT_CALL(mock_olap_rootpath, set_cluster_id(_))
-            .Times(1)
-            .WillOnce(Return(OLAPStatus::OLAP_SUCCESS));
     heartbeat_server.heartbeat(heartbeat_result, master_info);
     EXPECT_EQ(TStatusCode::OK, heartbeat_result.status.status_code);
     EXPECT_EQ(master_info.epoch, heartbeat_server._epoch);
diff --git a/be/test/exec/new_olap_scan_node_test.cpp 
b/be/test/exec/new_olap_scan_node_test.cpp
index 3d4c17bb..b59bcc15 100644
--- a/be/test/exec/new_olap_scan_node_test.cpp
+++ b/be/test/exec/new_olap_scan_node_test.cpp
@@ -71,8 +71,6 @@ class TestOlapScanNode : public testing::Test {
                unused_flag_path.c_str(),
                unused_flag_path.size());
 
-        OLAPRootPath::get_instance()->init();
-
         StorageEngine::get_instance()->_lru_cache = newLRU_cache(10000);
 
         _tablet_meta = new
diff --git a/be/test/olap/delete_handler_test.cpp 
b/be/test/olap/delete_handler_test.cpp
index 49c628ec..481a1eca 100644
--- a/be/test/olap/delete_handler_test.cpp
+++ b/be/test/olap/delete_handler_test.cpp
@@ -167,9 +167,6 @@ class TestDeleteConditionHandler : public testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        // 
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;
@@ -478,9 +475,6 @@ class TestDeleteConditionHandler2 : public testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        // 
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;
@@ -787,9 +781,6 @@ class TestDeleteHandler : public testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        // 
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;
diff --git a/be/test/olap/delta_writer_test.cpp 
b/be/test/olap/delta_writer_test.cpp
index 09301b0c..fa5d7a11 100644
--- a/be/test/olap/delta_writer_test.cpp
+++ b/be/test/olap/delta_writer_test.cpp
@@ -273,9 +273,6 @@ class TestDeltaWriter : public ::testing::Test {
         config::storage_root_path = std::string(buffer) + "/data_push";
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
-
-        // Initialize all singleton object.
-        // 
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
     }
 
     void TearDown(){
@@ -492,9 +489,6 @@ class TestSchemaChange : public ::testing::Test {
         config::storage_root_path = std::string(buffer) + 
"/data_schema_change";
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
-
-        // Initialize all singleton object.
-        // 
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
     }
 
     void TearDown(){
diff --git a/be/test/olap/mock_olap_rootpath.h 
b/be/test/olap/mock_olap_rootpath.h
deleted file mode 100644
index da81cbcc..00000000
--- a/be/test/olap/mock_olap_rootpath.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// 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.
-
-#ifndef DORIS_BE_TEST_OLAP_MOCK_OLAP_ROOTPATH_H
-#define DORIS_BE_TEST_OLAP_MOCK_OLAP_ROOTPATH_H
-
-namespace doris {
-
-class MockOLAPRootPath : public OLAPRootPath {
-public:
-    MOCK_METHOD1(set_cluster_id, OLAPStatus(int32_t cluster_id));
-};  // class MockOLAPRootPath
-}  // namespace doris
-#endif  // DORIS_BE_TEST_OLAP_MOCK_OLAP_ROOTPATH_H
diff --git a/be/test/olap/olap_reader_test.cpp 
b/be/test/olap/olap_reader_test.cpp
index fe5a0af8..d7f9261b 100755
--- a/be/test/olap/olap_reader_test.cpp
+++ b/be/test/olap/olap_reader_test.cpp
@@ -160,9 +160,6 @@ class TestOLAPReaderRow : public testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;
@@ -695,9 +692,6 @@ class TestOLAPReaderColumn : public testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;
@@ -1179,9 +1173,6 @@ class TestOLAPReaderColumnDeleteCondition : public 
testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;
diff --git a/be/test/olap/vectorized_olap_reader_test.cpp 
b/be/test/olap/vectorized_olap_reader_test.cpp
index 72d041a0..545367ca 100644
--- a/be/test/olap/vectorized_olap_reader_test.cpp
+++ b/be/test/olap/vectorized_olap_reader_test.cpp
@@ -162,9 +162,6 @@ class TestVectorizedOLAPReader : public testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;
@@ -191,9 +188,6 @@ class TestVectorizedOLAPReader : public testing::Test {
         remove_all_dir(config::storage_root_path);
         ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
 
-        // Initialize all singleton object.
-        
OLAPRootPath::get_instance()->reload_root_paths(config::storage_root_path.c_str());
-
         // 1. Prepare for query split key.
         // create base tablet
         OLAPStatus res = OLAP_SUCCESS;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to