From 8d634fb901ef915bdb5d4e8c7ae48312e395401f Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 10 Feb 2023 19:43:00 -0800 Subject: [PATCH] ircd::m::dbs: Rename write_opts to opts and split into header. --- include/ircd/m/dbs/dbs.h | 154 ++------------------------ include/ircd/m/dbs/event_column.h | 2 +- include/ircd/m/dbs/event_horizon.h | 6 +- include/ircd/m/dbs/event_idx.h | 2 +- include/ircd/m/dbs/event_json.h | 2 +- include/ircd/m/dbs/event_refs.h | 4 +- include/ircd/m/dbs/event_sender.h | 2 +- include/ircd/m/dbs/event_state.h | 2 +- include/ircd/m/dbs/event_type.h | 2 +- include/ircd/m/dbs/opts.h | 145 ++++++++++++++++++++++++ include/ircd/m/dbs/room_events.h | 2 +- include/ircd/m/dbs/room_head.h | 4 +- include/ircd/m/dbs/room_joined.h | 2 +- include/ircd/m/dbs/room_state.h | 2 +- include/ircd/m/dbs/room_state_space.h | 2 +- include/ircd/m/dbs/room_type.h | 2 +- include/ircd/m/vm/opts.h | 4 +- matrix/dbs.cc | 56 +++++----- matrix/dbs_event_column.cc | 2 +- matrix/dbs_event_horizon.cc | 12 +- matrix/dbs_event_idx.cc | 2 +- matrix/dbs_event_json.cc | 2 +- matrix/dbs_event_refs.cc | 60 +++++----- matrix/dbs_event_sender.cc | 2 +- matrix/dbs_event_state.cc | 2 +- matrix/dbs_event_type.cc | 2 +- matrix/dbs_room_events.cc | 2 +- matrix/dbs_room_head.cc | 4 +- matrix/dbs_room_joined.cc | 2 +- matrix/dbs_room_state.cc | 2 +- matrix/dbs_room_state_space.cc | 2 +- matrix/dbs_room_type.cc | 2 +- matrix/event_horizon.cc | 4 +- matrix/event_purge.cc | 2 +- matrix/event_refs.cc | 2 +- matrix/events.cc | 2 +- matrix/room_events.cc | 4 +- matrix/room_head.cc | 6 +- matrix/room_state.cc | 2 +- matrix/room_state_space.cc | 2 +- matrix/vm_eval.cc | 2 +- matrix/vm_execute.cc | 4 +- modules/console.cc | 2 +- 43 files changed, 269 insertions(+), 256 deletions(-) create mode 100644 include/ircd/m/dbs/opts.h diff --git a/include/ircd/m/dbs/dbs.h b/include/ircd/m/dbs/dbs.h index 00b158653..d30158af2 100644 --- a/include/ircd/m/dbs/dbs.h +++ b/include/ircd/m/dbs/dbs.h @@ -15,7 +15,7 @@ namespace ircd::m::dbs { struct init; - struct write_opts; + struct opts; enum class ref :uint8_t; // General confs @@ -29,8 +29,8 @@ namespace ircd::m::dbs extern std::shared_ptr events; // [SET (txn)] Basic write suite - size_t prefetch(const event &, const write_opts &); - size_t write(db::txn &, const event &, const write_opts &); + size_t prefetch(const event &, const opts &); + size_t write(db::txn &, const event &, const opts &); } /// Database description @@ -60,153 +60,21 @@ namespace ircd::m::dbs::appendix #include "room_joined.h" // room_id | origin, member => event_idx #include "room_head.h" // room_id | event_id => event_idx #include "init.h" +#include "opts.h" -/// Options that affect the dbs::write() of an event to the transaction. -struct ircd::m::dbs::write_opts -{ - static const std::bitset<256> event_refs_all; - static const std::bitset<64> appendix_all; - - /// Operation code; usually SET or DELETE. Note that we interpret the - /// code internally and may set different codes for appendages of the - /// actual transaction. - db::op op {db::op::SET}; - - /// Lower-level write options passed to the transaction's execution. - db::sopts sopts; - - /// Principal's index number. Most codepaths do not permit zero. This may - /// be zero for blacklisting, but the blacklist option must be set. - uint64_t event_idx {0}; - - /// Fuse panel to toggle transaction elements. - std::bitset<64> appendix {appendix_all}; - - /// Selection of what reference types to manipulate in event_refs. Refs - /// will not be made if it is not appropriate for the event anyway, so - /// this defaults to all bits. User can disable one or more ref types - /// by clearing a bit. - std::bitset<256> event_refs {event_refs_all}; - - /// Selection of what reference types to resolve and delete from the - /// event_horizon for this event. - std::bitset<256> horizon_resolve {event_refs_all}; - - /// Whether the event.source can be used directly for event_json. Defaults - /// to false unless the caller wants to avoid a redundant re-stringify. - bool json_source {false}; - - /// Data in this db::txn is used as a primary source in some cases where - /// indexers make a database query. This is useful when the sought data - /// has not even been written to the database, and this may even point to - /// the same db::txn as the result being composed in the first place. By - /// default a database query is made as a fallback after using this. - const db::txn *interpose {nullptr}; - - /// Whether indexers are allowed to make database queries when composing - /// the transaction. note: database queries may yield the ircd::ctx and - /// made indepdently; this is slow and requires external synchronization - /// to not introduce inconsistent data into the txn. - bool allow_queries {true}; - - /// Setting to true allows the event_idx to be 0 which allows the insertion - /// of the event_id into a "blacklist" to mark it as unprocessable; this - /// prevents the server from repeatedly trying to process an event. - /// - /// Note for now this just creates an entry in _event_idx of 0 for the - /// event_id which also means "not found" for most codepaths, a reasonable - /// default. But for codepaths that must distinguish between "not found" - /// and "blacklist" they must know that `event_id => 0` was *found* to be - /// zero. - bool blacklist {false}; -}; - -/// Values which represent some element(s) included in a transaction or -/// codepaths taken to construct a transaction. This enum is generally used -/// in a bitset in dbs::write_opts to control the behavior of dbs::write(). -/// -enum ircd::m::dbs::appendix::index -:std::underlying_type::type -{ - /// Involves the event_idx column; translates an event_id to our internal - /// index number. This bit can be dark during re-indexing operations. - EVENT_ID, - - /// Involves the event_json column; writes a full JSON serialization - /// of the event. See the `json_source` write_opts option. This bit can be - /// dark during re-indexing operations to avoid rewriting the same data. - EVENT_JSON, - - /// Involves any direct event columns; such columns are forward-indexed - /// values from the original event data but split into columns for each - /// property. Can be dark during re-indexing similar to EVENT_JSON. - EVENT_COLS, - - /// Take branch to handle event reference graphing. A separate bitset is - /// offered in write_opts for fine-grained control over which reference - /// types are involved. - EVENT_REFS, - - /// Involves the event_horizon column which saves the event_id of any - /// unresolved event_refs at the time of the transaction. This is important - /// for out-of-order writes to the database. When the unresolved prev_event - /// is encountered later and finds its event_id in event_horizon it can - /// properly complete the event_refs graph to all the referencing events. - EVENT_HORIZON, - - /// Resolves unresolved references for this event left in event_horizon. - EVENT_HORIZON_RESOLVE, - - /// Involves the event_sender column (reverse index on the event sender). - EVENT_SENDER, - - /// Involves the event_type column (reverse index on the event type). - EVENT_TYPE, - - /// Involves the event_state column. - EVENT_STATE, - - /// Involves room_events table. - ROOM_EVENTS, - - /// Involves room_type table. - ROOM_TYPE, - - /// Whether the event should be added to the room_head, indicating that - /// it has not yet been referenced at the time of this write. Defaults - /// to true, but if this is an older event this opt should be rethought. - ROOM_HEAD, - - /// Whether the event removes the prev_events it references from the - /// room_head. This defaults to true and should almost always be true. - ROOM_HEAD_RESOLVE, - - /// Involves room_state (present state) table. - ROOM_STATE, - - /// Involves room_space (all states) table. - ROOM_STATE_SPACE, - - /// Involves room_joined table. - ROOM_JOINED, - - /// Take branch to handle room redaction events. - ROOM_REDACT, -}; - -// Internal utils (here for now) +// Some internal utils (here for now) namespace ircd::m::dbs { - size_t prefetch_event_idx(const vector_view &in, const write_opts &); - bool prefetch_event_idx(const event::id &, const write_opts &); + size_t prefetch_event_idx(const vector_view &in, const opts &); + bool prefetch_event_idx(const event::id &, const opts &); - size_t find_event_idx(const vector_view &out, const vector_view &in, const write_opts &); - event::idx find_event_idx(const event::id &, const write_opts &); + size_t find_event_idx(const vector_view &out, const vector_view &in, const opts &); + event::idx find_event_idx(const event::id &, const opts &); } inline ircd::m::event::idx ircd::m::dbs::find_event_idx(const event::id &event_id, - const write_opts &wopts) + const opts &wopts) { event::idx ret{0}; const vector_view out(&ret, 1); @@ -217,7 +85,7 @@ ircd::m::dbs::find_event_idx(const event::id &event_id, inline bool ircd::m::dbs::prefetch_event_idx(const event::id &event_id, - const write_opts &wopts) + const opts &wopts) { const vector_view in(&event_id, 1); return prefetch_event_idx(in, wopts); diff --git a/include/ircd/m/dbs/event_column.h b/include/ircd/m/dbs/event_column.h index 8fd8a5ee9..1b069c855 100644 --- a/include/ircd/m/dbs/event_column.h +++ b/include/ircd/m/dbs/event_column.h @@ -25,7 +25,7 @@ namespace ircd::m::dbs event::size() }; - void _index_event_cols(db::txn &, const event &, const write_opts &); + void _index_event_cols(db::txn &, const event &, const opts &); // There is one position in this array corresponding to each property // in the m::event tuple, however, the db::column in this position may diff --git a/include/ircd/m/dbs/event_horizon.h b/include/ircd/m/dbs/event_horizon.h index 917bc531f..8ec327892 100644 --- a/include/ircd/m/dbs/event_horizon.h +++ b/include/ircd/m/dbs/event_horizon.h @@ -22,9 +22,9 @@ namespace ircd::m::dbs string_view event_horizon_key(const mutable_buffer &out, const id::event &); std::tuple event_horizon_key(const string_view &amalgam); - size_t _prefetch_event_horizon_resolve(const event &, const write_opts &); - void _index_event_horizon_resolve(db::txn &, const event &, const write_opts &); //query - void _index_event_horizon(db::txn &, const event &, const write_opts &, const id::event &); + size_t _prefetch_event_horizon_resolve(const event &, const opts &); + void _index_event_horizon_resolve(db::txn &, const event &, const opts &); //query + void _index_event_horizon(db::txn &, const event &, const opts &, const id::event &); // event_id | event_idx extern db::domain event_horizon; diff --git a/include/ircd/m/dbs/event_idx.h b/include/ircd/m/dbs/event_idx.h index bcf23108a..810f1ceb1 100644 --- a/include/ircd/m/dbs/event_idx.h +++ b/include/ircd/m/dbs/event_idx.h @@ -13,7 +13,7 @@ namespace ircd::m::dbs { - void _index_event_id(db::txn &, const event &, const write_opts &); + void _index_event_id(db::txn &, const event &, const opts &); extern db::column event_idx; // event_id => event_idx } diff --git a/include/ircd/m/dbs/event_json.h b/include/ircd/m/dbs/event_json.h index d3a40f391..c5b156164 100644 --- a/include/ircd/m/dbs/event_json.h +++ b/include/ircd/m/dbs/event_json.h @@ -13,7 +13,7 @@ namespace ircd::m::dbs { - void _index_event_json(db::txn &, const event &, const write_opts &); + void _index_event_json(db::txn &, const event &, const opts &); // event_idx => full json extern db::column event_json; diff --git a/include/ircd/m/dbs/event_refs.h b/include/ircd/m/dbs/event_refs.h index 36d497f2b..7504f675d 100644 --- a/include/ircd/m/dbs/event_refs.h +++ b/include/ircd/m/dbs/event_refs.h @@ -40,8 +40,8 @@ namespace ircd::m::dbs string_view reflect(const ref &); - size_t _prefetch_event_refs(const event &, const write_opts &); - void _index_event_refs(db::txn &, const event &, const write_opts &); + size_t _prefetch_event_refs(const event &, const opts &); + void _index_event_refs(db::txn &, const event &, const opts &); // event_idx | ref_type, event_idx extern db::domain event_refs; diff --git a/include/ircd/m/dbs/event_sender.h b/include/ircd/m/dbs/event_sender.h index b0170c08a..25ae34383 100644 --- a/include/ircd/m/dbs/event_sender.h +++ b/include/ircd/m/dbs/event_sender.h @@ -29,7 +29,7 @@ namespace ircd::m::dbs string_view event_sender_origin_key(const mutable_buffer &out, const id::user &, const event::idx &); std::tuple event_sender_origin_key(const string_view &amalgam); - void _index_event_sender(db::txn &, const event &, const write_opts &); + void _index_event_sender(db::txn &, const event &, const opts &); // mxid | event_idx // host | local, event_idx (see event_sender_origin.h) diff --git a/include/ircd/m/dbs/event_state.h b/include/ircd/m/dbs/event_state.h index cb10e629c..235f1818a 100644 --- a/include/ircd/m/dbs/event_state.h +++ b/include/ircd/m/dbs/event_state.h @@ -30,7 +30,7 @@ namespace ircd::m::dbs string_view event_state_key(const mutable_buffer &out, const event_state_tuple &); event_state_tuple event_state_key(const string_view &); - void _index_event_state(db::txn &, const event &, const write_opts &); + void _index_event_state(db::txn &, const event &, const opts &); // state_key, type, room_id, depth, event_idx extern db::domain event_state; diff --git a/include/ircd/m/dbs/event_type.h b/include/ircd/m/dbs/event_type.h index 5609bf784..f30e35780 100644 --- a/include/ircd/m/dbs/event_type.h +++ b/include/ircd/m/dbs/event_type.h @@ -21,7 +21,7 @@ namespace ircd::m::dbs string_view event_type_key(const mutable_buffer &out, const string_view &, const event::idx & = 0); std::tuple event_type_key(const string_view &amalgam); - void _index_event_type(db::txn &, const event &, const write_opts &); + void _index_event_type(db::txn &, const event &, const opts &); // type | event_idx => - extern db::domain event_type; diff --git a/include/ircd/m/dbs/opts.h b/include/ircd/m/dbs/opts.h new file mode 100644 index 000000000..d1c1bd88d --- /dev/null +++ b/include/ircd/m/dbs/opts.h @@ -0,0 +1,145 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2023 Jason Volk +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice is present in all copies. The +// full license for this software is available in the LICENSE file. + +#pragma once +#define HAVE_IRCD_M_DBS_OPTS_H + +/// Options that affect the dbs::write() of an event to the transaction. +struct ircd::m::dbs::opts +{ + static const std::bitset<256> event_refs_all; + static const std::bitset<64> appendix_all; + + /// Operation code; usually SET or DELETE. Note that we interpret the + /// code internally and may set different codes for appendages of the + /// actual transaction. + db::op op {db::op::SET}; + + /// Lower-level write options passed to the transaction's execution. + db::sopts sopts; + + /// Principal's index number. Most codepaths do not permit zero. This may + /// be zero for blacklisting, but the blacklist option must be set. + uint64_t event_idx {0}; + + /// Fuse panel to toggle transaction elements. + std::bitset<64> appendix {appendix_all}; + + /// Selection of what reference types to manipulate in event_refs. Refs + /// will not be made if it is not appropriate for the event anyway, so + /// this defaults to all bits. User can disable one or more ref types + /// by clearing a bit. + std::bitset<256> event_refs {event_refs_all}; + + /// Selection of what reference types to resolve and delete from the + /// event_horizon for this event. + std::bitset<256> horizon_resolve {event_refs_all}; + + /// Whether the event.source can be used directly for event_json. Defaults + /// to false unless the caller wants to avoid a redundant re-stringify. + bool json_source {false}; + + /// Data in this db::txn is used as a primary source in some cases where + /// indexers make a database query. This is useful when the sought data + /// has not even been written to the database, and this may even point to + /// the same db::txn as the result being composed in the first place. By + /// default a database query is made as a fallback after using this. + const db::txn *interpose {nullptr}; + + /// Whether indexers are allowed to make database queries when composing + /// the transaction. note: database queries may yield the ircd::ctx and + /// made indepdently; this is slow and requires external synchronization + /// to not introduce inconsistent data into the txn. + bool allow_queries {true}; + + /// Setting to true allows the event_idx to be 0 which allows the insertion + /// of the event_id into a "blacklist" to mark it as unprocessable; this + /// prevents the server from repeatedly trying to process an event. + /// + /// Note for now this just creates an entry in _event_idx of 0 for the + /// event_id which also means "not found" for most codepaths, a reasonable + /// default. But for codepaths that must distinguish between "not found" + /// and "blacklist" they must know that `event_id => 0` was *found* to be + /// zero. + bool blacklist {false}; +}; + +/// Values which represent some element(s) included in a transaction or +/// codepaths taken to construct a transaction. This enum is generally used +/// in a bitset in dbs::opts to control the behavior of dbs::write(). +/// +enum ircd::m::dbs::appendix::index +:std::underlying_type::type +{ + /// Involves the event_idx column; translates an event_id to our internal + /// index number. This bit can be dark during re-indexing operations. + EVENT_ID, + + /// Involves the event_json column; writes a full JSON serialization + /// of the event. See the `json_source` opts option. This bit can be + /// dark during re-indexing operations to avoid rewriting the same data. + EVENT_JSON, + + /// Involves any direct event columns; such columns are forward-indexed + /// values from the original event data but split into columns for each + /// property. Can be dark during re-indexing similar to EVENT_JSON. + EVENT_COLS, + + /// Take branch to handle event reference graphing. A separate bitset is + /// offered in opts for fine-grained control over which reference + /// types are involved. + EVENT_REFS, + + /// Involves the event_horizon column which saves the event_id of any + /// unresolved event_refs at the time of the transaction. This is important + /// for out-of-order writes to the database. When the unresolved prev_event + /// is encountered later and finds its event_id in event_horizon it can + /// properly complete the event_refs graph to all the referencing events. + EVENT_HORIZON, + + /// Resolves unresolved references for this event left in event_horizon. + EVENT_HORIZON_RESOLVE, + + /// Involves the event_sender column (reverse index on the event sender). + EVENT_SENDER, + + /// Involves the event_type column (reverse index on the event type). + EVENT_TYPE, + + /// Involves the event_state column. + EVENT_STATE, + + /// Involves room_events table. + ROOM_EVENTS, + + /// Involves room_type table. + ROOM_TYPE, + + /// Whether the event should be added to the room_head, indicating that + /// it has not yet been referenced at the time of this write. Defaults + /// to true, but if this is an older event this opt should be rethought. + ROOM_HEAD, + + /// Whether the event removes the prev_events it references from the + /// room_head. This defaults to true and should almost always be true. + ROOM_HEAD_RESOLVE, + + /// Involves room_state (present state) table. + ROOM_STATE, + + /// Involves room_space (all states) table. + ROOM_STATE_SPACE, + + /// Involves room_joined table. + ROOM_JOINED, + + /// Take branch to handle room redaction events. + ROOM_REDACT, +}; diff --git a/include/ircd/m/dbs/room_events.h b/include/ircd/m/dbs/room_events.h index c3c1858f7..2b96f07c2 100644 --- a/include/ircd/m/dbs/room_events.h +++ b/include/ircd/m/dbs/room_events.h @@ -22,7 +22,7 @@ namespace ircd::m::dbs string_view room_events_key(const mutable_buffer &out, const id::room &, const uint64_t &depth); std::tuple room_events_key(const string_view &amalgam); - void _index_room_events(db::txn &, const event &, const write_opts &); + void _index_room_events(db::txn &, const event &, const opts &); // room_id | depth, event_idx => node_id extern db::domain room_events; diff --git a/include/ircd/m/dbs/room_head.h b/include/ircd/m/dbs/room_head.h index 8870db595..59d6cc3ac 100644 --- a/include/ircd/m/dbs/room_head.h +++ b/include/ircd/m/dbs/room_head.h @@ -21,8 +21,8 @@ namespace ircd::m::dbs string_view room_head_key(const mutable_buffer &out, const id::room &, const id::event &); string_view room_head_key(const string_view &amalgam); - void _index_room_head_resolve(db::txn &, const event &, const write_opts &); - void _index_room_head(db::txn &, const event &, const write_opts &); + void _index_room_head_resolve(db::txn &, const event &, const opts &); + void _index_room_head(db::txn &, const event &, const opts &); // room_id | event_id => event_idx extern db::domain room_head; diff --git a/include/ircd/m/dbs/room_joined.h b/include/ircd/m/dbs/room_joined.h index 780a7495c..cfc10746b 100644 --- a/include/ircd/m/dbs/room_joined.h +++ b/include/ircd/m/dbs/room_joined.h @@ -22,7 +22,7 @@ namespace ircd::m::dbs string_view room_joined_key(const mutable_buffer &out, const id::room &, const string_view &origin); std::tuple room_joined_key(const string_view &amalgam); - void _index_room_joined(db::txn &, const event &, const write_opts &); + void _index_room_joined(db::txn &, const event &, const opts &); // room_id | origin, member => event_idx extern db::domain room_joined; diff --git a/include/ircd/m/dbs/room_state.h b/include/ircd/m/dbs/room_state.h index acf843fa4..c422b2d29 100644 --- a/include/ircd/m/dbs/room_state.h +++ b/include/ircd/m/dbs/room_state.h @@ -22,7 +22,7 @@ namespace ircd::m::dbs string_view room_state_key(const mutable_buffer &out, const id::room &, const string_view &type); std::tuple room_state_key(const string_view &amalgam); - void _index_room_state(db::txn &, const event &, const write_opts &); + void _index_room_state(db::txn &, const event &, const opts &); // room_id | type, state_key => event_idx extern db::domain room_state; diff --git a/include/ircd/m/dbs/room_state_space.h b/include/ircd/m/dbs/room_state_space.h index 73271bf72..8c2969e44 100644 --- a/include/ircd/m/dbs/room_state_space.h +++ b/include/ircd/m/dbs/room_state_space.h @@ -30,7 +30,7 @@ namespace ircd::m::dbs string_view room_state_space_key(const mutable_buffer &out, const id::room &); room_state_space_key_parts room_state_space_key(const string_view &amalgam); - void _index_room_state_space(db::txn &, const event &, const write_opts &); + void _index_room_state_space(db::txn &, const event &, const opts &); // room_id | type, state_key, depth, event_idx => -- extern db::domain room_state_space; diff --git a/include/ircd/m/dbs/room_type.h b/include/ircd/m/dbs/room_type.h index b1ea3a0ba..383b04fe3 100644 --- a/include/ircd/m/dbs/room_type.h +++ b/include/ircd/m/dbs/room_type.h @@ -35,7 +35,7 @@ namespace ircd::m::dbs const uint64_t &depth = -1, const event::idx & = -1); - void _index_room_type(db::txn &, const event &, const write_opts &); + void _index_room_type(db::txn &, const event &, const opts &); // room_id | type, depth, event_idx extern db::domain room_type; diff --git a/include/ircd/m/vm/opts.h b/include/ircd/m/vm/opts.h index a9d6e8fed..27293bc5e 100644 --- a/include/ircd/m/vm/opts.h +++ b/include/ircd/m/vm/opts.h @@ -35,8 +35,8 @@ struct ircd::m::vm::opts /// Enabled phases of evaluation. std::bitset()> phase {-1UL}; - /// Custom write_opts to use during write. - dbs::write_opts wopts; + /// Custom dbs::opts to use during write. + dbs::opts wopts; /// Broadcast to local clients (/sync stream). bool notify_clients {true}; diff --git a/matrix/dbs.cc b/matrix/dbs.cc index f39aa024e..7339c04ab 100644 --- a/matrix/dbs.cc +++ b/matrix/dbs.cc @@ -34,7 +34,7 @@ ircd::m::dbs::cache_comp_enable /// Coarse toggle for the prefetch phase before the transaction building /// handlers (indexers) are called. If this is false, prefetching will be -/// disabled; otherwise the write_opts passed to write() control whether +/// disabled; otherwise the opts passed to write() control whether /// prefetching is enabled. decltype(ircd::m::dbs::prefetch_enable) ircd::m::dbs::prefetch_enable @@ -74,11 +74,11 @@ ircd::m::dbs::sst_write_buffer_size }; // -// write_opts +// opts // -decltype(ircd::m::dbs::write_opts::event_refs_all) -ircd::m::dbs::write_opts::event_refs_all{[] +decltype(ircd::m::dbs::opts::event_refs_all) +ircd::m::dbs::opts::event_refs_all{[] { char full[event_refs_all.size()]; memset(full, '1', sizeof(full)); @@ -88,8 +88,8 @@ ircd::m::dbs::write_opts::event_refs_all{[] }; }()}; -decltype(ircd::m::dbs::write_opts::appendix_all) -ircd::m::dbs::write_opts::appendix_all{[] +decltype(ircd::m::dbs::opts::appendix_all) +ircd::m::dbs::opts::appendix_all{[] { char full[appendix_all.size()]; memset(full, '1', sizeof(full)); @@ -105,15 +105,15 @@ ircd::m::dbs::write_opts::appendix_all{[] namespace ircd::m::dbs { - static size_t _prefetch(const event &, const write_opts &); - static size_t _index(db::txn &, const event &, const write_opts &); - static size_t blacklist(db::txn &txn, const event::id &, const write_opts &); + static size_t _prefetch(const event &, const opts &); + static size_t _index(db::txn &, const event &, const opts &); + static size_t blacklist(db::txn &txn, const event::id &, const opts &); } size_t ircd::m::dbs::write(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) try { if(opts.event_idx == 0 && opts.blacklist) @@ -141,7 +141,7 @@ catch(const std::exception &e) size_t ircd::m::dbs::prefetch(const event &event, - const write_opts &opts) + const opts &opts) try { if(!prefetch_enable) @@ -164,7 +164,7 @@ catch(const std::exception &e) size_t ircd::m::dbs::blacklist(db::txn &txn, const event::id &event_id, - const write_opts &opts) + const opts &opts) { // An entry in the event_idx column with a value 0 is blacklisting // because 0 is not a valid event_idx. Thus a value here can only @@ -197,20 +197,20 @@ ircd::m::dbs::blacklist(db::txn &txn, namespace ircd::m::dbs { - static size_t _prefetch_room_redact(const event &, const write_opts &); - static void _index_room_redact(db::txn &, const event &, const write_opts &); + static size_t _prefetch_room_redact(const event &, const opts &); + static void _index_room_redact(db::txn &, const event &, const opts &); - static size_t _prefetch_room(const event &, const write_opts &); - static void _index_room(db::txn &, const event &, const write_opts &); + static size_t _prefetch_room(const event &, const opts &); + static void _index_room(db::txn &, const event &, const opts &); - static size_t _prefetch_event(const event &, const write_opts &); - static void _index_event(db::txn &, const event &, const write_opts &); + static size_t _prefetch_event(const event &, const opts &); + static void _index_event(db::txn &, const event &, const opts &); } size_t ircd::m::dbs::_index(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { size_t ret(0); _index_event(txn, event, opts); @@ -223,7 +223,7 @@ ircd::m::dbs::_index(db::txn &txn, size_t ircd::m::dbs::_prefetch(const event &event, - const write_opts &opts) + const opts &opts) { size_t ret(0); ret += _prefetch_event(event, opts); @@ -237,7 +237,7 @@ ircd::m::dbs::_prefetch(const event &event, void ircd::m::dbs::_index_event(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { if(opts.appendix.test(appendix::EVENT_ID)) _index_event_id(txn, event, opts); @@ -266,7 +266,7 @@ ircd::m::dbs::_index_event(db::txn &txn, size_t ircd::m::dbs::_prefetch_event(const event &event, - const write_opts &opts) + const opts &opts) { size_t ret(0); if(opts.appendix.test(appendix::EVENT_ID)) @@ -299,7 +299,7 @@ ircd::m::dbs::_prefetch_event(const event &event, void ircd::m::dbs::_index_room(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(!empty(json::get<"room_id"_>(event))); @@ -330,7 +330,7 @@ ircd::m::dbs::_index_room(db::txn &txn, size_t ircd::m::dbs::_prefetch_room(const event &event, - const write_opts &opts) + const opts &opts) { assert(!empty(json::get<"room_id"_>(event))); @@ -366,7 +366,7 @@ ircd::m::dbs::_prefetch_room(const event &event, void ircd::m::dbs::_index_room_redact(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_REDACT)); assert(json::get<"type"_>(event) == "m.room.redaction"); @@ -431,7 +431,7 @@ ircd::m::dbs::_index_room_redact(db::txn &txn, size_t ircd::m::dbs::_prefetch_room_redact(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_REDACT)); assert(json::get<"type"_>(event) == "m.room.redaction"); @@ -464,7 +464,7 @@ ircd::m::dbs::_prefetch_room_redact(const event &event, size_t ircd::m::dbs::find_event_idx(const vector_view &idx, const vector_view &event_id, - const write_opts &wopts) + const opts &wopts) { const size_t num { @@ -501,7 +501,7 @@ ircd::m::dbs::find_event_idx(const vector_view &idx, size_t ircd::m::dbs::prefetch_event_idx(const vector_view &event_id, - const write_opts &wopts) + const opts &wopts) { size_t ret(0); for(size_t i(0); i < event_id.size(); ++i) diff --git a/matrix/dbs_event_column.cc b/matrix/dbs_event_column.cc index 9571b8021..f54644f09 100644 --- a/matrix/dbs_event_column.cc +++ b/matrix/dbs_event_column.cc @@ -713,7 +713,7 @@ ircd::m::dbs::desc::depth void ircd::m::dbs::_index_event_cols(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_COLS)); assert(opts.event_idx); diff --git a/matrix/dbs_event_horizon.cc b/matrix/dbs_event_horizon.cc index c7753e158..cf56f8954 100644 --- a/matrix/dbs_event_horizon.cc +++ b/matrix/dbs_event_horizon.cc @@ -120,14 +120,14 @@ ircd::m::dbs::desc::event_horizon namespace ircd::m::dbs { - static void _index_event_horizon_resolve_one(db::txn &, const event &, const write_opts &, const event::idx &); + static void _index_event_horizon_resolve_one(db::txn &, const event &, const opts &, const event::idx &); } // NOTE: QUERY void ircd::m::dbs::_index_event_horizon_resolve(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_HORIZON_RESOLVE)); assert(opts.event_idx != 0); @@ -159,7 +159,7 @@ ircd::m::dbs::_index_event_horizon_resolve(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_horizon_resolve(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_HORIZON_RESOLVE)); @@ -191,7 +191,7 @@ ircd::m::dbs::_prefetch_event_horizon_resolve(const event &event, void ircd::m::dbs::_index_event_horizon_resolve_one(db::txn &txn, const event &event, - const write_opts &opts, + const opts &opts, const event::idx &event_idx) { assert(event_idx != 0); @@ -225,7 +225,7 @@ ircd::m::dbs::_index_event_horizon_resolve_one(db::txn &txn, }; // Make the references on behalf of the future event - write_opts _opts; + dbs::opts _opts; _opts.op = opts.op; _opts.event_idx = event_idx; _opts.appendix.reset(); @@ -258,7 +258,7 @@ ircd::m::dbs::_index_event_horizon_resolve_one(db::txn &txn, void ircd::m::dbs::_index_event_horizon(db::txn &txn, const event &event, - const write_opts &opts, + const opts &opts, const m::event::id &unresolved_id) { thread_local char buf[EVENT_HORIZON_KEY_MAX_SIZE]; diff --git a/matrix/dbs_event_idx.cc b/matrix/dbs_event_idx.cc index 9a747bb5d..051eff87e 100644 --- a/matrix/dbs_event_idx.cc +++ b/matrix/dbs_event_idx.cc @@ -108,7 +108,7 @@ ircd::m::dbs::desc::event_idx void ircd::m::dbs::_index_event_id(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_ID)); assert(opts.event_idx); diff --git a/matrix/dbs_event_json.cc b/matrix/dbs_event_json.cc index 5682a76fe..fab9bca9e 100644 --- a/matrix/dbs_event_json.cc +++ b/matrix/dbs_event_json.cc @@ -113,7 +113,7 @@ ircd::m::dbs::desc::event_json void ircd::m::dbs::_index_event_json(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { const ctx::critical_assertion ca; assert(opts.appendix.test(appendix::EVENT_JSON)); diff --git a/matrix/dbs_event_refs.cc b/matrix/dbs_event_refs.cc index 9a6265cab..7a2850a4b 100644 --- a/matrix/dbs_event_refs.cc +++ b/matrix/dbs_event_refs.cc @@ -10,20 +10,20 @@ namespace ircd::m::dbs { - static size_t _prefetch_event_refs_m_room_redaction(const event &, const write_opts &); - static void _index_event_refs_m_room_redaction(db::txn &, const event &, const write_opts &); //query - static size_t _prefetch_event_refs_m_receipt_m_read(const event &, const write_opts &); - static void _index_event_refs_m_receipt_m_read(db::txn &, const event &, const write_opts &); //query - static size_t _prefetch_event_refs_m_relates_m_reply(const event &, const write_opts &); - static void _index_event_refs_m_relates_m_reply(db::txn &, const event &, const write_opts &); //query - static size_t _prefetch_event_refs_m_relates(const event &, const write_opts &); - static void _index_event_refs_m_relates(db::txn &, const event &, const write_opts &); //query - static size_t _prefetch_event_refs_state(const event &, const write_opts &); - static void _index_event_refs_state(db::txn &, const event &, const write_opts &); // query - static size_t _prefetch_event_refs_auth(const event &, const write_opts &); - static void _index_event_refs_auth(db::txn &, const event &, const write_opts &); //query - static size_t _prefetch_event_refs_prev(const event &, const write_opts &); - static void _index_event_refs_prev(db::txn &, const event &, const write_opts &); //query + static size_t _prefetch_event_refs_m_room_redaction(const event &, const opts &); + static void _index_event_refs_m_room_redaction(db::txn &, const event &, const opts &); //query + static size_t _prefetch_event_refs_m_receipt_m_read(const event &, const opts &); + static void _index_event_refs_m_receipt_m_read(db::txn &, const event &, const opts &); //query + static size_t _prefetch_event_refs_m_relates_m_reply(const event &, const opts &); + static void _index_event_refs_m_relates_m_reply(db::txn &, const event &, const opts &); //query + static size_t _prefetch_event_refs_m_relates(const event &, const opts &); + static void _index_event_refs_m_relates(db::txn &, const event &, const opts &); //query + static size_t _prefetch_event_refs_state(const event &, const opts &); + static void _index_event_refs_state(db::txn &, const event &, const opts &); // query + static size_t _prefetch_event_refs_auth(const event &, const opts &); + static void _index_event_refs_auth(db::txn &, const event &, const opts &); //query + static size_t _prefetch_event_refs_prev(const event &, const opts &); + static void _index_event_refs_prev(db::txn &, const event &, const opts &); //query static bool event_refs__cmp_less(const string_view &a, const string_view &b); } @@ -153,7 +153,7 @@ ircd::m::dbs::desc::event_refs void ircd::m::dbs::_index_event_refs(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); @@ -182,7 +182,7 @@ ircd::m::dbs::_index_event_refs(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); @@ -216,7 +216,7 @@ ircd::m::dbs::_prefetch_event_refs(const event &event, void ircd::m::dbs::_index_event_refs_prev(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::NEXT))); @@ -277,7 +277,7 @@ ircd::m::dbs::_index_event_refs_prev(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs_prev(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::NEXT))); @@ -300,7 +300,7 @@ ircd::m::dbs::_prefetch_event_refs_prev(const event &event, void ircd::m::dbs::_index_event_refs_auth(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::NEXT_AUTH))); @@ -362,7 +362,7 @@ ircd::m::dbs::_index_event_refs_auth(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs_auth(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::NEXT_AUTH))); @@ -388,7 +388,7 @@ ircd::m::dbs::_prefetch_event_refs_auth(const event &event, void ircd::m::dbs::_index_event_refs_state(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::NEXT_STATE)) || @@ -466,7 +466,7 @@ ircd::m::dbs::_index_event_refs_state(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs_state(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::NEXT_STATE)) || @@ -494,7 +494,7 @@ ircd::m::dbs::_prefetch_event_refs_state(const event &event, void ircd::m::dbs::_index_event_refs_m_receipt_m_read(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_RECEIPT__M_READ))); @@ -556,7 +556,7 @@ ircd::m::dbs::_index_event_refs_m_receipt_m_read(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs_m_receipt_m_read(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_RECEIPT__M_READ))); @@ -582,7 +582,7 @@ ircd::m::dbs::_prefetch_event_refs_m_receipt_m_read(const event &event, void ircd::m::dbs::_index_event_refs_m_relates(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_RELATES))); @@ -663,7 +663,7 @@ ircd::m::dbs::_index_event_refs_m_relates(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs_m_relates(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_RELATES))); @@ -696,7 +696,7 @@ ircd::m::dbs::_prefetch_event_refs_m_relates(const event &event, void ircd::m::dbs::_index_event_refs_m_relates_m_reply(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_RELATES))); @@ -758,7 +758,7 @@ ircd::m::dbs::_index_event_refs_m_relates_m_reply(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs_m_relates_m_reply(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_RELATES))); @@ -786,7 +786,7 @@ ircd::m::dbs::_prefetch_event_refs_m_relates_m_reply(const event &event, void ircd::m::dbs::_index_event_refs_m_room_redaction(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_ROOM_REDACTION))); @@ -843,7 +843,7 @@ ircd::m::dbs::_index_event_refs_m_room_redaction(db::txn &txn, size_t ircd::m::dbs::_prefetch_event_refs_m_room_redaction(const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_REFS)); assert(opts.event_refs.test(uint(ref::M_ROOM_REDACTION))); diff --git a/matrix/dbs_event_sender.cc b/matrix/dbs_event_sender.cc index 9da81076b..57c824e50 100644 --- a/matrix/dbs_event_sender.cc +++ b/matrix/dbs_event_sender.cc @@ -134,7 +134,7 @@ ircd::m::dbs::desc::event_sender void ircd::m::dbs::_index_event_sender(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_SENDER)); assert(json::get<"sender"_>(event)); diff --git a/matrix/dbs_event_state.cc b/matrix/dbs_event_state.cc index a4652f496..2265682a9 100644 --- a/matrix/dbs_event_state.cc +++ b/matrix/dbs_event_state.cc @@ -107,7 +107,7 @@ ircd::m::dbs::desc::event_state void ircd::m::dbs::_index_event_state(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_STATE)); assert(json::get<"type"_>(event)); diff --git a/matrix/dbs_event_type.cc b/matrix/dbs_event_type.cc index 52f5a18b6..94232e890 100644 --- a/matrix/dbs_event_type.cc +++ b/matrix/dbs_event_type.cc @@ -110,7 +110,7 @@ ircd::m::dbs::desc::event_type void ircd::m::dbs::_index_event_type(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::EVENT_TYPE)); assert(json::get<"type"_>(event)); diff --git a/matrix/dbs_room_events.cc b/matrix/dbs_room_events.cc index e453442f7..acc6be7ba 100644 --- a/matrix/dbs_room_events.cc +++ b/matrix/dbs_room_events.cc @@ -175,7 +175,7 @@ ircd::m::dbs::desc::room_events void ircd::m::dbs::_index_room_events(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_EVENTS)); diff --git a/matrix/dbs_room_head.cc b/matrix/dbs_room_head.cc index 55ac897f9..d9527b8b6 100644 --- a/matrix/dbs_room_head.cc +++ b/matrix/dbs_room_head.cc @@ -150,7 +150,7 @@ ircd::m::dbs::desc::room_head void ircd::m::dbs::_index_room_head(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_HEAD)); assert(opts.event_idx); @@ -177,7 +177,7 @@ ircd::m::dbs::_index_room_head(db::txn &txn, void ircd::m::dbs::_index_room_head_resolve(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_HEAD_RESOLVE)); diff --git a/matrix/dbs_room_joined.cc b/matrix/dbs_room_joined.cc index 6e37c735e..3b7ad2178 100644 --- a/matrix/dbs_room_joined.cc +++ b/matrix/dbs_room_joined.cc @@ -149,7 +149,7 @@ ircd::m::dbs::desc::room_joined void ircd::m::dbs::_index_room_joined(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_JOINED)); assert(at<"type"_>(event) == "m.room.member"); diff --git a/matrix/dbs_room_state.cc b/matrix/dbs_room_state.cc index 6a1aaed26..52c5a38ce 100644 --- a/matrix/dbs_room_state.cc +++ b/matrix/dbs_room_state.cc @@ -157,7 +157,7 @@ ircd::m::dbs::desc::room_state void ircd::m::dbs::_index_room_state(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_STATE)); diff --git a/matrix/dbs_room_state_space.cc b/matrix/dbs_room_state_space.cc index 4b5b03e0c..21f621e57 100644 --- a/matrix/dbs_room_state_space.cc +++ b/matrix/dbs_room_state_space.cc @@ -157,7 +157,7 @@ ircd::m::dbs::desc::room_state_space void ircd::m::dbs::_index_room_state_space(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_STATE_SPACE)); diff --git a/matrix/dbs_room_type.cc b/matrix/dbs_room_type.cc index 231861ba8..cd2baf3f3 100644 --- a/matrix/dbs_room_type.cc +++ b/matrix/dbs_room_type.cc @@ -166,7 +166,7 @@ ircd::m::dbs::desc::room_type void ircd::m::dbs::_index_room_type(db::txn &txn, const event &event, - const write_opts &opts) + const opts &opts) { assert(opts.appendix.test(appendix::ROOM_TYPE)); diff --git a/matrix/event_horizon.cc b/matrix/event_horizon.cc index 7d299b52e..27b5904bc 100644 --- a/matrix/event_horizon.cc +++ b/matrix/event_horizon.cc @@ -11,13 +11,13 @@ //TODO: XXX remove fwd decl namespace ircd::m::dbs { - void _index_event_horizon(db::txn &, const event &, const write_opts &, const m::event::id &); + void _index_event_horizon(db::txn &, const event &, const opts &, const m::event::id &); } size_t ircd::m::event::horizon::rebuild() { - m::dbs::write_opts opts; + m::dbs::opts opts; opts.appendix.reset(); opts.appendix.set(dbs::appendix::EVENT_HORIZON); db::txn txn diff --git a/matrix/event_purge.cc b/matrix/event_purge.cc index 556fb82b3..9a0832906 100644 --- a/matrix/event_purge.cc +++ b/matrix/event_purge.cc @@ -44,7 +44,7 @@ ircd::m::event::purge::purge(db::txn &txn, const event &event) :returns{false} { - m::dbs::write_opts opts; + m::dbs::opts opts; opts.op = db::op::DELETE; opts.event_idx = event_idx; m::dbs::write(txn, event, opts); diff --git a/matrix/event_refs.cc b/matrix/event_refs.cc index 359a0492b..97e95a81f 100644 --- a/matrix/event_refs.cc +++ b/matrix/event_refs.cc @@ -53,7 +53,7 @@ ircd::m::event::refs::rebuild() std::string event{it->second}; pool([&txn, &dock, &i, &j, event(std::move(event)), event_idx] { - m::dbs::write_opts wopts; + m::dbs::opts wopts; wopts.event_idx = event_idx; wopts.appendix.reset(); wopts.appendix.set(dbs::appendix::EVENT_REFS); diff --git a/matrix/events.cc b/matrix/events.cc index 90b355148..b3028e2a8 100644 --- a/matrix/events.cc +++ b/matrix/events.cc @@ -38,7 +38,7 @@ ircd::m::events::rebuild() *m::dbs::events }; - dbs::write_opts wopts; + dbs::opts wopts; wopts.appendix.reset(); wopts.appendix.set(dbs::appendix::EVENT_TYPE); wopts.appendix.set(dbs::appendix::EVENT_SENDER); diff --git a/matrix/room_events.cc b/matrix/room_events.cc index d6655981a..ef4df22ec 100644 --- a/matrix/room_events.cc +++ b/matrix/room_events.cc @@ -634,13 +634,13 @@ const //TODO: XXX remove fwd decl namespace ircd::m::dbs { - void _index_event_horizon(db::txn &, const event &, const write_opts &, const m::event::id &); + void _index_event_horizon(db::txn &, const event &, const opts &, const m::event::id &); } size_t ircd::m::room::events::horizon::rebuild() { - m::dbs::write_opts opts; + m::dbs::opts opts; opts.appendix.reset(); opts.appendix.set(dbs::appendix::EVENT_HORIZON); db::txn txn diff --git a/matrix/room_head.cc b/matrix/room_head.cc index 9033d7370..ffc9131f2 100644 --- a/matrix/room_head.cc +++ b/matrix/room_head.cc @@ -302,7 +302,7 @@ ircd::m::room::head::reset(const head &head) }; // Iterate all of the existing heads with a delete operation - m::dbs::write_opts opts; + m::dbs::opts opts; opts.op = db::op::DELETE; opts.appendix.reset(); opts.appendix.set(dbs::appendix::ROOM_HEAD); @@ -368,7 +368,7 @@ ircd::m::room::head::rebuild(const head &head) *m::dbs::events }; - m::dbs::write_opts opts; + m::dbs::opts opts; opts.op = db::op::SET; for(; it; ++it) { @@ -400,7 +400,7 @@ ircd::m::room::head::modify(const m::event::id &event_id, }; // Iterate all of the existing heads with a delete operation - m::dbs::write_opts opts; + m::dbs::opts opts; opts.op = op; opts.event_idx = event.event_idx; opts.appendix.reset(); diff --git a/matrix/room_state.cc b/matrix/room_state.cc index 1de52d1de..4c06deaab 100644 --- a/matrix/room_state.cc +++ b/matrix/room_state.cc @@ -901,7 +901,7 @@ ircd::m::room::state::rebuild::rebuild(const room::id &room_id) !m::internal(room_id) }; - m::dbs::write_opts opts; + m::dbs::opts opts; opts.appendix.reset(); opts.appendix.set(dbs::appendix::ROOM_STATE); opts.appendix.set(dbs::appendix::ROOM_JOINED); diff --git a/matrix/room_state_space.cc b/matrix/room_state_space.cc index 8dbb509a9..f0f3423f1 100644 --- a/matrix/room_state_space.cc +++ b/matrix/room_state_space.cc @@ -259,7 +259,7 @@ ircd::m::room::state::space::rebuild::rebuild(const room::id &room_id) what(reason_relative), }; - dbs::write_opts opts; + dbs::opts opts; opts.event_idx = event_idx; opts.appendix.reset(); diff --git a/matrix/vm_eval.cc b/matrix/vm_eval.cc index fe12c43bc..a5fd5f9e8 100644 --- a/matrix/vm_eval.cc +++ b/matrix/vm_eval.cc @@ -41,7 +41,7 @@ size_t ircd::m::vm::prefetch_refs(const eval &eval) { assert(eval.opts); - const dbs::write_opts &wopts + const dbs::opts &wopts { eval.opts->wopts }; diff --git a/matrix/vm_execute.cc b/matrix/vm_execute.cc index dd470a547..da45c3381 100644 --- a/matrix/vm_execute.cc +++ b/matrix/vm_execute.cc @@ -943,7 +943,7 @@ ircd::m::vm::execute_pdu(eval &eval, eval.phase, phase::PREINDEX }; - dbs::write_opts wopts(opts.wopts); + dbs::opts wopts(opts.wopts); wopts.event_idx = eval.sequence; const size_t prefetched { @@ -1251,7 +1251,7 @@ ircd::m::vm::write_append(eval &eval, *eval.txn }; - m::dbs::write_opts wopts(opts.wopts); + m::dbs::opts wopts(opts.wopts); wopts.interpose = eval.txn.get(); wopts.event_idx = eval.sequence; wopts.json_source = true; diff --git a/modules/console.cc b/modules/console.cc index dd2470ae6..3f62a6f9d 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -8582,7 +8582,7 @@ console_cmd__event__rewrite(opt &out, const string_view &line) event_id }; - m::dbs::write_opts opts; + m::dbs::opts opts; opts.op = db::op::SET; opts.event_idx = event.event_idx;