diff --git a/visualdl/backend/logic/pybind.cc b/visualdl/backend/logic/pybind.cc index 9b7f67727afc657b21b4274bf79cb6ffae94f4c7..4b114a53344c91102876b008f95c77ee797bfe05 100644 --- a/visualdl/backend/logic/pybind.cc +++ b/visualdl/backend/logic/pybind.cc @@ -62,7 +62,7 @@ PYBIND11_PLUGIN(core) { &vs::start_write_service, "global information-maintainer object."); m.def("im", &vs::im); - m.def("stop_threads", &vs::StopThreads); + m.def("stop_threads", &vs::stop_threads); // interfaces for components #define ADD_SCALAR_TYPED_INTERFACE(T, name__) \ diff --git a/visualdl/backend/logic/sdk.h b/visualdl/backend/logic/sdk.h index c56323a45b7e6549abac95b7c10af94dcd55e91d..9948ab709896784cea1c9294a2e4fac0586cee99 100644 --- a/visualdl/backend/logic/sdk.h +++ b/visualdl/backend/logic/sdk.h @@ -109,7 +109,7 @@ public: IM::Global().storage().mutable_data()->clear_tablets(); } - void PersistToDisk() const; + void PersistToDisk() const { IM::Global().PersistToDisk(); } }; namespace components { @@ -142,11 +142,23 @@ private: } // namespace components -static ImHelper &get_im() { +static ImHelper &im() { static ImHelper im; return im; } +static void start_read_service(const std::string &dir) { + IM::Global().SetPersistDest(dir); + IM::Global().MaintainRead(); +} + +static void start_write_service(const std::string &dir) { + IM::Global().SetPersistDest(dir); + IM::Global().MaintainWrite(); +} + +static void stop_threads() { cc::PeriodExector::Global().Quit(); } + } // namespace visualdl #endif // VISUALDL_BACKEND_LOGIC_SDK_H diff --git a/visualdl/backend/storage/CMakeLists.txt b/visualdl/backend/storage/CMakeLists.txt index 2885b845247eb72b8a4f746eb6b80ba0ec6d2b79..090f162ecec3667f6bf47e47c5a10a8215385142 100644 --- a/visualdl/backend/storage/CMakeLists.txt +++ b/visualdl/backend/storage/CMakeLists.txt @@ -4,5 +4,5 @@ add_library(storage_proto ${PROTO_SRCS}) add_dependencies(storage_proto protobuf) ## add storage as target -add_library(storage storage.cc ${PROTO_SRCS} ${PROTO_HDRS}) +add_library(storage storage.cc storage.h ${PROTO_SRCS} ${PROTO_HDRS}) add_dependencies(storage storage_proto)