]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librados: move C++ APIs into libradospp
authorKefu Chai <kchai@redhat.com>
Tue, 9 Jan 2018 09:19:28 +0000 (17:19 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 1 Nov 2018 16:15:30 +0000 (00:15 +0800)
commit3730d10623650ce8569be96b28cbba599a9a0db6
tree7ca8b78c7455d237ad06ebf38b3d33e8dd294863
parent9167c8381f2c04e302b20a0b9febb60210dba1fb
librados: move C++ APIs into libradospp

the goal is to decouple C++ API from C API, and to version them
differently, as they are targeting different consumers.

this allows us to change the C++ API and bumping up its soversion
without requiring consumer to recompile the librados client for
using the new librados. in this way, C++ API can move faster than
C API. for example, if bufferlist interface is changed for better
performance, and this breaks existing API/ABI, we can bump up
the C++ library's soversion, and and the C library's version unchanged
but ship the new librados's C binding. so the librados client linked
against librados's C library will be able to take advantage of
the improvement in C++ library. while the librados client
linked against C++ library won't break at runtime due to unresolved
symbol or changed structure layout.

this is massive change, the genereal idea is to

* split librados.cc into two source files: librados_c.cc and
  librados_cxx.cc, the former for implementing C APIs, the later
  for C++ APIs.
* extract the C++ API in librados into librados-cxx, the library
  name will be libradospp. but we can change it before nautilus
  is released.
* link these librados libraries with static libraries which it
  depends on, so "-Wl,--exclude-libs,ALL" link flags can help
  hide the non-public symbols.
* extract the tests exercising librados' C++ API into a different
  source file named *_cxx.cc. for instance, to move the C++ tests
  in aio.cc into aio_cxx.cc
* extract the shared helper functions which do not use any librados
  or librados-cxx APIs into test_shared{.cc,h}. the "shared" here
  means, *shared* by C++ and C tests.
* extract the test fixtures, i.e., the subclasses of testing::Test,
  for testing C++ APIs into testcase_cxx.cc.
* update qa/workunits/rados/test.sh accordingly to add the splitted
  tests
* update the consumers of librados to link against librados-cxx
  instead, if they are using the C++ API.

Signed-off-by: Kefu Chai <kchai@redhat.com>
99 files changed:
qa/workunits/rados/test.sh
src/cls/lua/cls_lua_client.h
src/librados/AioCompletionImpl.h
src/librados/CMakeLists.txt
src/librados/RadosClient.cc
src/librados/librados.cc [deleted file]
src/librados/librados_c.cc [new file with mode: 0644]
src/librados/librados_cxx.cc [new file with mode: 0644]
src/librados/librados_tp.cc [new file with mode: 0644]
src/librados/librados_util.cc [new file with mode: 0644]
src/librados/librados_util.h [new file with mode: 0644]
src/libradosstriper/CMakeLists.txt
src/librbd/CMakeLists.txt
src/rbd_replay/CMakeLists.txt
src/rgw/CMakeLists.txt
src/test/CMakeLists.txt
src/test/cls_hello/CMakeLists.txt
src/test/cls_hello/test_cls_hello.cc
src/test/cls_journal/CMakeLists.txt
src/test/cls_journal/test_cls_journal.cc
src/test/cls_lock/CMakeLists.txt
src/test/cls_lock/test_cls_lock.cc
src/test/cls_log/CMakeLists.txt
src/test/cls_log/test_cls_log.cc
src/test/cls_lua/CMakeLists.txt
src/test/cls_lua/test_cls_lua.cc
src/test/cls_numops/CMakeLists.txt
src/test/cls_numops/test_cls_numops.cc
src/test/cls_rbd/CMakeLists.txt
src/test/cls_rbd/test_cls_rbd.cc
src/test/cls_refcount/CMakeLists.txt
src/test/cls_refcount/test_cls_refcount.cc
src/test/cls_rgw/CMakeLists.txt
src/test/cls_rgw/test_cls_rgw.cc
src/test/cls_sdk/CMakeLists.txt
src/test/cls_sdk/test_cls_sdk.cc
src/test/cls_version/CMakeLists.txt
src/test/cls_version/test_cls_version.cc
src/test/journal/CMakeLists.txt
src/test/journal/RadosTestFixture.cc
src/test/librados/CMakeLists.txt
src/test/librados/TestCase.cc
src/test/librados/TestCase.h
src/test/librados/aio.cc
src/test/librados/aio_cxx.cc [new file with mode: 0644]
src/test/librados/c_write_operations.cc
src/test/librados/cls.cc
src/test/librados/cmd.cc
src/test/librados/cmd_cxx.cc [new file with mode: 0644]
src/test/librados/io.cc
src/test/librados/io_cxx.cc [new file with mode: 0644]
src/test/librados/list.cc
src/test/librados/list_cxx.cc [new file with mode: 0644]
src/test/librados/lock.cc
src/test/librados/lock_cxx.cc [new file with mode: 0644]
src/test/librados/misc.cc
src/test/librados/misc_cxx.cc [new file with mode: 0644]
src/test/librados/pool.cc
src/test/librados/service.cc
src/test/librados/service_cxx.cc [new file with mode: 0644]
src/test/librados/snapshots.cc
src/test/librados/snapshots_cxx.cc [new file with mode: 0644]
src/test/librados/stat.cc
src/test/librados/stat_cxx.cc [new file with mode: 0644]
src/test/librados/test.cc
src/test/librados/test.h
src/test/librados/test_cxx.cc [new file with mode: 0644]
src/test/librados/test_cxx.h [new file with mode: 0644]
src/test/librados/test_shared.cc [new file with mode: 0644]
src/test/librados/test_shared.h [new file with mode: 0644]
src/test/librados/testcase_cxx.cc [new file with mode: 0644]
src/test/librados/testcase_cxx.h [new file with mode: 0644]
src/test/librados/tier.cc [deleted file]
src/test/librados/tier_cxx.cc [new file with mode: 0644]
src/test/librados/watch_notify.cc
src/test/librados/watch_notify_cxx.cc [new file with mode: 0644]
src/test/libradosstriper/CMakeLists.txt
src/test/libradosstriper/TestCase.cc
src/test/librbd/CMakeLists.txt
src/test/librbd/test_fixture.cc
src/test/librbd/test_librbd.cc
src/test/librbd/test_main.cc
src/test/multi_stress_watch.cc
src/test/osd/CMakeLists.txt
src/test/rbd_mirror/CMakeLists.txt
src/test/rbd_mirror/test_ClusterWatcher.cc
src/test/rbd_mirror/test_ImageReplayer.cc
src/test/rbd_mirror/test_InstanceWatcher.cc
src/test/rbd_mirror/test_LeaderWatcher.cc
src/test/rbd_mirror/test_PoolWatcher.cc
src/test/rbd_mirror/test_fixture.cc
src/test/rbd_mirror/test_main.cc
src/test/rbd_mirror/test_mock_InstanceWatcher.cc
src/test/test_stress_watch.cc
src/tools/CMakeLists.txt
src/tools/cephfs/CMakeLists.txt
src/tools/rbd/CMakeLists.txt
src/tools/rbd_mirror/CMakeLists.txt
src/tools/rbd_nbd/CMakeLists.txt