return opl.empty();
});
}
+
public:
+ OperationRegistryT(core_id_t core) {
+ // Use core to initialize upper 8 bits of counters to ensure that
+ // ids generated by different cores are disjoint
+ op_id_counters.fill(
+ static_cast<id_t>(core) <<
+ (std::numeric_limits<id_t>::digits - 8));
+ }
+
template <size_t REGISTRY_INDEX>
const op_list& get_registry() const {
static_assert(
REGISTRY_INDEX < std::tuple_size<decltype(registries)>::value);
return registries[REGISTRY_INDEX];
}
+
+ /// Removes op from registry
+ void remove_from_registry(Operation &op) {
+ const auto op_type = op.get_type();
+ registries[op_type].erase(op_list::s_iterator_to(op));
+ }
+
+ /// Adds op to registry
+ void add_to_registry(Operation &op) {
+ const auto op_type = op.get_type();
+ registries[op_type].push_back(op);
+ }
};
class PipelineExitBarrierI {
}
OSDOperationRegistry::OSDOperationRegistry()
+ : OperationRegistryT(seastar::this_shard_id())
{
constexpr auto historic_reg_index =
static_cast<size_t>(OperationTypeCode::historic_client_request);