Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
feat(backup): add hdfs as an alternative backup provider
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyifan27 committed Nov 11, 2020
1 parent 81b1005 commit 1e8d177
Show file tree
Hide file tree
Showing 12 changed files with 934 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/block_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ set(MY_BOOST_LIBS Boost::system Boost::filesystem)
dsn_add_static_library()

add_subdirectory(fds)
add_subdirectory(hdfs)
add_subdirectory(local)
add_subdirectory(test)
5 changes: 5 additions & 0 deletions src/block_service/block_service_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "block_service_manager.h"
#include "block_service/fds/fds_service.h"
#include "block_service/hdfs/hdfs_service.h"
#include "block_service/local/local_service.h"

#include <dsn/dist/fmt_logging.h>
Expand All @@ -21,6 +22,10 @@ block_service_registry::block_service_registry()
"fds_service", block_filesystem::create<fds_service>, PROVIDER_TYPE_MAIN);
dassert(ans, "register fds_service failed");

ans = utils::factory_store<block_filesystem>::register_factory(
"hdfs_service", block_filesystem::create<hdfs_service>, PROVIDER_TYPE_MAIN);
dassert(ans, "register hdfs_service failed");

ans = utils::factory_store<block_filesystem>::register_factory(
"local_service", block_filesystem::create<local_service>, PROVIDER_TYPE_MAIN);
dassert(ans, "register local_service failed");
Expand Down
28 changes: 28 additions & 0 deletions src/block_service/hdfs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
set(MY_PROJ_NAME dsn.block_service.hdfs)

#Source files under CURRENT project directory will be automatically included.
#You can manually set MY_PROJ_SRC to include source files under other directories.
set(MY_PROJ_SRC "")

#Search mode for source files under CURRENT project directory ?
#"GLOB_RECURSE" for recursive search
#"GLOB" for non - recursive search
set(MY_SRC_SEARCH_MODE "GLOB")

set(MY_PROJ_LIBS "")

#Extra files that will be installed
set(MY_BINPLACES "")

dsn_add_static_library()

set(LIBS hdfs)
find_package(JNI)
if (JNI_FOUND)
message (STATUS "JAVA_JVM_LIBRARY=${JAVA_JVM_LIBRARY}")
set(LIBS ${LIBS} ${JAVA_JVM_LIBRARY})
else (JNI_FOUND)
message (FATAL_ERROR "JNI is required but not found, please make sure
jdk is installed and JAVA_HOME is set.")
endif (JNI_FOUND)
target_link_libraries(${MY_PROJ_NAME} PUBLIC ${LIBS})
Loading

0 comments on commit 1e8d177

Please sign in to comment.