From a73e590526aa87977378a0be103169b78dcfc2a8 Mon Sep 17 00:00:00 2001 From: heng Date: Fri, 31 May 2019 15:54:44 +0800 Subject: [PATCH 1/2] Clean up dependency on proxygen libs --- CMakeLists.txt | 2 -- src/daemons/CMakeLists.txt | 3 +++ src/graph/CMakeLists.txt | 5 +++- src/graph/test/CMakeLists.txt | 1 + src/meta/CMakeLists.txt | 8 ++++++- src/meta/test/CMakeLists.txt | 1 + src/storage/CMakeLists.txt | 10 ++++++-- src/storage/test/CMakeLists.txt | 1 + src/storage/test/StorageHttpHandlerTest.cpp | 26 --------------------- 9 files changed, 25 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ad69216f74..abdc4c8982c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,8 +277,6 @@ macro(nebula_link_libraries target) target_link_libraries( ${target} ${ARGN} - proxygenhttpserver - proxygenlib folly glog gflags diff --git a/src/daemons/CMakeLists.txt b/src/daemons/CMakeLists.txt index 418846cf56c..b601b86ab53 100644 --- a/src/daemons/CMakeLists.txt +++ b/src/daemons/CMakeLists.txt @@ -2,6 +2,7 @@ add_executable( nebula-graphd GraphDaemon.cpp $ + $ $ $ $ @@ -38,6 +39,7 @@ add_executable( nebula-storaged StorageDaemon.cpp $ + $ $ $ $ @@ -69,6 +71,7 @@ add_executable( nebula-metad MetaDaemon.cpp $ + $ $ $ $ diff --git a/src/graph/CMakeLists.txt b/src/graph/CMakeLists.txt index 10d040de7b2..02b055b8ee1 100644 --- a/src/graph/CMakeLists.txt +++ b/src/graph/CMakeLists.txt @@ -2,7 +2,6 @@ add_library( graph_obj OBJECT GraphFlags.cpp GraphService.cpp - GraphHttpHandler.cpp ClientSession.cpp SessionManager.cpp ExecutionEngine.cpp @@ -47,5 +46,9 @@ add_dependencies( stats_obj ) +add_library( + graph_http_obj OBJECT + GraphHttpHandler.cpp +) add_subdirectory(test) diff --git a/src/graph/test/CMakeLists.txt b/src/graph/test/CMakeLists.txt index f621c1f5eb1..046d833d1ca 100644 --- a/src/graph/test/CMakeLists.txt +++ b/src/graph/test/CMakeLists.txt @@ -125,6 +125,7 @@ add_executable( TestBase.cpp GraphHttpHandlerTest.cpp $ + $ $ $ $ diff --git a/src/meta/CMakeLists.txt b/src/meta/CMakeLists.txt index 54c820f55b3..340f46ddc6a 100644 --- a/src/meta/CMakeLists.txt +++ b/src/meta/CMakeLists.txt @@ -11,7 +11,6 @@ add_library( meta_service_handler OBJECT MetaServiceHandler.cpp MetaServiceUtils.cpp - MetaHttpHandler.cpp processors/partsMan/AddHostsProcessor.cpp processors/partsMan/ListHostsProcessor.cpp processors/partsMan/RemoveHostsProcessor.cpp @@ -49,6 +48,13 @@ add_dependencies( stats_obj ) +add_library( + meta_http_handler OBJECT + MetaHttpHandler.cpp +) +add_dependencies( + meta_http_handler + base_obj) add_library( meta_client OBJECT diff --git a/src/meta/test/CMakeLists.txt b/src/meta/test/CMakeLists.txt index bfd0155675a..679bd963a3e 100644 --- a/src/meta/test/CMakeLists.txt +++ b/src/meta/test/CMakeLists.txt @@ -121,6 +121,7 @@ nebula_add_test(active_hosts_man_test) add_executable( meta_http_test MetaHttpHandlerTest.cpp + $ $ $ $ diff --git a/src/storage/CMakeLists.txt b/src/storage/CMakeLists.txt index 3129a7b0cc9..409c894e005 100644 --- a/src/storage/CMakeLists.txt +++ b/src/storage/CMakeLists.txt @@ -1,7 +1,6 @@ add_library( storage_service_handler OBJECT StorageServiceHandler.cpp - StorageHttpHandler.cpp AddVerticesProcessor.cpp AddEdgesProcessor.cpp QueryBoundProcessor.cpp @@ -20,6 +19,14 @@ add_dependencies( stats_obj ) +add_library( + storage_http_handler OBJECT + StorageHttpHandler.cpp +) +add_dependencies( + storage_http_handler + base_obj +) add_library( storage_client OBJECT @@ -32,5 +39,4 @@ add_dependencies( dataman_obj ) - add_subdirectory(test) diff --git a/src/storage/test/CMakeLists.txt b/src/storage/test/CMakeLists.txt index 5dfea5acee0..d1149c7debd 100644 --- a/src/storage/test/CMakeLists.txt +++ b/src/storage/test/CMakeLists.txt @@ -240,6 +240,7 @@ add_executable( StorageHttpHandlerTest.cpp $ $ + $ $ $ $ diff --git a/src/storage/test/StorageHttpHandlerTest.cpp b/src/storage/test/StorageHttpHandlerTest.cpp index 2a74f07d620..516ef352f42 100644 --- a/src/storage/test/StorageHttpHandlerTest.cpp +++ b/src/storage/test/StorageHttpHandlerTest.cpp @@ -43,32 +43,6 @@ class StorageHttpHandlerTestEnv : public ::testing::Environment { TEST(StoragehHttpHandlerTest, StorageStatusTest) { - FLAGS_load_data_interval_secs = 1; - - fs::TempDir rootPath("/tmp/StorageClientTest.XXXXXX"); - uint32_t localIp; - network::NetworkUtils::ipv4ToInt("127.0.0.1", localIp); - uint32_t localMetaPort = 10001; - uint32_t localDataPort = 20002; - - LOG(INFO) << "Start meta server...."; - std::string metaPath = folly::stringPrintf("%s/meta", rootPath.path()); - auto metaServerContext = meta::TestUtils::mockMetaServer(localMetaPort, metaPath.c_str()); - - LOG(INFO) << "Start storage server...."; - auto threadPool = std::make_shared(1); - auto addrsRet - = network::NetworkUtils::toHosts(folly::stringPrintf("127.0.0.1:%d", localMetaPort)); - CHECK(addrsRet.ok()) << addrsRet.status(); - auto mClient - = std::make_unique(threadPool, std::move(addrsRet.value()), true); - mClient->init(); - std::string dataPath = folly::stringPrintf("%s/data", rootPath.path()); - auto sc = TestUtils::mockStorageServer(mClient.get(), - dataPath.c_str(), - localIp, - localDataPort); - { std::string resp; ASSERT_TRUE(getUrl("/status", resp)); From b95c8747183175ced59822dd2498e98fc6204740 Mon Sep 17 00:00:00 2001 From: heng Date: Fri, 31 May 2019 16:29:10 +0800 Subject: [PATCH 2/2] Address comments --- src/graph/CMakeLists.txt | 1 - src/meta/CMakeLists.txt | 4 ---- src/meta/test/CMakeLists.txt | 6 ------ src/storage/CMakeLists.txt | 5 ----- src/storage/test/CMakeLists.txt | 12 ------------ 5 files changed, 28 deletions(-) diff --git a/src/graph/CMakeLists.txt b/src/graph/CMakeLists.txt index 02b055b8ee1..77d98a992d1 100644 --- a/src/graph/CMakeLists.txt +++ b/src/graph/CMakeLists.txt @@ -39,7 +39,6 @@ add_dependencies( base_obj parser_obj graph_thrift_obj - ws_obj meta_thrift_obj meta_client schema_obj diff --git a/src/meta/CMakeLists.txt b/src/meta/CMakeLists.txt index 340f46ddc6a..a9b29c2b574 100644 --- a/src/meta/CMakeLists.txt +++ b/src/meta/CMakeLists.txt @@ -44,7 +44,6 @@ add_dependencies( common_thrift_obj kvstore_obj thread_obj - ws_obj stats_obj ) @@ -52,9 +51,6 @@ add_library( meta_http_handler OBJECT MetaHttpHandler.cpp ) -add_dependencies( - meta_http_handler - base_obj) add_library( meta_client OBJECT diff --git a/src/meta/test/CMakeLists.txt b/src/meta/test/CMakeLists.txt index 679bd963a3e..6cf3965f648 100644 --- a/src/meta/test/CMakeLists.txt +++ b/src/meta/test/CMakeLists.txt @@ -36,8 +36,6 @@ add_executable( ) nebula_link_libraries( processor_test - proxygenhttpserver - proxygenlib ${ROCKSDB_LIBRARIES} ${THRIFT_LIBRARIES} wangle @@ -63,8 +61,6 @@ add_executable( ) nebula_link_libraries( hb_processor_test - proxygenhttpserver - proxygenlib ${ROCKSDB_LIBRARIES} ${THRIFT_LIBRARIES} wangle @@ -91,8 +87,6 @@ add_executable( ) nebula_link_libraries( meta_client_test - proxygenhttpserver - proxygenlib ${ROCKSDB_LIBRARIES} ${THRIFT_LIBRARIES} wangle diff --git a/src/storage/CMakeLists.txt b/src/storage/CMakeLists.txt index 409c894e005..908ab3f4828 100644 --- a/src/storage/CMakeLists.txt +++ b/src/storage/CMakeLists.txt @@ -15,7 +15,6 @@ add_dependencies( kvstore_obj dataman_obj thread_obj - ws_obj stats_obj ) @@ -23,10 +22,6 @@ add_library( storage_http_handler OBJECT StorageHttpHandler.cpp ) -add_dependencies( - storage_http_handler - base_obj -) add_library( storage_client OBJECT diff --git a/src/storage/test/CMakeLists.txt b/src/storage/test/CMakeLists.txt index d1149c7debd..483cd61b314 100644 --- a/src/storage/test/CMakeLists.txt +++ b/src/storage/test/CMakeLists.txt @@ -238,18 +238,7 @@ nebula_add_test(storage_client_test) add_executable( storage_http_test StorageHttpHandlerTest.cpp - $ - $ $ - $ - $ - $ - $ - $ - $ - $ - $ - $ $ $ $ @@ -258,7 +247,6 @@ add_executable( $ $ $ - $ ) nebula_link_libraries(