]>
git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/os/seastore/collection_manager.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
6 #include <seastar/core/future.hh>
8 #include "osd/osd_types.h"
10 #include "crimson/os/seastore/seastore_types.h"
11 #include "crimson/os/seastore/transaction_manager.h"
13 namespace crimson::os::seastore
{
18 coll_info_t(unsigned bits
)
21 bool operator==(const coll_info_t
&rhs
) const {
22 return split_bits
== rhs
.split_bits
;
26 /// Interface for maintaining set of collections
27 class CollectionManager
{
29 using base_iertr
= TransactionManager::read_extent_iertr
;
31 /// Initialize collection manager instance for an empty store
32 using mkfs_iertr
= TransactionManager::alloc_extent_iertr
;
33 using mkfs_ret
= mkfs_iertr::future
<coll_root_t
>;
34 virtual mkfs_ret
mkfs(
38 using create_iertr
= base_iertr
;
39 using create_ret
= create_iertr::future
<>;
40 virtual create_ret
create(
47 /// List collections with info
48 using list_iertr
= base_iertr
;
49 using list_ret_bare
= std::vector
<std::pair
<coll_t
, coll_info_t
>>;
50 using list_ret
= list_iertr::future
<list_ret_bare
>;
51 virtual list_ret
list(
52 const coll_root_t
&root
,
56 using remove_iertr
= base_iertr
;
57 using remove_ret
= remove_iertr::future
<>;
58 virtual remove_ret
remove(
59 const coll_root_t
&coll_root
,
63 /// Update info for cid
64 using update_iertr
= base_iertr
;
65 using update_ret
= base_iertr::future
<>;
66 virtual update_ret
update(
67 const coll_root_t
&coll_root
,
73 virtual ~CollectionManager() {}
75 using CollectionManagerRef
= std::unique_ptr
<CollectionManager
>;
77 namespace collection_manager
{
78 /* creat CollectionMapManager for Collection */
79 CollectionManagerRef
create_coll_manager(
80 TransactionManager
&trans_manager
);