add_subdirectory(libradosstriper)
endif()
+# make rocksdb statically
+
+if(NOT WITH_SYSTEM_ROCKSDB)
+ include(BuildRocksDB)
+ build_rocksdb()
+endif(NOT WITH_SYSTEM_ROCKSDB)
+
if(WITH_MGR)
add_subdirectory(mgr)
endif()
install(TARGETS ceph-mon DESTINATION bin)
# OSD/ObjectStore
-# make rocksdb statically
-
-if(NOT WITH_SYSTEM_ROCKSDB)
- include(BuildRocksDB)
- build_rocksdb()
-endif(NOT WITH_SYSTEM_ROCKSDB)
include(TestBigEndian)
test_big_endian(CEPH_BIG_ENDIAN)
// Include this first to get python headers earlier
#include "Gil.h"
+#include "ActivePyModules.h"
+
+#include <rocksdb/version.h>
+
#include "common/errno.h"
#include "include/stringify.h"
-#include "PyFormatter.h"
-
-#include "osd/OSDMap.h"
#include "mon/MonMap.h"
+#include "osd/OSDMap.h"
#include "osd/osd_types.h"
#include "mgr/MgrContext.h"
#include "mgr/TTLCache.h"
#include "mgr/mgr_perf_counters.h"
+#include "DaemonKey.h"
+#include "DaemonServer.h"
+#include "mgr/MgrContext.h"
+#include "PyFormatter.h"
// For ::mgr_store_prefix
#include "PyModule.h"
#include "PyModuleRegistry.h"
#include "PyUtil.h"
-#include "ActivePyModules.h"
-#include "DaemonKey.h"
-#include "DaemonServer.h"
-
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_mgr
#undef dout_prefix
return f.get();
}
+PyObject* ActivePyModules::get_rocksdb_version()
+{
+ std::string version = std::to_string(ROCKSDB_MAJOR) + "." +
+ std::to_string(ROCKSDB_MINOR) + "." +
+ std::to_string(ROCKSDB_PATCH);
+
+ return PyUnicode_FromString(version.c_str());
+}
+
PyObject *ActivePyModules::get_context()
{
auto l = without_gil([&] {
PyObject *get_perf_schema_python(
const std::string &svc_type,
const std::string &svc_id);
+ PyObject *get_rocksdb_version();
PyObject *get_context();
PyObject *get_osdmap();
/// @note @c fct is not allowed to acquire locks when holding GIL
return self->py_modules->get_perf_schema_python(type_str, svc_id);
}
+static PyObject*
+ceph_get_rocksdb_version(BaseMgrModule *self)
+{
+ return self->py_modules->get_rocksdb_version();
+}
+
+
static PyObject *
ceph_get_osdmap(BaseMgrModule *self, PyObject *args)
{
{"_ceph_get_perf_schema", (PyCFunction)get_perf_schema, METH_VARARGS,
"Get the performance counter schema"},
+ {"_ceph_get_rocksdb_version", (PyCFunction)ceph_get_rocksdb_version, METH_NOARGS,
+ "Get the current RocksDB version number"},
+
{"_ceph_log", (PyCFunction)ceph_log, METH_VARARGS,
"Emit a (local) log message"},
if(WITH_LIBCEPHSQLITE)
target_link_libraries(ceph-mgr cephsqlite SQLite3::SQLite3)
endif()
+ target_include_directories(ceph-mgr PRIVATE
+ $<TARGET_PROPERTY:RocksDB::RocksDB,INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(ceph-mgr
osdc client heap_profiler
global-static ceph-common
def _ceph_get_server(self, hostname: Optional[str]) -> Union[ServerInfoT,
List[ServerInfoT]]: ...
def _ceph_get_perf_schema(self, svc_type: str, svc_name: str) -> Dict[str, Any]: ...
+ def _ceph_get_rocksdb_version(self) -> str: ...
def _ceph_get_counter(self, svc_type: str, svc_name: str, path: str) -> Dict[str, List[Tuple[float, int]]]: ...
def _ceph_get_latest_counter(self, svc_type, svc_name, path): ...
def _ceph_get_metadata(self, svc_type, svc_id): ...
"""
return self._ceph_get_perf_schema(svc_type, svc_name)
+ def get_rocksdb_version(self) -> str:
+ """
+ Called by the plugin to fetch the latest RocksDB version number.
+
+ :return: str representing the major, minor, and patch RocksDB version numbers
+ """
+ return self._ceph_get_rocksdb_version()
+
@API.expose
def get_counter(self,
svc_type: str,