Skip to content

Commit

Permalink
Clean up dependency on proxygen libs (#488)
Browse files Browse the repository at this point in the history
* Clean up dependency on proxygen libs

* Address comments
  • Loading branch information
dangleptr authored Jun 1, 2019
1 parent ea06060 commit c50426e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 53 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@ macro(nebula_link_libraries target)
target_link_libraries(
${target}
${ARGN}
proxygenhttpserver
proxygenlib
folly
glog
gflags
Expand Down
3 changes: 3 additions & 0 deletions src/daemons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ add_executable(
nebula-graphd
GraphDaemon.cpp
$<TARGET_OBJECTS:meta_client>
$<TARGET_OBJECTS:graph_http_obj>
$<TARGET_OBJECTS:meta_thrift_obj>
$<TARGET_OBJECTS:graph_obj>
$<TARGET_OBJECTS:base_obj>
Expand Down Expand Up @@ -38,6 +39,7 @@ add_executable(
nebula-storaged
StorageDaemon.cpp
$<TARGET_OBJECTS:storage_service_handler>
$<TARGET_OBJECTS:storage_http_handler>
$<TARGET_OBJECTS:storage_thrift_obj>
$<TARGET_OBJECTS:kvstore_obj>
$<TARGET_OBJECTS:meta_client>
Expand Down Expand Up @@ -69,6 +71,7 @@ add_executable(
nebula-metad
MetaDaemon.cpp
$<TARGET_OBJECTS:meta_service_handler>
$<TARGET_OBJECTS:meta_http_handler>
$<TARGET_OBJECTS:kvstore_obj>
$<TARGET_OBJECTS:schema_obj>
$<TARGET_OBJECTS:meta_client>
Expand Down
6 changes: 4 additions & 2 deletions src/graph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ add_library(
graph_obj OBJECT
GraphFlags.cpp
GraphService.cpp
GraphHttpHandler.cpp
ClientSession.cpp
SessionManager.cpp
ExecutionEngine.cpp
Expand Down Expand Up @@ -40,12 +39,15 @@ add_dependencies(
base_obj
parser_obj
graph_thrift_obj
ws_obj
meta_thrift_obj
meta_client
schema_obj
stats_obj
)

add_library(
graph_http_obj OBJECT
GraphHttpHandler.cpp
)

add_subdirectory(test)
1 change: 1 addition & 0 deletions src/graph/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ add_executable(
TestBase.cpp
GraphHttpHandlerTest.cpp
$<TARGET_OBJECTS:graph_obj>
$<TARGET_OBJECTS:graph_http_obj>
$<TARGET_OBJECTS:client_cpp_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:graph_thrift_obj>
Expand Down
6 changes: 4 additions & 2 deletions src/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -45,10 +44,13 @@ add_dependencies(
common_thrift_obj
kvstore_obj
thread_obj
ws_obj
stats_obj
)

add_library(
meta_http_handler OBJECT
MetaHttpHandler.cpp
)

add_library(
meta_client OBJECT
Expand Down
7 changes: 1 addition & 6 deletions src/meta/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ add_executable(
)
nebula_link_libraries(
processor_test
proxygenhttpserver
proxygenlib
${ROCKSDB_LIBRARIES}
${THRIFT_LIBRARIES}
wangle
Expand All @@ -63,8 +61,6 @@ add_executable(
)
nebula_link_libraries(
hb_processor_test
proxygenhttpserver
proxygenlib
${ROCKSDB_LIBRARIES}
${THRIFT_LIBRARIES}
wangle
Expand All @@ -91,8 +87,6 @@ add_executable(
)
nebula_link_libraries(
meta_client_test
proxygenhttpserver
proxygenlib
${ROCKSDB_LIBRARIES}
${THRIFT_LIBRARIES}
wangle
Expand Down Expand Up @@ -121,6 +115,7 @@ nebula_add_test(active_hosts_man_test)
add_executable(
meta_http_test
MetaHttpHandlerTest.cpp
$<TARGET_OBJECTS:meta_http_handler>
$<TARGET_OBJECTS:meta_client>
$<TARGET_OBJECTS:meta_service_handler>
$<TARGET_OBJECTS:kvstore_obj>
Expand Down
7 changes: 4 additions & 3 deletions src/storage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
add_library(
storage_service_handler OBJECT
StorageServiceHandler.cpp
StorageHttpHandler.cpp
AddVerticesProcessor.cpp
AddEdgesProcessor.cpp
QueryBoundProcessor.cpp
Expand All @@ -16,10 +15,13 @@ add_dependencies(
kvstore_obj
dataman_obj
thread_obj
ws_obj
stats_obj
)

add_library(
storage_http_handler OBJECT
StorageHttpHandler.cpp
)

add_library(
storage_client OBJECT
Expand All @@ -32,5 +34,4 @@ add_dependencies(
dataman_obj
)


add_subdirectory(test)
13 changes: 1 addition & 12 deletions src/storage/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,7 @@ nebula_add_test(storage_client_test)
add_executable(
storage_http_test
StorageHttpHandlerTest.cpp
$<TARGET_OBJECTS:storage_client>
$<TARGET_OBJECTS:storage_service_handler>
$<TARGET_OBJECTS:meta_service_handler>
$<TARGET_OBJECTS:kvstore_obj>
$<TARGET_OBJECTS:meta_client>
$<TARGET_OBJECTS:meta_thrift_obj>
$<TARGET_OBJECTS:storage_thrift_obj>
$<TARGET_OBJECTS:common_thrift_obj>
$<TARGET_OBJECTS:thrift_obj>
$<TARGET_OBJECTS:dataman_obj>
$<TARGET_OBJECTS:schema_obj>
$<TARGET_OBJECTS:storage_http_handler>
$<TARGET_OBJECTS:ws_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:fs_obj>
Expand All @@ -257,7 +247,6 @@ add_executable(
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:process_obj>
$<TARGET_OBJECTS:adHocSchema_obj>
)

nebula_link_libraries(
Expand Down
26 changes: 0 additions & 26 deletions src/storage/test/StorageHttpHandlerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<folly::IOThreadPoolExecutor>(1);
auto addrsRet
= network::NetworkUtils::toHosts(folly::stringPrintf("127.0.0.1:%d", localMetaPort));
CHECK(addrsRet.ok()) << addrsRet.status();
auto mClient
= std::make_unique<meta::MetaClient>(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));
Expand Down

0 comments on commit c50426e

Please sign in to comment.