diff --git a/include/shirakami/api_sequence.h b/include/shirakami/api_sequence.h index f01c18978..b1afbb474 100644 --- a/include/shirakami/api_sequence.h +++ b/include/shirakami/api_sequence.h @@ -41,7 +41,7 @@ using SequenceVersion = std::size_t; * @note This function is not intended to be called concurrently with running * transactions. Typical usage is in DDL to register sequence objects. */ -Status create_sequence(SequenceId* id); // NOLINT +Status create_sequence(SequenceId* id); // LINT /** * @brief update sequence value and version. @@ -94,7 +94,7 @@ Status update_sequence(Token token, SequenceId id, SequenceVersion version, * time of database recovery. */ Status read_sequence(SequenceId id, SequenceVersion* version, - SequenceValue* value); // NOLINT + SequenceValue* value); // LINT /** * @brief delete the sequence @@ -107,6 +107,6 @@ Status read_sequence(SequenceId id, SequenceVersion* version, * @note This function is not intended to be called concurrently with running * transactions. Typical usage is in DDL to unregister sequence objects. */ -Status delete_sequence(SequenceId id); // NOLINT +Status delete_sequence(SequenceId id); // LINT } // namespace shirakami diff --git a/include/shirakami/api_storage.h b/include/shirakami/api_storage.h index 5def15327..ff30657ca 100644 --- a/include/shirakami/api_storage.h +++ b/include/shirakami/api_storage.h @@ -25,7 +25,7 @@ namespace shirakami { * Please review your usage. */ Status create_storage(std::string_view key, Storage& storage, - storage_option const& options = {}); // NOLINT + storage_option const& options = {}); // LINT /** * @brief delete existing storage and records under the storage. diff --git a/include/shirakami/binary_printer.h b/include/shirakami/binary_printer.h index c8597cfd1..ed9e4e02f 100644 --- a/include/shirakami/binary_printer.h +++ b/include/shirakami/binary_printer.h @@ -36,7 +36,7 @@ class binary_printer { std::ios init(nullptr); init.copyfmt(out); for (std::size_t idx = 0; idx < value.size_; ++idx) { - auto c = *(static_cast(value.ptr_) + // NOLINT + auto c = *(static_cast(value.ptr_) + // LINT idx); if (std::isprint(c) != 0) { out << c; @@ -45,7 +45,7 @@ class binary_printer { out << std::hex << std::setw(2) << std::setfill('0') << static_cast( *(static_cast( - value.ptr_) + // NOLINT + value.ptr_) + // LINT idx)); } } diff --git a/include/shirakami/database_options.h b/include/shirakami/database_options.h index 74cab986c..7dc46ed98 100644 --- a/include/shirakami/database_options.h +++ b/include/shirakami/database_options.h @@ -14,9 +14,9 @@ class database_options final { MAINTENANCE = 0x004, }; - database_options() = default; // NOLINT + database_options() = default; // LINT - database_options(open_mode om) : open_mode_(om) {} // NOLINT + database_options(open_mode om) : open_mode_(om) {} // LINT database_options(open_mode om, std::filesystem::path&& log_directory_path) : open_mode_(om), log_directory_path_(log_directory_path) {} @@ -99,7 +99,7 @@ class database_options final { /** * @brief Parameter of epoch [us] */ - std::size_t epoch_time_{40000}; // NOLINT + std::size_t epoch_time_{40000}; // LINT // ========== // ========== diff --git a/include/shirakami/interface.h b/include/shirakami/interface.h index ba5003f36..0eab3cc46 100644 --- a/include/shirakami/interface.h +++ b/include/shirakami/interface.h @@ -33,7 +33,7 @@ namespace shirakami { * wait the result. * @return Status::WARN_NOT_BEGIN This transaction was not begun. */ -Status abort(Token token); // NOLINT +Status abort(Token token); // LINT /** * @brief close the scan which was opened at open_scan. @@ -44,7 +44,7 @@ Status abort(Token token); // NOLINT * @return Status::WARN_NOT_BEGIN The transaction was not begun. So it * can't execute it. */ -Status close_scan(Token token, ScanHandle handle); // NOLINT +Status close_scan(Token token, ScanHandle handle); // LINT /** * @brief commit function with result notified by callback @@ -76,7 +76,7 @@ bool commit(Token token, commit_callback_type callback); /** * @brief old api. it is planed to remove from api. */ -Status commit(Token token); // NOLINT +Status commit(Token token); // LINT /** * @brief delete the record for the given key @@ -107,7 +107,7 @@ Status commit(Token token); // NOLINT * @return Status::OK success. * @return Status::ERR_READ_AREA_VIOLATION error about read area. */ -Status delete_record(Token token, Storage storage, // NOLINT +Status delete_record(Token token, Storage storage, // LINT std::string_view key); /** @@ -119,7 +119,7 @@ Status delete_record(Token token, Storage storage, // NOLINT * @return Status::OK * @return Status::ERR_SESSION_LIMIT There are no capacity of session. */ -Status enter(Token& token); // NOLINT +Status enter(Token& token); // LINT /** * @brief Confirm existence of the key in the @a storage. @@ -159,7 +159,7 @@ Status exist_key(Token token, Storage storage, std::string_view key); * interface. * @return void */ -void fin(bool force_shut_down_logging = true); // NOLINT +void fin(bool force_shut_down_logging = true); // LINT /** * @brief It initializes shirakami's environment. @@ -174,7 +174,7 @@ void fin(bool force_shut_down_logging = true); // NOLINT * @return Status::WARN_ALREADY_INIT Since it have already called int, it have * not done anything in this call. */ -Status init(database_options options = {}); // NOLINT +Status init(database_options options = {}); // LINT /** * @brief insert the record with given key/value @@ -205,7 +205,7 @@ Status init(database_options options = {}); // NOLINT * @return Status::ERR_READ_AREA_VIOLATION error about read area. */ Status insert(Token token, Storage storage, - std::string_view key, // NOLINT + std::string_view key, // LINT std::string_view val); /** @@ -217,7 +217,7 @@ Status insert(Token token, Storage storage, * @return Status::WARN_NOT_IN_A_SESSION The session may be already ended. * @return Status::ERR_INVALID_ARGS The @b token is invalid. */ -Status leave(Token token); // NOLINT +Status leave(Token token); // LINT /** * @brief This function preserve the specified range of masstree. If you use ltx @@ -258,8 +258,8 @@ Status leave(Token token); // NOLINT Status open_scan(Token token, Storage storage, std::string_view l_key, scan_endpoint l_end, std::string_view r_key, scan_endpoint r_end, ScanHandle& handle, - std::size_t max_size = 0, // NOLINT - bool right_to_left = false); // NOLINT + std::size_t max_size = 0, // LINT + bool right_to_left = false); // LINT /** * @brief advance cursor @@ -334,7 +334,7 @@ Status read_value_from_scan(Token token, ScanHandle handle, std::string& value); */ [[maybe_unused]] Status scannable_total_index_size(Token token, ScanHandle handle, - std::size_t& size); // NOLINT + std::size_t& size); // LINT /** * @brief It searches with the given key and return the found tuple. @@ -362,7 +362,7 @@ Status read_value_from_scan(Token token, ScanHandle handle, std::string& value); * @return Status::ERR_READ_AREA_VIOLATION error about read area. */ Status search_key(Token token, Storage storage, std::string_view key, - std::string& value); // NOLINT + std::string& value); // LINT /** * @brief Transaction begins. @@ -385,7 +385,7 @@ Status search_key(Token token, Storage storage, std::string_view key, * write_preserve and not using long tx mode. * @return Status::WARN_INVALID_ARGS User used storages not existed. */ -Status tx_begin(transaction_options options = {}); // NOLINT +Status tx_begin(transaction_options options = {}); // LINT /** * @brief It updates the record for the given key. @@ -405,7 +405,7 @@ Status tx_begin(transaction_options options = {}); // NOLINT * @return Status::ERR_READ_AREA_VIOLATION error about read area. */ Status update(Token token, Storage storage, std::string_view key, - std::string_view val); // NOLINT + std::string_view val); // LINT /** * @brief update the record for the given key, or insert the key/value if the @@ -429,7 +429,7 @@ Status update(Token token, Storage storage, std::string_view key, * this tx is long tx and didn't execute wp for @a storage. */ Status upsert(Token token, Storage storage, std::string_view key, - std::string_view val); // NOLINT + std::string_view val); // LINT //========== diff --git a/include/shirakami/log_record.h b/include/shirakami/log_record.h index 41ee982f0..56cfac2b4 100644 --- a/include/shirakami/log_record.h +++ b/include/shirakami/log_record.h @@ -93,35 +93,35 @@ struct log_record { * @brief operation type for log record entry. * */ - log_operation operation_{}; // NOLINT + log_operation operation_{}; // LINT /** * @brief key part of the log record */ - std::string_view key_{}; // NOLINT + std::string_view key_{}; // LINT /** * @brief value part of the log record * */ - std::string_view value_{}; // NOLINT + std::string_view value_{}; // LINT /** * @brief major version of the log record * */ - std::uint64_t major_version_{}; // NOLINT + std::uint64_t major_version_{}; // LINT /** * @brief minor version of the log record * */ - std::uint64_t minor_version_{}; // NOLINT + std::uint64_t minor_version_{}; // LINT /** * @brief storage id where the log record is made */ - storage_id_type storage_id_{}; // NOLINT + storage_id_type storage_id_{}; // LINT }; static_assert(std::is_trivially_copyable_v); diff --git a/include/shirakami/logging.h b/include/shirakami/logging.h index 085b9d385..99d42d5a8 100644 --- a/include/shirakami/logging.h +++ b/include/shirakami/logging.h @@ -20,7 +20,7 @@ static constexpr std::string_view log_location_prefix_timing_event = // receive string_view only #define shirakami_binstring(arg) \ " " #arg "(len=" << (arg).size() << "):\"" << binary_printer((arg)) \ - << "\"" //NOLINT + << "\"" //LINT /** * @brief logging level constant for errors diff --git a/include/shirakami/result_info.h b/include/shirakami/result_info.h index ba4b26d93..3a6d09b6b 100644 --- a/include/shirakami/result_info.h +++ b/include/shirakami/result_info.h @@ -75,34 +75,34 @@ inline constexpr std::string_view to_string_view(reason_code rc) noexcept { using namespace std::string_view_literals; switch (rc) { case reason_code::UNKNOWN: - return "UNKNOWN"sv; // NOLINT + return "UNKNOWN"sv; // LINT case reason_code::KVS_DELETE: - return "KVS_DELETE"sv; // NOLINT + return "KVS_DELETE"sv; // LINT case reason_code::KVS_INSERT: - return "KVS_INSERT"sv; // NOLINT + return "KVS_INSERT"sv; // LINT case reason_code::KVS_UPDATE: - return "KVS_UPDATE"sv; // NOLINT + return "KVS_UPDATE"sv; // LINT case reason_code::CC_LTX_PHANTOM_AVOIDANCE: - return "CC_LTX_PHANTOM_AVOIDANCE"sv; //NOLINT + return "CC_LTX_PHANTOM_AVOIDANCE"sv; //LINT case reason_code::CC_LTX_READ_AREA_VIOLATION: - return "CC_LTX_READ_AREA_VIOLATION"sv; // NOLINT + return "CC_LTX_READ_AREA_VIOLATION"sv; // LINT case reason_code::CC_LTX_READ_UPPER_BOUND_VIOLATION: - return "CC_LTX_READ_UPPER_BOUND_VIOLATION"sv; // NOLINT + return "CC_LTX_READ_UPPER_BOUND_VIOLATION"sv; // LINT case reason_code::CC_LTX_WRITE_COMMITTED_READ_PROTECTION: - return "CC_LTX_WRITE_COMMITTED_READ_PROTECTION"sv; // NOLINT + return "CC_LTX_WRITE_COMMITTED_READ_PROTECTION"sv; // LINT case reason_code::CC_OCC_READ_VERIFY: - return "CC_OCC_READ_VERIFY"sv; // NOLINT + return "CC_OCC_READ_VERIFY"sv; // LINT case reason_code::CC_OCC_WP_VERIFY: - return "CC_OCC_WP_VERIFY"sv; // NOLINT + return "CC_OCC_WP_VERIFY"sv; // LINT case reason_code::CC_OCC_PHANTOM_AVOIDANCE: - return "CC_OCC_PHANTOM_AVOIDANCE"sv; //NOLINT + return "CC_OCC_PHANTOM_AVOIDANCE"sv; //LINT case reason_code::USER_ABORT: - return "USER_ABORT"sv; // NOLINT + return "USER_ABORT"sv; // LINT } std::abort(); } -inline std::ostream& operator<<(std::ostream& out, reason_code rc) { // NOLINT +inline std::ostream& operator<<(std::ostream& out, reason_code rc) { // LINT return out << to_string_view(rc); } diff --git a/include/shirakami/scheme.h b/include/shirakami/scheme.h index 84b7481ca..e3c886f50 100644 --- a/include/shirakami/scheme.h +++ b/include/shirakami/scheme.h @@ -42,16 +42,16 @@ inline constexpr std::string_view to_string_view(scan_endpoint ep) noexcept { using namespace std::string_view_literals; switch (ep) { case scan_endpoint::EXCLUSIVE: - return "EXCLUSIVE"sv; //NOLINT + return "EXCLUSIVE"sv; //LINT case scan_endpoint::INCLUSIVE: - return "INCLUSIVE"sv; //NOLINT + return "INCLUSIVE"sv; //LINT case scan_endpoint::INF: - return "INF"sv; //NOLINT + return "INF"sv; //LINT } std::abort(); } -inline std::ostream& operator<<(std::ostream& out, scan_endpoint op) { // NOLINT +inline std::ostream& operator<<(std::ostream& out, scan_endpoint op) { // LINT return out << to_string_view(op); } @@ -252,90 +252,90 @@ enum class Status : std::int32_t { INTERNAL_WARN_PREMATURE, }; -inline constexpr std::string_view to_string_view( // NOLINT +inline constexpr std::string_view to_string_view( // LINT const Status value) noexcept { using namespace std::string_view_literals; switch (value) { case Status::WARN_ALREADY_BEGIN: - return "WARN_ALREADY_BEGIN"sv; // NOLINT + return "WARN_ALREADY_BEGIN"sv; // LINT case Status::WARN_ALREADY_EXISTS: - return "WARN_ALREADY_EXISTS"sv; // NOLINT + return "WARN_ALREADY_EXISTS"sv; // LINT case Status::WARN_ALREADY_INIT: - return "WARN_ALREADY_INIT"sv; // NOLINT + return "WARN_ALREADY_INIT"sv; // LINT case Status::WARN_CANCEL_PREVIOUS_INSERT: - return "WARN_CANCEL_PREVIOUS_INSERT"sv; // NOLINT + return "WARN_CANCEL_PREVIOUS_INSERT"sv; // LINT case Status::WARN_CANCEL_PREVIOUS_UPSERT: - return "WARN_CANCEL_PREVIOUS_UPSERT"sv; // NOLINT + return "WARN_CANCEL_PREVIOUS_UPSERT"sv; // LINT case Status::WARN_CONCURRENT_INSERT: - return "WARN_CONCURRENT_INSERT"sv; // NOLINT + return "WARN_CONCURRENT_INSERT"sv; // LINT case Status::WARN_CONCURRENT_UPDATE: - return "WARN_CONCURRENT_UPDATE"sv; // NOLINT + return "WARN_CONCURRENT_UPDATE"sv; // LINT case Status::WARN_CONFLICT_ON_WRITE_PRESERVE: - return "WARN_CONFLICT_ON_WRITE_PRESERVE"sv; // NOLINT + return "WARN_CONFLICT_ON_WRITE_PRESERVE"sv; // LINT case Status::WARN_ILLEGAL_OPERATION: - return "WARN_ILLEGAL_OPERATION"sv; // NOLINT + return "WARN_ILLEGAL_OPERATION"sv; // LINT case Status::WARN_INVALID_ARGS: - return "WARN_INVALID_ARGS"sv; // NOLINT + return "WARN_INVALID_ARGS"sv; // LINT case Status::WARN_INVALID_HANDLE: - return "WARN_INVALID_HANDLE"sv; // NOLINT + return "WARN_INVALID_HANDLE"sv; // LINT case Status::WARN_INVALID_KEY_LENGTH: - return "WARN_INVALID_KEY_LENGTH"sv; // NOLINT + return "WARN_INVALID_KEY_LENGTH"sv; // LINT case Status::WARN_MAX_OPEN_SCAN: - return "WARN_MAX_OPEN_SCAN"sv; // NOLINT + return "WARN_MAX_OPEN_SCAN"sv; // LINT case Status::WARN_NOT_BEGIN: - return "WARN_NOT_BEGIN"sv; // NOLINT + return "WARN_NOT_BEGIN"sv; // LINT case Status::WARN_NOT_FOUND: - return "WARN_NOT_FOUND"sv; // NOLINT + return "WARN_NOT_FOUND"sv; // LINT case Status::WARN_NOT_IN_A_SESSION: - return "WARN_NOT_IN_A_SESSION"sv; // NOLINT + return "WARN_NOT_IN_A_SESSION"sv; // LINT case Status::WARN_NOT_INIT: - return "WARN_NOT_INIT"sv; // NOLINT + return "WARN_NOT_INIT"sv; // LINT case Status::WARN_PREMATURE: - return "WARN_PREMATURE"sv; // NOLINT + return "WARN_PREMATURE"sv; // LINT case Status::WARN_SCAN_LIMIT: - return "WARN_SCAN_LIMIT"sv; // NOLINT + return "WARN_SCAN_LIMIT"sv; // LINT case Status::WARN_STORAGE_ID_DEPLETION: - return "WARN_STORAGE_ID_DEPLETION"sv; // NOLINT + return "WARN_STORAGE_ID_DEPLETION"sv; // LINT case Status::WARN_STORAGE_NOT_FOUND: - return "WARN_STORAGE_NOT_FOUND"sv; // NOLINT + return "WARN_STORAGE_NOT_FOUND"sv; // LINT case Status::WARN_WAITING_FOR_OTHER_TX: - return "WARN_WAITING_FOR_OTHER_TX"sv; // NOLINT + return "WARN_WAITING_FOR_OTHER_TX"sv; // LINT case Status::WARN_WRITE_WITHOUT_WP: - return "WARN_WRITE_WITHOUT_WP"sv; // NOLINT + return "WARN_WRITE_WITHOUT_WP"sv; // LINT case Status::OK: - return "OK"sv; // NOLINT + return "OK"sv; // LINT case Status::ERR_CC: - return "ERR_CC"sv; // NOLINT + return "ERR_CC"sv; // LINT case Status::ERR_READ_AREA_VIOLATION: - return "ERR_READ_AREA_VIOLATION"sv; // NOLINT + return "ERR_READ_AREA_VIOLATION"sv; // LINT case Status::ERR_FATAL: - return "ERR_FATAL"sv; // NOLINT + return "ERR_FATAL"sv; // LINT case Status::ERR_FATAL_INDEX: - return "ERR_FATAL_INDEX"sv; // NOLINT + return "ERR_FATAL_INDEX"sv; // LINT case Status::ERR_INVALID_CONFIGURATION: - return "ERR_INVALID_CONFIGURATION"sv; // NOLINT + return "ERR_INVALID_CONFIGURATION"sv; // LINT case Status::ERR_KVS: - return "ERR_KVS"sv; // NOLINT + return "ERR_KVS"sv; // LINT case Status::ERR_NOT_IMPLEMENTED: - return "ERR_NOT_IMPLEMENTED"sv; // NOLINT + return "ERR_NOT_IMPLEMENTED"sv; // LINT case Status::ERR_SESSION_LIMIT: - return "ERR_SESSION_LIMIT"sv; // NOLINT + return "ERR_SESSION_LIMIT"sv; // LINT case Status::INTERNAL_BEGIN: - return "INTERNAL_BEGIN"sv; // NOLINT + return "INTERNAL_BEGIN"sv; // LINT case Status::INTERNAL_WARN_NOT_DELETED: - return "INTERNAL_WARN_NOT_DELETED"sv; // NOLINT + return "INTERNAL_WARN_NOT_DELETED"sv; // LINT case Status::INTERNAL_WARN_NOT_FOUND: - return "INTERNAL_WARN_NOT_FOUND"sv; // NOLINT + return "INTERNAL_WARN_NOT_FOUND"sv; // LINT case Status::INTERNAL_WARN_CONCURRENT_INSERT: - return "INTERNAL_WARN_CONCURRENT_INSERT"sv; // NOLINT + return "INTERNAL_WARN_CONCURRENT_INSERT"sv; // LINT case Status::INTERNAL_WARN_PREMATURE: - return "INTERNAL_WARN_PREMATURE"sv; // NOLINT + return "INTERNAL_WARN_PREMATURE"sv; // LINT } std::abort(); } inline std::ostream& operator<<(std::ostream& out, - const Status value) { // NOLINT + const Status value) { // LINT return out << to_string_view(value); } @@ -352,35 +352,35 @@ enum class OP_TYPE : std::int32_t { UPSERT, }; -inline constexpr std::string_view to_string_view( // NOLINT +inline constexpr std::string_view to_string_view( // LINT const OP_TYPE op) noexcept { using namespace std::string_view_literals; switch (op) { case OP_TYPE::ABORT: - return "ABORT"sv; // NOLINT + return "ABORT"sv; // LINT case OP_TYPE::BEGIN: - return "BEGIN"sv; // NOLINT + return "BEGIN"sv; // LINT case OP_TYPE::COMMIT: - return "COMMIT"sv; // NOLINT + return "COMMIT"sv; // LINT case OP_TYPE::DELETE: - return "DELETE"sv; // NOLINT + return "DELETE"sv; // LINT case OP_TYPE::INSERT: - return "INSERT"sv; // NOLINT + return "INSERT"sv; // LINT case OP_TYPE::NONE: - return "NONE"sv; // NOLINT + return "NONE"sv; // LINT case OP_TYPE::SCAN: - return "SCAN"sv; // NOLINT + return "SCAN"sv; // LINT case OP_TYPE::SEARCH: - return "SEARCH"sv; // NOLINT + return "SEARCH"sv; // LINT case OP_TYPE::UPDATE: - return "UPDATE"sv; // NOLINT + return "UPDATE"sv; // LINT case OP_TYPE::UPSERT: - return "UPSERT"sv; // NOLINT + return "UPSERT"sv; // LINT } std::abort(); } -inline std::ostream& operator<<(std::ostream& out, const OP_TYPE op) { // NOLINT +inline std::ostream& operator<<(std::ostream& out, const OP_TYPE op) { // LINT return out << to_string_view(op); } diff --git a/include/shirakami/storage_options.h b/include/shirakami/storage_options.h index 58897696d..ff8d7f2b3 100644 --- a/include/shirakami/storage_options.h +++ b/include/shirakami/storage_options.h @@ -29,10 +29,10 @@ class storage_option { // constructor storage_option() = default; - storage_option(id_t id) : id_(id) {} // NOLINT + storage_option(id_t id) : id_(id) {} // LINT storage_option(id_t id, std::string_view pl) - : id_(id), payload_(pl) {} // NOLINT + : id_(id), payload_(pl) {} // LINT // setter / getter void id(id_t id) { id_ = id; } diff --git a/include/shirakami/transaction_options.h b/include/shirakami/transaction_options.h index 51a13e4bc..e2b791830 100644 --- a/include/shirakami/transaction_options.h +++ b/include/shirakami/transaction_options.h @@ -70,9 +70,9 @@ class transaction_options final { list_type negative_list_{}; }; - transaction_options() = default; // NOLINT + transaction_options() = default; // LINT - transaction_options(Token token) : token_(token) {} // NOLINT + transaction_options(Token token) : token_(token) {} // LINT transaction_options(Token token, transaction_type tt) : token_(token), transaction_type_(tt) {} @@ -153,11 +153,11 @@ to_string_view(const transaction_options::transaction_type tp) noexcept { using namespace std::string_view_literals; switch (tp) { case transaction_options::transaction_type::SHORT: - return "SHORT"sv; // NOLINT + return "SHORT"sv; // LINT case transaction_options::transaction_type::LONG: - return "LONG"sv; // NOLINT + return "LONG"sv; // LINT case transaction_options::transaction_type::READ_ONLY: - return "READ_ONLY"sv; // NOLINT + return "READ_ONLY"sv; // LINT } /** * LOG_FIRST_N マクロは下記エラーによって利用できない。 @@ -170,7 +170,7 @@ to_string_view(const transaction_options::transaction_type tp) noexcept { inline std::ostream& operator<<(std::ostream& out, - const transaction_options::transaction_type tp) { // NOLINT + const transaction_options::transaction_type tp) { // LINT return out << to_string_view(tp); } @@ -212,7 +212,7 @@ to_string(const transaction_options::read_area& ra) noexcept { } inline std::ostream& operator<<(std::ostream& out, - const transaction_options to) { // NOLINT + const transaction_options to) { // LINT return out << "Token: " << to.get_token() << ", transaction_type: " << to.get_transaction_type() << ", write_preserve: " << to_string(to.get_write_preserve()) diff --git a/include/shirakami/transaction_state.h b/include/shirakami/transaction_state.h index d48160408..d803247b9 100644 --- a/include/shirakami/transaction_state.h +++ b/include/shirakami/transaction_state.h @@ -223,11 +223,11 @@ class TxState final { * 2: There is a case which it needs long tx's id. */ Token token_{}; - static inline std::atomic handle_ctr_{1}; // NOLINT - static inline handle_container_type handle_container_; // NOLINT - static inline std::shared_mutex mtx_hc_; // NOLINT - static inline std::vector reuse_ctr_container_; // NOLINT - static inline std::mutex mtx_reuse_ctr_container_; // NOLINT + static inline std::atomic handle_ctr_{1}; // LINT + static inline handle_container_type handle_container_; // LINT + static inline std::shared_mutex mtx_hc_; // LINT + static inline std::vector reuse_ctr_container_; // LINT + static inline std::mutex mtx_reuse_ctr_container_; // LINT }; /** diff --git a/src/concurrency_control/bg_work/bg_commit.cpp b/src/concurrency_control/bg_work/bg_commit.cpp index 085baf9f3..a8e430bc7 100644 --- a/src/concurrency_control/bg_work/bg_commit.cpp +++ b/src/concurrency_control/bg_work/bg_commit.cpp @@ -78,7 +78,7 @@ void bg_commit::worker() { std::size_t tx_id{}; session* ti{}; // find process tx - REFIND : // NOLINT + REFIND : // LINT { std::shared_lock lk1{mtx_cont_wait_tx()}; // if cont empty then clear used_ids @@ -153,7 +153,7 @@ void bg_commit::worker() { std::unique_lock lk2{mtx_used_ids()}; used_ids().erase(tx_id); } - goto REFIND; // NOLINT + goto REFIND; // LINT } // termination was successed ti->set_result_requested_commit(rc); @@ -168,7 +168,7 @@ void bg_commit::worker() { * リストが空になったら安全に used_ids をクリアする。 */ - goto REFIND; // NOLINT + goto REFIND; // LINT } // normal termination, update joined_waiting_resolver diff --git a/src/concurrency_control/bg_work/include/bg_commit.h b/src/concurrency_control/bg_work/include/bg_commit.h index 856eb9201..c9b3f5c99 100644 --- a/src/concurrency_control/bg_work/include/bg_commit.h +++ b/src/concurrency_control/bg_work/include/bg_commit.h @@ -79,48 +79,48 @@ class bg_commit { /** * @brief The number of threads for resolving waiting list. */ - static inline std::atomic waiting_resolver_threads_{// NOLINT + static inline std::atomic waiting_resolver_threads_{// LINT 2}; /** * @brief The number of joined threads at last running for resolver threads. * This is initialized 0 at init. This can be checked after fin. */ - static inline std::atomic // NOLINT + static inline std::atomic // LINT joined_waiting_resolver_threads_{}; /** * @brief ltx commit verify threads */ - static inline worker_cont_type worker_threads_; // NOLINT + static inline worker_cont_type worker_threads_; // LINT /** * @brief This is a list what transaction do it be processed now by @a * worker_threads_ to prevent conflict. */ - static inline used_ids_type used_ids_; // NOLINT + static inline used_ids_type used_ids_; // LINT /** * @brief mutex for @a used_ids_ */ - static inline std::mutex mtx_used_ids_; // NOLINT + static inline std::mutex mtx_used_ids_; // LINT /** * @brief Flag used for signal to start or stop worker thread. * */ - static inline bool worker_thread_end_; // NOLINT + static inline bool worker_thread_end_; // LINT /** * @brief mutex for cont_wait_tx * */ - static inline std::shared_mutex mtx_cont_wait_tx_; // NOLINT + static inline std::shared_mutex mtx_cont_wait_tx_; // LINT /** * @brief container of long transactions waiting to commit. */ - static inline cont_type cont_wait_tx_; // NOLINT + static inline cont_type cont_wait_tx_; // LINT }; } // namespace shirakami::bg_work diff --git a/src/concurrency_control/garbage.cpp b/src/concurrency_control/garbage.cpp index 50c540a60..2ea7cf348 100644 --- a/src/concurrency_control/garbage.cpp +++ b/src/concurrency_control/garbage.cpp @@ -123,7 +123,7 @@ version* find_latest_invisible_version_from_batch( void delete_version_list(version* ver) { while (ver != nullptr) { version* v_next = ver->get_next(); - delete ver; // NOLINT + delete ver; // LINT ++get_gc_ct_ver(); ver = v_next; } @@ -274,7 +274,7 @@ inline void unhooking_keys_and_pruning_versions_at_the_storage( Storage st, std::size_t& record_num, std::size_t& average_version_list_size, std::size_t& average_key_size, std::size_t& average_value_size) { - std::string_view st_view = {reinterpret_cast(&st), // NOLINT + std::string_view st_view = {reinterpret_cast(&st), // LINT sizeof(st)}; // init about stats record_num = 0; @@ -308,7 +308,7 @@ inline void unhooking_keys_and_pruning_versions_at_the_storage( }; for (auto&& sr : scan_res) { - Record* rec_ptr = reinterpret_cast(std::get<1>(sr)); // NOLINT + Record* rec_ptr = reinterpret_cast(std::get<1>(sr)); // LINT // gathering stats info average_key_size += rec_ptr->get_key_view().size(); @@ -317,7 +317,7 @@ inline void unhooking_keys_and_pruning_versions_at_the_storage( average_value_size += buf.size(); unhooking_keys_and_pruning_versions( - ytk, st, rec_ptr, average_version_list_size); // NOLINT + ytk, st, rec_ptr, average_version_list_size); // LINT if (get_flag_cleaner_end()) { process_before_fin(); break; @@ -352,7 +352,7 @@ inline void unhooking_keys_and_pruning_versions(stats_info_type& stats_info) { void force_release_key_memory() { auto& cont = garbage::get_container_rec(); - for (auto& elem : cont) { delete elem.first; } // NOLINT + for (auto& elem : cont) { delete elem.first; } // LINT cont.clear(); } @@ -361,13 +361,13 @@ void release_key_memory() { // compute minimum epoch auto me = std::min(garbage::get_min_step_epoch(), garbage::get_min_batch_epoch()); std::size_t erase_count{0}; - for (auto itr = cont.begin(); itr != cont.end();) { // NOLINT + for (auto itr = cont.begin(); itr != cont.end();) { // LINT /** * If me changed from unhooking, all tx which existed at unhooking must * have finished. */ if ((*itr).second < me) { - delete (*itr).first; // NOLINT + delete (*itr).first; // LINT ++erase_count; ++itr; } else { @@ -375,7 +375,7 @@ void release_key_memory() { } } if (erase_count > 0) { - cont.erase(cont.begin(), cont.begin() + erase_count); // NOLINT + cont.erase(cont.begin(), cont.begin() + erase_count); // LINT } } diff --git a/src/concurrency_control/include/epoch.h b/src/concurrency_control/include/epoch.h index f80c16c68..e2ac10480 100644 --- a/src/concurrency_control/include/epoch.h +++ b/src/concurrency_control/include/epoch.h @@ -26,17 +26,17 @@ static constexpr epoch_t max_epoch{INT64_MAX}; * @brief global epoch * @pre We start with 1 because we give 0 the meaning of uninitialized. */ -inline std::atomic global_epoch{initial_epoch}; // NOLINT +inline std::atomic global_epoch{initial_epoch}; // LINT /** * @brief Global epoch time. Default is 40 ms == 40,000 us. */ -inline std::atomic global_epoch_time_us{40 * 1000}; // NOLINT +inline std::atomic global_epoch_time_us{40 * 1000}; // LINT /** * @brief safe snapshot epoch in the viewpoint of concurrency control. */ -inline std::atomic cc_safe_ss_epoch{// NOLINT +inline std::atomic cc_safe_ss_epoch{// LINT initial_cc_safe_ss_epoch}; /** @@ -45,37 +45,37 @@ inline std::atomic cc_safe_ss_epoch{// NOLINT */ inline std::atomic min_epoch_occ_potentially_write{0}; -inline std::atomic datastore_durable_epoch{0}; // NOLINT +inline std::atomic datastore_durable_epoch{0}; // LINT -[[maybe_unused]] inline std::thread epoch_thread; // NOLINT +[[maybe_unused]] inline std::thread epoch_thread; // LINT -[[maybe_unused]] inline std::atomic epoch_thread_end; // NOLINT +[[maybe_unused]] inline std::atomic epoch_thread_end; // LINT -[[maybe_unused]] inline std::mutex ep_mtx_; // NOLINT +[[maybe_unused]] inline std::mutex ep_mtx_; // LINT -[[maybe_unused]] static epoch_t get_datastore_durable_epoch() { // NOLINT +[[maybe_unused]] static epoch_t get_datastore_durable_epoch() { // LINT return datastore_durable_epoch.load(std::memory_order_acquire); } -[[maybe_unused]] static bool get_epoch_thread_end() { // NOLINT +[[maybe_unused]] static bool get_epoch_thread_end() { // LINT return epoch_thread_end.load(std::memory_order_acquire); } -[[maybe_unused]] static std::mutex& get_ep_mtx() { return ep_mtx_; } // NOLINT +[[maybe_unused]] static std::mutex& get_ep_mtx() { return ep_mtx_; } // LINT -[[maybe_unused]] static epoch_t get_global_epoch() { // NOLINT +[[maybe_unused]] static epoch_t get_global_epoch() { // LINT return global_epoch.load(std::memory_order_acquire); } -[[maybe_unused]] static std::size_t get_global_epoch_time_us() { // NOLINT +[[maybe_unused]] static std::size_t get_global_epoch_time_us() { // LINT return global_epoch_time_us.load(std::memory_order_acquire); } -[[maybe_unused]] static epoch_t get_cc_safe_ss_epoch() { // NOLINT +[[maybe_unused]] static epoch_t get_cc_safe_ss_epoch() { // LINT return cc_safe_ss_epoch.load(std::memory_order_acquire); } -[[maybe_unused]] static epoch_t get_min_epoch_occ_potentially_write() { // NOLINT +[[maybe_unused]] static epoch_t get_min_epoch_occ_potentially_write() { // LINT return min_epoch_occ_potentially_write.load(std::memory_order_acquire); } @@ -85,7 +85,7 @@ inline std::atomic datastore_durable_epoch{0}; // NOLINT epoch_thread_end.store(tf, std::memory_order_release); } -[[maybe_unused]] static void set_global_epoch(const epoch_t epo) { // NOLINT +[[maybe_unused]] static void set_global_epoch(const epoch_t epo) { // LINT global_epoch.store(epo, std::memory_order_release); } @@ -128,7 +128,7 @@ static constexpr ptp_body_type ptp_init_val{-1}; * @details If this is -1, this variable is invalid. If not, epoch manager can * proceed epoch for the value of this. */ -inline std::atomic perm_to_proc_{ptp_init_val}; // NOLINT +inline std::atomic perm_to_proc_{ptp_init_val}; // LINT [[maybe_unused]] static void set_perm_to_proc(ptp_body_type num) { perm_to_proc_.store(num, std::memory_order_release); diff --git a/src/concurrency_control/include/garbage.h b/src/concurrency_control/include/garbage.h index 12e564069..e3cc4b503 100644 --- a/src/concurrency_control/include/garbage.h +++ b/src/concurrency_control/include/garbage.h @@ -29,13 +29,13 @@ using stats_info_type = * @details Perform version pruning of GC based on the timestamp determined * by the manager. */ -[[maybe_unused]] inline std::thread cleaner; // NOLINT +[[maybe_unused]] inline std::thread cleaner; // LINT /** * @brief garbage collection manager thread. * @details Periodically calculate @a min_step_epoch and @a min_batch_epoch. */ -[[maybe_unused]] inline std::thread manager; // NOLINT +[[maybe_unused]] inline std::thread manager; // LINT // function for background thread [[maybe_unused]] void work_manager(); @@ -78,7 +78,7 @@ using stats_info_type = * First of elements is pointer to record. Second of elements is global epoch * of unhooking. */ -[[maybe_unused]] inline std::vector< // NOLINT +[[maybe_unused]] inline std::vector< // LINT std::pair> container_rec_{}; diff --git a/src/concurrency_control/include/helper.h b/src/concurrency_control/include/helper.h index a9175bd37..c88a792ef 100644 --- a/src/concurrency_control/include/helper.h +++ b/src/concurrency_control/include/helper.h @@ -20,6 +20,6 @@ namespace shirakami { * @return Status */ Status read_record(Record* rec_ptr, tid_word& tid, std::string& val, - bool read_value = true); // NOLINT + bool read_value = true); // LINT } // namespace shirakami diff --git a/src/concurrency_control/include/local_set.h b/src/concurrency_control/include/local_set.h index f92d52702..78d7f1f69 100644 --- a/src/concurrency_control/include/local_set.h +++ b/src/concurrency_control/include/local_set.h @@ -27,16 +27,16 @@ namespace shirakami { -class read_set_obj { // NOLINT +class read_set_obj { // LINT public: read_set_obj(Storage const storage, Record* const rec_ptr, - tid_word const tid) // NOLINT + tid_word const tid) // LINT : storage_(storage), rec_ptr_(rec_ptr), tid_(tid) {} read_set_obj(const read_set_obj& right) = delete; read_set_obj(read_set_obj&& right) = default; - read_set_obj& operator=(const read_set_obj& right) = delete; // NOLINT + read_set_obj& operator=(const read_set_obj& right) = delete; // LINT read_set_obj& operator=(read_set_obj&& right) = default; [[nodiscard]] Storage get_storage() const { return storage_; } @@ -66,7 +66,7 @@ class read_set_obj { // NOLINT static_assert(std::is_nothrow_move_constructible_v); -class write_set_obj { // NOLINT +class write_set_obj { // LINT public: // for update / upsert / insert write_set_obj(Storage const storage, OP_TYPE const op, @@ -253,8 +253,8 @@ class local_write_set { std::shared_mutex mtx_; }; -inline std::ostream& operator<<(std::ostream& out, // NOLINT - local_write_set& ws) { // NOLINT +inline std::ostream& operator<<(std::ostream& out, // LINT + local_write_set& ws) { // LINT // now occ only std::stringstream ss; ss << "for_batch_: " << ws.get_for_batch() << std::endl; diff --git a/src/concurrency_control/include/lpwal.h b/src/concurrency_control/include/lpwal.h index b9d2663af..73a3ca289 100644 --- a/src/concurrency_control/include/lpwal.h +++ b/src/concurrency_control/include/lpwal.h @@ -34,24 +34,24 @@ namespace shirakami::lpwal { * @brief log directory pointed at initialize. * */ -[[maybe_unused]] inline std::string log_dir_{""}; // NOLINT +[[maybe_unused]] inline std::string log_dir_{""}; // LINT /** * @brief Whether log_dir is pointed at initialize. * */ -[[maybe_unused]] inline bool log_dir_pointed_{false}; // NOLINT +[[maybe_unused]] inline bool log_dir_pointed_{false}; // LINT /** * @brief It shows whether it is in fin(). */ -[[maybe_unused]] inline std::atomic stopping_{false}; // NOLINT +[[maybe_unused]] inline std::atomic stopping_{false}; // LINT /** * @brief This thread is collecting each worker's log. * */ -[[maybe_unused]] inline std::thread daemon_thread_; // NOLINT +[[maybe_unused]] inline std::thread daemon_thread_; // LINT class write_version_type { public: diff --git a/src/concurrency_control/include/ongoing_tx.h b/src/concurrency_control/include/ongoing_tx.h index 83af7f159..ccff0d9e6 100644 --- a/src/concurrency_control/include/ongoing_tx.h +++ b/src/concurrency_control/include/ongoing_tx.h @@ -83,19 +83,19 @@ class ongoing_tx { /** * @brief This is mutex for tx_info_; */ - static inline std::shared_mutex mtx_; // NOLINT + static inline std::shared_mutex mtx_; // LINT /** * @brief register info of running long tx's epoch and id. */ - static inline tx_info_type tx_info_; // NOLINT + static inline tx_info_type tx_info_; // LINT /** * @brief enable/disable waiting bypass. */ - static inline bool optflag_disable_waiting_bypass_; // NOLINT + static inline bool optflag_disable_waiting_bypass_; // LINT /** * @brief waiting bypass to root (aggressive optimization). */ - static inline bool optflag_waiting_bypass_to_root_; // NOLINT + static inline bool optflag_waiting_bypass_to_root_; // LINT }; } // namespace shirakami diff --git a/src/concurrency_control/include/read_plan.h b/src/concurrency_control/include/read_plan.h index a310a4271..278b4d492 100644 --- a/src/concurrency_control/include/read_plan.h +++ b/src/concurrency_control/include/read_plan.h @@ -83,12 +83,12 @@ class read_plan { /** * @brief mutex for container. */ - static inline std::shared_mutex mtx_cont_; // NOLINT + static inline std::shared_mutex mtx_cont_; // LINT /** * @brief container for read area */ - static inline cont_type cont_; // NOLINT + static inline cont_type cont_; // LINT }; } // namespace shirakami diff --git a/src/concurrency_control/include/record.h b/src/concurrency_control/include/record.h index 507393193..c23d1e82c 100644 --- a/src/concurrency_control/include/record.h +++ b/src/concurrency_control/include/record.h @@ -22,7 +22,7 @@ namespace shirakami { -class alignas(CACHE_LINE_SIZE) Record { // NOLINT +class alignas(CACHE_LINE_SIZE) Record { // LINT public: Record() = default; @@ -37,7 +37,7 @@ class alignas(CACHE_LINE_SIZE) Record { // NOLINT explicit Record(std::string_view key); Record(tid_word const& tidw, std::string_view vinfo) : tidw_(tidw) { - latest_.store(new version(vinfo), std::memory_order_release); // NOLINT + latest_.store(new version(vinfo), std::memory_order_release); // LINT } // start: getter diff --git a/src/concurrency_control/include/scan.h b/src/concurrency_control/include/scan.h index 35a8182c5..5309e4c0e 100644 --- a/src/concurrency_control/include/scan.h +++ b/src/concurrency_control/include/scan.h @@ -95,11 +95,11 @@ class scan_handler { // getter - [[maybe_unused]] scan_cache_type& get_scan_cache() { // NOLINT + [[maybe_unused]] scan_cache_type& get_scan_cache() { // LINT return scan_cache_; } - [[maybe_unused]] scan_cache_itr_type& get_scan_cache_itr() { // NOLINT + [[maybe_unused]] scan_cache_itr_type& get_scan_cache_itr() { // LINT return scan_cache_itr_; } diff --git a/src/concurrency_control/include/session.h b/src/concurrency_control/include/session.h index 76179ca5b..06f3e3744 100644 --- a/src/concurrency_control/include/session.h +++ b/src/concurrency_control/include/session.h @@ -74,9 +74,9 @@ class alignas(CACHE_LINE_SIZE) session { return value_; } - lock_and_epoch_t(std::uint64_t value) noexcept : value_(value) {} // NOLINT + lock_and_epoch_t(std::uint64_t value) noexcept : value_(value) {} // LINT lock_and_epoch_t(bool lock, epoch::epoch_t e) noexcept : value_((lock ? BIT_MASK : 0UL) | e) {} - operator std::uint64_t() const noexcept { return value_; } // NOLINT + operator std::uint64_t() const noexcept { return value_; } // LINT private: std::uint64_t value_{}; @@ -702,7 +702,7 @@ class alignas(CACHE_LINE_SIZE) session { // ========== start: node set node_set& get_node_set() { return node_set_; } - Status update_node_set(yakushima::node_version64* nvp) { // NOLINT + Status update_node_set(yakushima::node_version64* nvp) { // LINT return get_node_set().update_node_set(nvp); } @@ -999,7 +999,7 @@ class session_table { /** * @brief Acquire right of an one session. */ - static Status decide_token(Token& token); // NOLINT + static Status decide_token(Token& token); // LINT /** * @brief getter of session_table_ @@ -1030,8 +1030,8 @@ class session_table { * @attention Please set KVS_MAX_PARALLEL_THREADS larger than actual number * of sessions. */ - static inline std::array // NOLINT - session_table_; // NOLINT + static inline std::array // LINT + session_table_; // LINT }; /** @@ -1051,6 +1051,6 @@ class session_table { * that or calling for not ltx, the result of calling this (finished) * transaction is undefined behavior. */ -Status check_commit(Token token); // NOLINT +Status check_commit(Token token); // LINT } // namespace shirakami diff --git a/src/concurrency_control/include/tid.h b/src/concurrency_control/include/tid.h index 514e9033b..14532c05e 100644 --- a/src/concurrency_control/include/tid.h +++ b/src/concurrency_control/include/tid.h @@ -15,9 +15,9 @@ namespace shirakami { -class tid_word { // NOLINT +class tid_word { // LINT public: - union { // NOLINT + union { // LINT __uint128_t obj_; struct { bool lock_ : 1; @@ -32,98 +32,98 @@ class tid_word { // NOLINT }; }; - constexpr tid_word() // NOLINT + constexpr tid_word() // LINT : obj_(0) { - } // NOLINT : clang-tidy order to initialize other member, but + } // LINT : clang-tidy order to initialize other member, but // it occurs compile error. - constexpr tid_word(const __uint128_t obj) : obj_(obj) { } // NOLINT : the same as above. - tid_word(const tid_word& right) noexcept // NOLINT - : obj_(right.get_obj()) {} // NOLINT : the same as above. + constexpr tid_word(const __uint128_t obj) : obj_(obj) { } // LINT : the same as above. + tid_word(const tid_word& right) noexcept // LINT + : obj_(right.get_obj()) {} // LINT : the same as above. - tid_word& operator=(const tid_word& right) { // NOLINT - obj_ = right.get_obj(); // NOLINT : union + tid_word& operator=(const tid_word& right) { // LINT + obj_ = right.get_obj(); // LINT : union return *this; } - bool operator==(const tid_word& right) const { // NOLINT : trailing - return obj_ == right.get_obj(); // NOLINT : union + bool operator==(const tid_word& right) const { // LINT : trailing + return obj_ == right.get_obj(); // LINT : union } - bool operator!=(const tid_word& right) const { // NOLINT : trailing + bool operator!=(const tid_word& right) const { // LINT : trailing return !operator==(right); } - bool operator<(const tid_word& right) const { // NOLINT : trailing - return this->obj_ < right.get_obj(); // NOLINT : union + bool operator<(const tid_word& right) const { // LINT : trailing + return this->obj_ < right.get_obj(); // LINT : union } - bool operator>(const tid_word& right) const { // NOLINT : trailing - return this->obj_ > right.get_obj(); // NOLINT : union + bool operator>(const tid_word& right) const { // LINT : trailing + return this->obj_ > right.get_obj(); // LINT : union } - bool empty() { return obj_ == 0; } // NOLINT + bool empty() { return obj_ == 0; } // LINT - __uint128_t& get_obj() { return obj_; } // NOLINT + __uint128_t& get_obj() { return obj_; } // LINT - const __uint128_t& get_obj() const { return obj_; } // NOLINT + const __uint128_t& get_obj() const { return obj_; } // LINT - bool get_lock() { return lock_; } // NOLINT + bool get_lock() { return lock_; } // LINT - bool get_lock_by_gc() { return lock_by_gc_; } // NOLINT + bool get_lock_by_gc() { return lock_by_gc_; } // LINT - [[maybe_unused]] bool get_lock() const { return lock_; } // NOLINT + [[maybe_unused]] bool get_lock() const { return lock_; } // LINT [[maybe_unused]] [[nodiscard]] bool get_lock_by_gc() const { - return lock_by_gc_; // NOLINT + return lock_by_gc_; // LINT } - [[maybe_unused]] bool get_latest() { return latest_; } // NOLINT + [[maybe_unused]] bool get_latest() { return latest_; } // LINT - [[maybe_unused]] bool get_latest() const { return latest_; } // NOLINT + [[maybe_unused]] bool get_latest() const { return latest_; } // LINT - bool get_absent() { return absent_; } // NOLINT + bool get_absent() { return absent_; } // LINT - [[maybe_unused]] bool get_absent() const { return absent_; } // NOLINT + [[maybe_unused]] bool get_absent() const { return absent_; } // LINT - uint64_t get_tid() { return tid_; } // NOLINT + uint64_t get_tid() { return tid_; } // LINT - [[maybe_unused]] uint64_t get_tid() const { return tid_; } // NOLINT + [[maybe_unused]] uint64_t get_tid() const { return tid_; } // LINT - epoch::epoch_t get_epoch() { return epoch_; } // NOLINT + epoch::epoch_t get_epoch() { return epoch_; } // LINT - [[maybe_unused]] [[nodiscard]] epoch::epoch_t get_epoch() const { // NOLINT - return epoch_; // NOLINT + [[maybe_unused]] [[nodiscard]] epoch::epoch_t get_epoch() const { // LINT + return epoch_; // LINT } - [[maybe_unused]] bool get_by_short() const { return by_short_; } // NOLINT + [[maybe_unused]] bool get_by_short() const { return by_short_; } // LINT - void inc_tid() { this->tid_ = this->tid_ + 1; } // NOLINT + void inc_tid() { this->tid_ = this->tid_ + 1; } // LINT - void reset() { obj_ = 0; } // NOLINT + void reset() { obj_ = 0; } // LINT - void set_absent(const bool absent) { this->absent_ = absent; } // NOLINT + void set_absent(const bool absent) { this->absent_ = absent; } // LINT void set_epoch(epoch::epoch_t epo) { - this->epoch_ = epo; // NOLINT + this->epoch_ = epo; // LINT } - void set_latest(const bool latest) { this->latest_ = latest; } // NOLINT + void set_latest(const bool latest) { this->latest_ = latest; } // LINT - void set_lock(const bool lock) { this->lock_ = lock; } // NOLINT + void set_lock(const bool lock) { this->lock_ = lock; } // LINT - void set_lock_by_gc(const bool lock) { this->lock_by_gc_ = lock; } // NOLINT + void set_lock_by_gc(const bool lock) { this->lock_by_gc_ = lock; } // LINT - void set_by_short(const bool tf) { by_short_ = tf; } // NOLINT + void set_by_short(const bool tf) { by_short_ = tf; } // LINT - void set_obj(const __uint128_t obj) { this->obj_ = obj; } // NOLINT + void set_obj(const __uint128_t obj) { this->obj_ = obj; } // LINT [[maybe_unused]] void set_tid(const uint64_t tid) { - this->tid_ = tid; // NOLINT + this->tid_ = tid; // LINT } void display(); - void lock(bool by_gc = false); // NOLINT + void lock(bool by_gc = false); // LINT /** * @pre This is called after lock() function. @@ -138,10 +138,10 @@ class tid_word { // NOLINT private: }; -static_assert(sizeof(tid_word) == sizeof(tid_word::obj_)); // NOLINT(*-union-access) +static_assert(sizeof(tid_word) == sizeof(tid_word::obj_)); // LINT(*-union-access) static_assert(std::is_nothrow_move_constructible_v); -inline std::ostream& operator<<(std::ostream& out, tid_word tid) { // NOLINT +inline std::ostream& operator<<(std::ostream& out, tid_word tid) { // LINT out << "lock_:" << tid.get_lock() << ", lock_by_gc:" << tid.get_lock_by_gc() << ", latest_:" << tid.get_latest() << ", absent_:" << tid.get_absent() << ", tid_:" << tid.get_tid() << ", by_short_:" << tid.get_by_short() diff --git a/src/concurrency_control/include/version.h b/src/concurrency_control/include/version.h index 1538999fa..e2000f197 100644 --- a/src/concurrency_control/include/version.h +++ b/src/concurrency_control/include/version.h @@ -16,7 +16,7 @@ namespace shirakami { -class alignas(CACHE_LINE_SIZE) version { // NOLINT +class alignas(CACHE_LINE_SIZE) version { // LINT public: explicit version() { set_next(nullptr); } diff --git a/src/concurrency_control/include/wp.h b/src/concurrency_control/include/wp.h index 7855a383c..12cb79468 100644 --- a/src/concurrency_control/include/wp.h +++ b/src/concurrency_control/include/wp.h @@ -36,7 +36,7 @@ class page_set_meta { page_set_meta() = default; explicit page_set_meta(storage_option options) - : storage_option_(std::move(options)) {} // NOLINT + : storage_option_(std::move(options)) {} // LINT range_read_by_long* get_range_read_by_long_ptr() { return &range_read_by_long_; diff --git a/src/concurrency_control/include/wp_lock.h b/src/concurrency_control/include/wp_lock.h index 1258664b8..cf98673eb 100644 --- a/src/concurrency_control/include/wp_lock.h +++ b/src/concurrency_control/include/wp_lock.h @@ -7,7 +7,7 @@ namespace shirakami::wp { class wp_lock { public: - static bool is_locked(std::uint64_t obj) { return obj & 1; } // NOLINT + static bool is_locked(std::uint64_t obj) { return obj & 1; } // LINT std::uint64_t load_obj() { return obj.load(std::memory_order_acquire); } diff --git a/src/concurrency_control/include/wp_meta.h b/src/concurrency_control/include/wp_meta.h index 4b2cf0b35..a2b9730f8 100644 --- a/src/concurrency_control/include/wp_meta.h +++ b/src/concurrency_control/include/wp_meta.h @@ -124,7 +124,7 @@ class alignas(CACHE_LINE_SIZE) wp_meta { wped_.at(pos) = val; } - void set_wped_used(std::size_t pos, bool val = true) { // NOLINT + void set_wped_used(std::size_t pos, bool val = true) { // LINT wped_used_.set(pos, val); } diff --git a/src/concurrency_control/interface/delete.cpp b/src/concurrency_control/interface/delete.cpp index 3022e4ac8..f4c4f8b23 100644 --- a/src/concurrency_control/interface/delete.cpp +++ b/src/concurrency_control/interface/delete.cpp @@ -69,7 +69,7 @@ inline Status process_after_write(session* ti, write_set_obj* wso) { } if (!rc) { // if this was update - ti->push_to_write_set({st, OP_TYPE::DELETE, rec_ptr}); // NOLINT + ti->push_to_write_set({st, OP_TYPE::DELETE, rec_ptr}); // LINT register_read_if_ltx(ti, wso->get_rec_ptr()); } return Status::WARN_CANCEL_PREVIOUS_UPSERT; @@ -106,7 +106,7 @@ static void process_before_return_not_found(session* const ti, } Status delete_record_body(Token token, Storage storage, - const std::string_view key) { // NOLINT + const std::string_view key) { // LINT // check constraint: key auto ret = check_constraint_key_length(key); if (ret != Status::OK) { return ret; } @@ -126,7 +126,7 @@ Status delete_record_body(Token token, Storage storage, rc = get(storage, key, rec_ptr); if (Status::OK == rc) { // check local write - write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // NOLINT + write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // LINT if (in_ws != nullptr) { return process_after_write(ti, in_ws); } // check absent tid_word ctid{loadAcquire(rec_ptr->get_tidw_ref().get_obj())}; @@ -135,7 +135,7 @@ Status delete_record_body(Token token, Storage storage, return Status::WARN_NOT_FOUND; } // prepare write - ti->push_to_write_set({storage, OP_TYPE::DELETE, rec_ptr}); // NOLINT + ti->push_to_write_set({storage, OP_TYPE::DELETE, rec_ptr}); // LINT register_read_if_ltx(ti, rec_ptr); return Status::OK; } diff --git a/src/concurrency_control/interface/helper.cpp b/src/concurrency_control/interface/helper.cpp index f2f13124c..021bff871 100644 --- a/src/concurrency_control/interface/helper.cpp +++ b/src/concurrency_control/interface/helper.cpp @@ -39,7 +39,7 @@ namespace shirakami { Status check_constraint_key_length(std::string_view const key) { // check constraint: key - if (key.size() > 30 * 1024) { // NOLINT + if (key.size() > 30 * 1024) { // LINT // we can't control over 30KB key. return Status::WARN_INVALID_KEY_LENGTH; } @@ -106,7 +106,7 @@ Status check_before_write_ops(session* const ti, Storage const st, } Status read_record(Record* const rec_ptr, tid_word& tid, std::string& val, - bool const read_value = true) { // NOLINT + bool const read_value = true) { // LINT tid_word f_check{}; tid_word s_check{}; diff --git a/src/concurrency_control/interface/insert.cpp b/src/concurrency_control/interface/insert.cpp index 64ddbacd8..63cb9b966 100644 --- a/src/concurrency_control/interface/insert.cpp +++ b/src/concurrency_control/interface/insert.cpp @@ -33,7 +33,7 @@ static inline Status insert_process(session* const ti, Storage st, const std::string_view val, Record*& out_rec_ptr) { Record* rec_ptr{}; - rec_ptr = new Record(key); // NOLINT + rec_ptr = new Record(key); // LINT tid_word tid{rec_ptr->get_tidw()}; rec_ptr->get_shared_tombstone_count().store(1, std::memory_order_release); @@ -72,7 +72,7 @@ static inline Status insert_process(session* const ti, Storage st, } // else insert_result == Status::WARN_ALREADY_EXISTS // so retry from index access - delete rec_ptr; // NOLINT + delete rec_ptr; // LINT return Status::WARN_CONCURRENT_INSERT; } @@ -82,8 +82,8 @@ static void register_read_if_ltx(session* const ti, Record* const rec_ptr) { } } -Status insert_body(Token const token, Storage const storage, // NOLINT - const std::string_view key, // NOLINT +Status insert_body(Token const token, Storage const storage, // LINT + const std::string_view key, // LINT const std::string_view val) { // check constraint: key auto ret = check_constraint_key_length(key); @@ -128,7 +128,7 @@ Status insert_body(Token const token, Storage const storage, // NOLINT if (rc == Status::WARN_CONCURRENT_INSERT) { continue; } if (rc == Status::WARN_NOT_FOUND) { // the rec_ptr is gced; - goto INSERT_PROCESS; // NOLINT + goto INSERT_PROCESS; // LINT } if (rc == Status::WARN_ALREADY_EXISTS) { // ========== @@ -151,7 +151,7 @@ Status insert_body(Token const token, Storage const storage, // NOLINT return rc; } - INSERT_PROCESS: // NOLINT + INSERT_PROCESS: // LINT auto rc{insert_process(ti, storage, key, val, rec_ptr)}; if (rc == Status::OK) { register_read_if_ltx(ti, rec_ptr); @@ -161,8 +161,8 @@ Status insert_body(Token const token, Storage const storage, // NOLINT } } -Status insert(Token const token, Storage const storage, // NOLINT - const std::string_view key, // NOLINT +Status insert(Token const token, Storage const storage, // LINT + const std::string_view key, // LINT const std::string_view val) { shirakami_log_entry << "insert, token: " << token << ", storage: " << storage << shirakami_binstring(key) diff --git a/src/concurrency_control/interface/long_tx/helper.cpp b/src/concurrency_control/interface/long_tx/helper.cpp index 013b06766..d5da8b7ac 100644 --- a/src/concurrency_control/interface/long_tx/helper.cpp +++ b/src/concurrency_control/interface/long_tx/helper.cpp @@ -53,7 +53,7 @@ void preprocess_read_area(transaction_options::read_area& ra) { // if you set positive and negative, you can read positive erased by negative for (auto elem : ra.get_negative_list()) { auto pset = ra.get_positive_list(); - for (auto itr = pset.begin(); itr != pset.end(); ++itr) { // NOLINT + for (auto itr = pset.begin(); itr != pset.end(); ++itr) { // LINT if (elem == *itr) { ra.erase_from_positive_list(elem); break; @@ -137,7 +137,7 @@ void update_wp_at_commit(session* const ti) { } Status tx_begin(session* const ti, std::vector write_preserve, - transaction_options::read_area ra) { // NOLINT + transaction_options::read_area ra) { // LINT // get wp mutex, exclude long tx's coming and epoch update auto wp_mutex = std::unique_lock(wp::get_wp_mutex()); @@ -158,7 +158,7 @@ Status tx_begin(session* const ti, std::vector write_preserve, // after deciding success wp::long_tx::set_counter(long_tx_id + 1); - if (long_tx_id >= pow(2, 63)) { // NOLINT + if (long_tx_id >= pow(2, 63)) { // LINT LOG_FIRST_N(ERROR, 1) << log_location_prefix << "long tx id depletion. limit of specification."; diff --git a/src/concurrency_control/interface/long_tx/include/long_tx.h b/src/concurrency_control/interface/long_tx/include/long_tx.h index eb8b85bc6..1dae8271a 100644 --- a/src/concurrency_control/interface/long_tx/include/long_tx.h +++ b/src/concurrency_control/interface/long_tx/include/long_tx.h @@ -21,7 +21,7 @@ extern Status check_wait_for_preceding_bt(session* ti); extern Status commit(session* ti); extern Status search_key(session* ti, Storage storage, std::string_view key, - std::string& value, bool read_value = true); // NOLINT + std::string& value, bool read_value = true); // LINT extern Status tx_begin(session* ti, std::vector write_preserve, transaction_options::read_area ra); diff --git a/src/concurrency_control/interface/long_tx/search.cpp b/src/concurrency_control/interface/long_tx/search.cpp index 34613e98b..29b0da362 100644 --- a/src/concurrency_control/interface/long_tx/search.cpp +++ b/src/concurrency_control/interface/long_tx/search.cpp @@ -75,7 +75,7 @@ extern Status version_traverse_and_read(session* const ti, * so this tx must wait unlocking because it may read invalid state with * locking. */ - goto RETRY; // NOLINT + goto RETRY; // LINT } // read non-latest version after version function @@ -171,7 +171,7 @@ Status search_key(session* ti, Storage const storage, } // check local write set - write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // NOLINT + write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // LINT if (in_ws != nullptr) { rc = hit_local_write_set(in_ws, rec_ptr, value, read_value); if (rc == Status::OK) { diff --git a/src/concurrency_control/interface/long_tx/termination.cpp b/src/concurrency_control/interface/long_tx/termination.cpp index 846ae33ed..dc095f214 100644 --- a/src/concurrency_control/interface/long_tx/termination.cpp +++ b/src/concurrency_control/interface/long_tx/termination.cpp @@ -164,7 +164,7 @@ static inline void expose_local_write( // case: first of list std::string vb{}; if (wso.get_op() != OP_TYPE::DELETE) { wso.get_value(vb); } - version* new_v{new version( // NOLINT + version* new_v{new version( // LINT vb, rec_ptr->get_latest())}; // prepare tid for old version pre_tid.set_absent(false); @@ -210,7 +210,7 @@ static inline void expose_local_write( // load payload if not delete. wso.get_value(vb); } - version* new_v{new version(ctid, vb, ver)}; // NOLINT + version* new_v{new version(ctid, vb, ver)}; // LINT pre_ver->set_next(new_v); }; should_log = false; @@ -385,7 +385,7 @@ static inline void cleanup_process( // ============================== // functions declared at header -Status abort(session* const ti) { // NOLINT +Status abort(session* const ti) { // LINT // about tx state ti->set_tx_state_if_valid(TxState::StateKind::ABORTED); @@ -764,7 +764,7 @@ extern Status commit(session* const ti) { long_tx::abort(ti); ti->call_commit_callback(rc, ti->get_result_info().get_reason_code(), 0); - goto END_COMMIT; // NOLINT + goto END_COMMIT; // LINT } if (rc != Status::OK) { LOG_FIRST_N(ERROR, 1) @@ -883,7 +883,7 @@ extern Status commit(session* const ti) { LOG_FIRST_N(ERROR, 1) << "library programming error."; } -END_COMMIT: // NOLINT +END_COMMIT: // LINT // log debug timing event VLOG(log_debug_timing_event) << log_location_prefix_timing_event << "end_precommit : " << str_tx_id; @@ -897,7 +897,7 @@ extern Status commit(session* const ti) { return rc; } -Status check_commit(Token const token) { // NOLINT +Status check_commit(Token const token) { // LINT auto* ti = static_cast(token); // check for requested commit. diff --git a/src/concurrency_control/interface/read_only_tx/include/read_only_tx.h b/src/concurrency_control/interface/read_only_tx/include/read_only_tx.h index 4c021685f..e1b74e46d 100644 --- a/src/concurrency_control/interface/read_only_tx/include/read_only_tx.h +++ b/src/concurrency_control/interface/read_only_tx/include/read_only_tx.h @@ -11,7 +11,7 @@ extern Status abort(session* ti); extern Status commit(session* ti); extern Status search_key(session* ti, Storage storage, std::string_view key, - std::string& value, bool read_value = true); // NOLINT + std::string& value, bool read_value = true); // LINT extern Status tx_begin(session* ti); diff --git a/src/concurrency_control/interface/scan/close_scan.cpp b/src/concurrency_control/interface/scan/close_scan.cpp index 435895c82..5c8bc375a 100644 --- a/src/concurrency_control/interface/scan/close_scan.cpp +++ b/src/concurrency_control/interface/scan/close_scan.cpp @@ -19,13 +19,13 @@ namespace shirakami { -Status close_scan_body(Token const token, ScanHandle const handle) { // NOLINT +Status close_scan_body(Token const token, ScanHandle const handle) { // LINT auto* ti = static_cast(token); if (!ti->get_tx_began()) { return Status::WARN_NOT_BEGIN; } return ti->get_scan_handle().clear(handle); } -Status close_scan(Token const token, ScanHandle const handle) { // NOLINT +Status close_scan(Token const token, ScanHandle const handle) { // LINT shirakami_log_entry << "close_scan, token: " << token << ", handle: " << handle; auto* ti = static_cast(token); diff --git a/src/concurrency_control/interface/scan/next.cpp b/src/concurrency_control/interface/scan/next.cpp index 2b0d0e4f8..776bb13e6 100644 --- a/src/concurrency_control/interface/scan/next.cpp +++ b/src/concurrency_control/interface/scan/next.cpp @@ -19,7 +19,7 @@ namespace shirakami { -Status next_body(Token const token, ScanHandle const handle) { // NOLINT +Status next_body(Token const token, ScanHandle const handle) { // LINT auto* ti = static_cast(token); if (!ti->get_tx_began()) { return Status::WARN_NOT_BEGIN; } @@ -55,7 +55,7 @@ Status next_body(Token const token, ScanHandle const handle) { // NOLINT // check target record auto& scan_buf = std::get( sh.get_scan_cache()[handle]); - auto itr = scan_buf.begin() + scan_index; // NOLINT + auto itr = scan_buf.begin() + scan_index; // LINT rec_ptr = const_cast(std::get<0>(*itr)); } @@ -183,7 +183,7 @@ Status next_body(Token const token, ScanHandle const handle) { // NOLINT /** * @pre This is called by only long tx mode */ -void check_ltx_scan_range_rp_and_log(Token const token, // NOLINT +void check_ltx_scan_range_rp_and_log(Token const token, // LINT ScanHandle const handle) { auto* ti = static_cast(token); auto& sh = ti->get_scan_handle(); @@ -222,7 +222,7 @@ void check_ltx_scan_range_rp_and_log(Token const token, // NOLINT } } -Status next(Token const token, ScanHandle const handle) { // NOLINT +Status next(Token const token, ScanHandle const handle) { // LINT shirakami_log_entry << "next, token: " << token << ", handle: " << handle; auto* ti = static_cast(token); ti->process_before_start_step(); diff --git a/src/concurrency_control/interface/scan/open_scan.cpp b/src/concurrency_control/interface/scan/open_scan.cpp index 8b96bf1f0..3642224ff 100644 --- a/src/concurrency_control/interface/scan/open_scan.cpp +++ b/src/concurrency_control/interface/scan/open_scan.cpp @@ -19,7 +19,7 @@ namespace shirakami { -inline Status find_open_scan_slot(session* const ti, // NOLINT +inline Status find_open_scan_slot(session* const ti, // LINT ScanHandle& out) { auto& sh = ti->get_scan_handle(); for (ScanHandle i = 0;; ++i) { @@ -77,7 +77,7 @@ Status check_not_found( head_skip_rec_n = 0; bool once_not_skip{false}; for (auto& elem : scan_res) { - Record* rec_ptr{reinterpret_cast(std::get<1>(elem))}; // NOLINT + Record* rec_ptr{reinterpret_cast(std::get<1>(elem))}; // LINT // by inline optimization tid_word tid{loadAcquire(rec_ptr->get_tidw().get_obj())}; if (!tid.get_absent()) { @@ -170,7 +170,7 @@ Status check_not_found( return Status::WARN_NOT_FOUND; } -Status open_scan_body(Token const token, Storage storage, // NOLINT +Status open_scan_body(Token const token, Storage storage, // LINT const std::string_view l_key, const scan_endpoint l_end, const std::string_view r_key, const scan_endpoint r_end, ScanHandle& handle, std::size_t const max_size, @@ -385,7 +385,7 @@ Status open_scan_body(Token const token, Storage storage, // NOLINT sh.get_scan_cache()[handle]); vec.reserve(scan_res.size()); for (std::size_t i = 0; i < scan_res.size(); ++i) { - vec.emplace_back(reinterpret_cast( // NOLINT + vec.emplace_back(reinterpret_cast( // LINT std::get(scan_res.at(i))), // by inline optimization std::get(nvec.at(i + nvec_delta)), @@ -405,7 +405,7 @@ Status open_scan_body(Token const token, Storage storage, // NOLINT return fin_process(ti, Status::OK); } -Status open_scan(Token const token, Storage storage, // NOLINT +Status open_scan(Token const token, Storage storage, // LINT const std::string_view l_key, const scan_endpoint l_end, const std::string_view r_key, const scan_endpoint r_end, ScanHandle& handle, std::size_t const max_size, bool right_to_left) { diff --git a/src/concurrency_control/interface/scan/read_kv_from_scan.cpp b/src/concurrency_control/interface/scan/read_kv_from_scan.cpp index ad2e2250d..657a501fa 100644 --- a/src/concurrency_control/interface/scan/read_kv_from_scan.cpp +++ b/src/concurrency_control/interface/scan/read_kv_from_scan.cpp @@ -60,13 +60,13 @@ Status read_from_scan(Token token, ScanHandle handle, bool key_read, auto& scan_buf = std::get( sh.get_scan_cache()[handle]); std::size_t& scan_index = sh.get_scan_cache_itr()[handle]; - auto itr = scan_buf.begin() + scan_index; // NOLINT + auto itr = scan_buf.begin() + scan_index; // LINT nv = std::get<1>(*itr); nv_ptr = std::get<2>(*itr); if (scan_buf.size() <= scan_index) { return Status::WARN_SCAN_LIMIT; } // ========== - rec_ptr = const_cast(std::get<0>(*itr)); // NOLINT + rec_ptr = const_cast(std::get<0>(*itr)); // LINT } // log read range info if ltx @@ -220,7 +220,7 @@ Status read_from_scan(Token token, ScanHandle handle, bool key_read, return Status::ERR_FATAL; } -Status read_key_from_scan(Token const token, ScanHandle const handle, // NOLINT +Status read_key_from_scan(Token const token, ScanHandle const handle, // LINT std::string& key) { shirakami_log_entry << "read_key_from_scan, token: " << token << ", handle: " << handle; @@ -237,7 +237,7 @@ Status read_key_from_scan(Token const token, ScanHandle const handle, // NOLINT return ret; } -Status read_value_from_scan(Token const token, // NOLINT +Status read_value_from_scan(Token const token, // LINT ScanHandle const handle, std::string& value) { shirakami_log_entry << "read_value_from_scan, token: " << token << ", handle: " << handle; diff --git a/src/concurrency_control/interface/scan/scannable_total_index_size.cpp b/src/concurrency_control/interface/scan/scannable_total_index_size.cpp index 0d6b8837e..8a1ef48a7 100644 --- a/src/concurrency_control/interface/scan/scannable_total_index_size.cpp +++ b/src/concurrency_control/interface/scan/scannable_total_index_size.cpp @@ -19,7 +19,7 @@ namespace shirakami { -Status scannable_total_index_size_body(Token const token, // NOLINT +Status scannable_total_index_size_body(Token const token, // LINT ScanHandle const handle, std::size_t& size) { auto* ti = static_cast(token); @@ -43,7 +43,7 @@ Status scannable_total_index_size_body(Token const token, // NOLINT return Status::OK; } -Status scannable_total_index_size(Token const token, // NOLINT +Status scannable_total_index_size(Token const token, // LINT ScanHandle const handle, std::size_t& size) { shirakami_log_entry << "scannable_total_index_size, " << "token: " << token << ", handle: " << handle diff --git a/src/concurrency_control/interface/search.cpp b/src/concurrency_control/interface/search.cpp index 424558ede..ddd3496ff 100644 --- a/src/concurrency_control/interface/search.cpp +++ b/src/concurrency_control/interface/search.cpp @@ -18,7 +18,7 @@ namespace shirakami { -Status exist_key_body(Token const token, Storage const storage, // NOLINT +Status exist_key_body(Token const token, Storage const storage, // LINT std::string_view const key) { // check constraint: key auto ret = check_constraint_key_length(key); @@ -59,7 +59,7 @@ Status exist_key_body(Token const token, Storage const storage, // NOLINT return rc; } -Status exist_key(Token const token, Storage const storage, // NOLINT +Status exist_key(Token const token, Storage const storage, // LINT std::string_view const key) { shirakami_log_entry << "exist_key, token: " << token << ", storage: " << storage << shirakami_binstring(key); @@ -75,7 +75,7 @@ Status exist_key(Token const token, Storage const storage, // NOLINT return ret; } -Status search_key_body(Token const token, Storage const storage, // NOLINT +Status search_key_body(Token const token, Storage const storage, // LINT std::string_view const key, std::string& value) { // check constraint: key auto ret = check_constraint_key_length(key); @@ -115,7 +115,7 @@ Status search_key_body(Token const token, Storage const storage, // NOLINT return rc; } -Status search_key(Token const token, Storage const storage, // NOLINT +Status search_key(Token const token, Storage const storage, // LINT std::string_view const key, std::string& value) { shirakami_log_entry << "search_key, token: " << token << ", storage: " << storage << shirakami_binstring(key); diff --git a/src/concurrency_control/interface/session_management.cpp b/src/concurrency_control/interface/session_management.cpp index f5b036125..828f6b53e 100644 --- a/src/concurrency_control/interface/session_management.cpp +++ b/src/concurrency_control/interface/session_management.cpp @@ -36,7 +36,7 @@ namespace shirakami { -Status enter_body(Token& token) { // NOLINT +Status enter_body(Token& token) { // LINT Status ret_status = session_table::decide_token(token); if (ret_status != Status::OK) return ret_status; @@ -49,7 +49,7 @@ Status enter_body(Token& token) { // NOLINT return Status::OK; } -Status enter(Token& token) { // NOLINT +Status enter(Token& token) { // LINT shirakami_log_entry << "enter, token: " << token; auto ret = enter_body(token); shirakami_log_exit << "enter, Status: " << ret; @@ -71,7 +71,7 @@ void unlock_for_other_client(session* const ti) { ti->set_visible(false); // unlock } -Status leave_body(Token const token) { // NOLINT +Status leave_body(Token const token) { // LINT for (auto&& itr : session_table::get_session_table()) { auto* ti = static_cast(token); if (&itr == ti) { @@ -106,7 +106,7 @@ Status leave_body(Token const token) { // NOLINT return Status::WARN_INVALID_ARGS; } -Status leave(Token const token) { // NOLINT +Status leave(Token const token) { // LINT shirakami_log_entry << "leave, token: " << token; auto ret = leave_body(token); shirakami_log_exit << "leave, Status: " << ret; diff --git a/src/concurrency_control/interface/short_tx/include/short_tx.h b/src/concurrency_control/interface/short_tx/include/short_tx.h index fd0c03287..74ce7128d 100644 --- a/src/concurrency_control/interface/short_tx/include/short_tx.h +++ b/src/concurrency_control/interface/short_tx/include/short_tx.h @@ -14,6 +14,6 @@ extern Status abort(session* ti); extern Status commit(session* ti); extern Status search_key(session* ti, Storage storage, std::string_view key, - std::string& value, bool read_value = true); // NOLINT + std::string& value, bool read_value = true); // LINT } // namespace shirakami::short_tx diff --git a/src/concurrency_control/interface/short_tx/search.cpp b/src/concurrency_control/interface/short_tx/search.cpp index 4981e9fab..3e364488d 100644 --- a/src/concurrency_control/interface/short_tx/search.cpp +++ b/src/concurrency_control/interface/short_tx/search.cpp @@ -68,7 +68,7 @@ Status search_key(session* ti, Storage const storage, } // check local write set - write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // NOLINT + write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // LINT if (in_ws != nullptr) { if (in_ws->get_op() == OP_TYPE::DELETE) { return Status::WARN_NOT_FOUND; diff --git a/src/concurrency_control/interface/short_tx/termination.cpp b/src/concurrency_control/interface/short_tx/termination.cpp index 7996e94f0..4e5cff7f0 100644 --- a/src/concurrency_control/interface/short_tx/termination.cpp +++ b/src/concurrency_control/interface/short_tx/termination.cpp @@ -161,7 +161,7 @@ void change_inserting_records_state(session* const ti) { } // ========== -Status abort(session* ti) { // NOLINT +Status abort(session* ti) { // LINT // about tx state ti->set_tx_state_if_valid(TxState::StateKind::ABORTED); @@ -308,7 +308,7 @@ Status sert_process_at_write_lock(write_set_obj* wso) { << "lock key " + std::string(rec_ptr->get_key_view()); } - RE_LOCK: // NOLINT + RE_LOCK: // LINT // locking rec_ptr->get_tidw_ref().lock(); @@ -323,7 +323,7 @@ Status sert_process_at_write_lock(write_set_obj* wso) { // for fail safe wso->get_rec_ptr()->unlock(); wso->set_rec_ptr(rec_ptr); - goto RE_LOCK; // NOLINT + goto RE_LOCK; // LINT } } else { // already unhooked @@ -614,7 +614,7 @@ Status write_phase(session* ti, epoch::epoch_t ce) { * To be larger than LTX. * Ltx's minor version is ltx id. */ - minor_version <<= 63; // NOLINT + minor_version <<= 63; // LINT minor_version |= update_tid.get_tid(); } ti->get_lpwal_handle().push_log(shirakami::lpwal::log_record( diff --git a/src/concurrency_control/interface/start_up.cpp b/src/concurrency_control/interface/start_up.cpp index bee0edbe0..ebd6a2d09 100644 --- a/src/concurrency_control/interface/start_up.cpp +++ b/src/concurrency_control/interface/start_up.cpp @@ -57,7 +57,7 @@ void for_output_config(database_options const& options) { "commit. Default is 2."; } -Status init_body(database_options options) { // NOLINT +Status init_body(database_options options) { // LINT // prevent double initialization if (get_initialized()) { return Status::WARN_ALREADY_INIT; } @@ -80,7 +80,7 @@ Status init_body(database_options options) { // NOLINT // order to recover, but log_dir is nothing enable_true_log_nothing = true; } - int tid = syscall(SYS_gettid); // NOLINT + int tid = syscall(SYS_gettid); // LINT std::uint64_t tsc = rdtsc(); log_dir = "/tmp/shirakami-" + std::to_string(tid) + "-" + std::to_string(tsc); @@ -91,7 +91,7 @@ Status init_body(database_options options) { // NOLINT lpwal::set_log_dir_pointed(true); // check exist boost::filesystem::path ldp{ - std::string(options.get_log_directory_path())}; // NOLINT + std::string(options.get_log_directory_path())}; // LINT boost::system::error_code error; const bool result = boost::filesystem::exists(ldp, error); if (!result || error) { @@ -231,7 +231,7 @@ Status init_body(database_options options) { // NOLINT return Status::OK; } -Status init(database_options options) { // NOLINT +Status init(database_options options) { // LINT shirakami_log_entry << "init, options: " << options; auto ret = init_body(options); shirakami_log_exit << "init, Status: " << ret; diff --git a/src/concurrency_control/interface/storage.cpp b/src/concurrency_control/interface/storage.cpp index ca813a808..6b1a87c09 100644 --- a/src/concurrency_control/interface/storage.cpp +++ b/src/concurrency_control/interface/storage.cpp @@ -31,9 +31,9 @@ void write_storage_metadata(std::string_view key, Storage st, while (enter(s) != Status::OK) { _mm_pause(); } std::string value{}; // value = Storage + id + payload - value.append(reinterpret_cast(&st), sizeof(st)); // NOLINT + value.append(reinterpret_cast(&st), sizeof(st)); // LINT storage_option::id_t id = options.id(); - value.append(reinterpret_cast(&id), sizeof(id)); // NOLINT + value.append(reinterpret_cast(&id), sizeof(id)); // LINT std::string payload{options.payload()}; value.append(payload); auto ret = tx_begin({s, transaction_options::transaction_type::SHORT}); @@ -51,7 +51,7 @@ void write_storage_metadata(std::string_view key, Storage st, #ifdef PWAL auto* ti = static_cast(s); // reuse mrc_tid of previous commit to calculate the write-version - lpwal::write_version_type wv{ti->get_mrc_tid().get_epoch(), ti->get_mrc_tid().get_tid() | (1UL << 63)}; // NOLINT + lpwal::write_version_type wv{ti->get_mrc_tid().get_epoch(), ti->get_mrc_tid().get_tid() | (1UL << 63)}; // LINT { std::unique_lock lk{ti->get_lpwal_handle().get_mtx_logs()}; ti->get_lpwal_handle().push_log(lpwal::log_record(log_operation::ADD_STORAGE, wv, st, {}, {})); @@ -85,7 +85,7 @@ void remove_storage_metadata(std::string_view key, [[maybe_unused]] Storage st) #ifdef PWAL auto* ti = static_cast(s); // reuse mrc_tid of previous commit to calculate the write-version - lpwal::write_version_type wv{ti->get_mrc_tid().get_epoch(), ti->get_mrc_tid().get_tid() | (1UL << 63)}; // NOLINT + lpwal::write_version_type wv{ti->get_mrc_tid().get_epoch(), ti->get_mrc_tid().get_tid() | (1UL << 63)}; // LINT // note: this write-version is calculated without reading any Records in this storage, // so it may be smaller than that of concurrent transactions writing this storage. { @@ -215,11 +215,11 @@ Status storage_get_options_body(Storage storage, storage_option& options) { << ret; return Status::ERR_FATAL; } - if (commit(s) == Status::OK) { break; } // NOLINT + if (commit(s) == Status::OK) { break; } // LINT // Someone may executed storage_set_options and it occurs occ error. _mm_pause(); ++try_num; - if (try_num > 100) { // NOLINT + if (try_num > 100) { // LINT LOG(INFO) << "strange statement"; leave(s); return Status::WARN_ILLEGAL_OPERATION; @@ -228,12 +228,12 @@ Status storage_get_options_body(Storage storage, storage_option& options) { leave(s); // value = Storage + id + payload storage_option::id_t id{}; - memcpy(&id, value.data() + sizeof(Storage), // NOLINT + memcpy(&id, value.data() + sizeof(Storage), // LINT sizeof(storage_option::id_t)); std::string payload{}; if (value.size() > sizeof(Storage) + sizeof(storage_option::id_t)) { - payload.append(value.data() + sizeof(Storage) + // NOLINT - sizeof(storage_option::id_t), // NOLINT + payload.append(value.data() + sizeof(Storage) + // LINT + sizeof(storage_option::id_t), // LINT value.size() - sizeof(Storage) - sizeof(storage_option::id_t)); } @@ -264,9 +264,9 @@ Status storage_set_options_body(Storage storage, while (enter(s) != Status::OK) { _mm_pause(); } std::string value{}; // value = Storage + id + payload - value.append(reinterpret_cast(&storage), sizeof(storage)); // NOLINT + value.append(reinterpret_cast(&storage), sizeof(storage)); // LINT storage_option::id_t id = options.id(); - value.append(reinterpret_cast(&id), sizeof(id)); // NOLINT + value.append(reinterpret_cast(&id), sizeof(id)); // LINT std::string payload{options.payload()}; value.append(payload); // store and log information @@ -299,11 +299,11 @@ Status storage_set_options(Storage storage, storage_option const& options) { Status storage::register_storage(Storage storage, storage_option options) { std::string_view storage_view = { - reinterpret_cast(&storage), // NOLINT + reinterpret_cast(&storage), // LINT sizeof(storage)}; auto rc = yakushima::create_storage(std::string_view(storage_view)); // create storage must return WARN_UNIQUE_RESTRICTION or OK - if (rc == yakushima::status::WARN_UNIQUE_RESTRICTION) { // NOLINT + if (rc == yakushima::status::WARN_UNIQUE_RESTRICTION) { // LINT return Status::WARN_ALREADY_EXISTS; } if (rc != yakushima::status::OK) { @@ -321,10 +321,10 @@ Status storage::register_storage(Storage storage, storage_option options) { new wp::page_set_meta(std::move(options))}; auto rc = yakushima::put( ytoken, - {reinterpret_cast(&page_set_meta_storage), // NOLINT + {reinterpret_cast(&page_set_meta_storage), // LINT sizeof(page_set_meta_storage)}, storage_view, &page_set_meta_ptr, - sizeof(page_set_meta_ptr)); // NOLINT + sizeof(page_set_meta_ptr)); // LINT if (yakushima::status::OK != rc) { LOG_FIRST_N(ERROR, 1) << log_location_prefix << rc << ", unreachable path"; @@ -350,19 +350,19 @@ Status storage::create_storage(Storage& storage, // storage id is not specified by shirakami-user. get_new_storage_num(storage); // check depletion - if ((storage >> 32) > 0) { // NOLINT + if ((storage >> 32) > 0) { // LINT VLOG(log_trace) << "system defined storage id depletion. you should " "implement re-using storage id."; return Status::WARN_STORAGE_ID_DEPLETION; } // higher bit is used for system defined. - storage <<= 32; // NOLINT + storage <<= 32; // LINT } else { // storage id is specified by shirakami-user. storage = storage_id; // check depletion - if ((storage >> 32) > 0) { // NOLINT + if ((storage >> 32) > 0) { // LINT VLOG(log_trace) << "user defined storage id depletion. you should " "implement re-using storage id."; return Status::WARN_STORAGE_ID_DEPLETION; @@ -375,17 +375,17 @@ Status storage::create_storage(Storage& storage, Status storage::exist_storage(Storage storage) { auto ret = yakushima::find_storage( - {reinterpret_cast(&storage), sizeof(storage)}); // NOLINT + {reinterpret_cast(&storage), sizeof(storage)}); // LINT if (ret == yakushima::status::OK) { return Status::OK; } return Status::WARN_NOT_FOUND; } Status storage::delete_storage(Storage storage) { - // NOLINT + // LINT std::unique_lock lk{garbage::get_mtx_cleaner()}; std::string_view storage_view = { - reinterpret_cast(&storage), // NOLINT + reinterpret_cast(&storage), // LINT sizeof(storage)}; auto ret = yakushima::find_storage(storage_view); if ((ret != yakushima::status::OK) || @@ -399,17 +399,17 @@ Status storage::delete_storage(Storage storage) { yakushima::scan(storage_view, "", yakushima::scan_endpoint::INF, "", yakushima::scan_endpoint::INF, scan_res); - if (scan_res.size() < std::thread::hardware_concurrency() * 10) { // NOLINT + if (scan_res.size() < std::thread::hardware_concurrency() * 10) { // LINT // single thread clean up for (auto&& itr : scan_res) { if (wp::get_finalizing()) { - delete reinterpret_cast( // NOLINT + delete reinterpret_cast( // LINT std::get(itr)); } else { - Record* target_rec{reinterpret_cast( // NOLINT + Record* target_rec{reinterpret_cast( // LINT std::get(itr))}; // by inline optimization - delete target_rec; // NOLINT + delete target_rec; // LINT } } } else { @@ -418,12 +418,12 @@ Status storage::delete_storage(Storage storage) { std::size_t const end) { for (std::size_t i = begin; i < end; ++i) { if (wp::get_finalizing()) { - delete reinterpret_cast( // NOLINT + delete reinterpret_cast( // LINT std::get(scan_res[i])); } else { - Record* target_rec{reinterpret_cast( // NOLINT + Record* target_rec{reinterpret_cast( // LINT std::get(scan_res[i]))}; - delete target_rec; // NOLINT + delete target_rec; // LINT } } }; @@ -448,7 +448,7 @@ Status storage::delete_storage(Storage storage) { } std::pair out{}; auto rc{yakushima::get( - {reinterpret_cast(&page_set_meta_storage), // NOLINT + {reinterpret_cast(&page_set_meta_storage), // LINT sizeof(page_set_meta_storage)}, storage_view, out)}; if (rc != yakushima::status::OK) { @@ -458,11 +458,11 @@ Status storage::delete_storage(Storage storage) { << std::endl; return Status::ERR_FATAL; } - delete reinterpret_cast(out.first); // NOLINT + delete reinterpret_cast(out.first); // LINT // by inline optimization rc = yakushima::remove( ytoken, - {reinterpret_cast(&page_set_meta_storage), // NOLINT + {reinterpret_cast(&page_set_meta_storage), // LINT sizeof(page_set_meta_storage)}, storage_view); if (yakushima::status::OK != rc) { @@ -478,7 +478,7 @@ Status storage::delete_storage(Storage storage) { } } auto rc = yakushima::delete_storage(storage_view); - if (yakushima::status::OK != rc) { // NOLINT + if (yakushima::status::OK != rc) { // LINT LOG_FIRST_N(ERROR, 1) << log_location_prefix << rc << ", unreachable path"; return Status::ERR_FATAL; diff --git a/src/concurrency_control/interface/termination.cpp b/src/concurrency_control/interface/termination.cpp index a67c2a529..7acabe749 100644 --- a/src/concurrency_control/interface/termination.cpp +++ b/src/concurrency_control/interface/termination.cpp @@ -11,7 +11,7 @@ namespace shirakami { -Status abort_body(Token token) { // NOLINT +Status abort_body(Token token) { // LINT // clean up local set auto* ti = static_cast(token); // check whether it already began. @@ -43,7 +43,7 @@ Status abort_body(Token token) { // NOLINT return rc; } -Status abort(Token token) { // NOLINT +Status abort(Token token) { // LINT shirakami_log_entry << "abort, token: " << token; auto* ti = static_cast(token); ti->process_before_start_step(); @@ -59,8 +59,8 @@ Status abort(Token token) { // NOLINT return ret; } -Status commit_body(Token const token, // NOLINT - commit_callback_type callback = {}) { // NOLINT +Status commit_body(Token const token, // LINT + commit_callback_type callback = {}) { // LINT // default 引数は後方互換性のため。いずれ削除する。 auto* ti = static_cast(token); // check whether it already began. @@ -70,7 +70,7 @@ Status commit_body(Token const token, // NOLINT } // log callback - ti->set_commit_callback(std::move(callback)); // NOLINT + ti->set_commit_callback(std::move(callback)); // LINT Status rc{}; if (ti->get_tx_type() == transaction_options::transaction_type::SHORT) { @@ -121,7 +121,7 @@ Status commit_body(Token const token, // NOLINT return rc; } -Status commit(Token const token) { // NOLINT +Status commit(Token const token) { // LINT shirakami_log_entry << "commit, token: " << token; auto* ti = static_cast(token); ti->process_before_start_step(); @@ -137,7 +137,7 @@ Status commit(Token const token) { // NOLINT return ret; } -bool commit(Token token, commit_callback_type callback) { // NOLINT +bool commit(Token token, commit_callback_type callback) { // LINT shirakami_log_entry << "commit, token: " << token; auto* ti = static_cast(token); ti->process_before_start_step(); diff --git a/src/concurrency_control/interface/tx_begin.cpp b/src/concurrency_control/interface/tx_begin.cpp index 4ab980f24..b6b7c00a4 100644 --- a/src/concurrency_control/interface/tx_begin.cpp +++ b/src/concurrency_control/interface/tx_begin.cpp @@ -36,7 +36,7 @@ namespace shirakami { -Status tx_begin_body(transaction_options options) { // NOLINT +Status tx_begin_body(transaction_options options) { // LINT // get tx options Token token = options.get_token(); @@ -108,7 +108,7 @@ Status tx_begin_body(transaction_options options) { // NOLINT return Status::OK; } -Status tx_begin(transaction_options options) { // NOLINT +Status tx_begin(transaction_options options) { // LINT shirakami_log_entry << "tx_begin, options: " << options; Token token = options.get_token(); auto* ti = static_cast(token); diff --git a/src/concurrency_control/interface/tx_id.cpp b/src/concurrency_control/interface/tx_id.cpp index 7d71ca0e1..577d24cea 100644 --- a/src/concurrency_control/interface/tx_id.cpp +++ b/src/concurrency_control/interface/tx_id.cpp @@ -20,7 +20,7 @@ Status get_tx_id_body(Token token, std::string& tx_id) { // prepare string stream for higher tx counter std::stringstream ss; - ss << std::setw(4) << std::setfill('0') << std::hex // NOLINT + ss << std::setw(4) << std::setfill('0') << std::hex // LINT << static_cast(ti->get_higher_tx_counter()); // use down cast // add to tx id @@ -30,7 +30,7 @@ Status get_tx_id_body(Token token, std::string& tx_id) { // prepare string stream for session id ss.clear(std::stringstream::goodbit); - ss << std::setw(4) << std::setfill('0') << std::hex << // NOLINT + ss << std::setw(4) << std::setfill('0') << std::hex << // LINT static_cast(ti->get_session_id()); // use down cast // add to tx id @@ -40,7 +40,7 @@ Status get_tx_id_body(Token token, std::string& tx_id) { // prepare string stream for tx counter ss.clear(std::stringstream::goodbit); - ss << std::setw(8) << std::setfill('0') << std::hex // NOLINT + ss << std::setw(8) << std::setfill('0') << std::hex // LINT << static_cast(ti->get_tx_counter()); // use down cast tx_id += ss.str(); diff --git a/src/concurrency_control/interface/update.cpp b/src/concurrency_control/interface/update.cpp index 87c9afd42..be7177010 100644 --- a/src/concurrency_control/interface/update.cpp +++ b/src/concurrency_control/interface/update.cpp @@ -45,7 +45,7 @@ static void process_before_return_not_found(session* const ti, } Status update_body(Token token, Storage storage, - const std::string_view key, // NOLINT + const std::string_view key, // LINT const std::string_view val) { // check constraint: key auto ret = check_constraint_key_length(key); @@ -65,7 +65,7 @@ Status update_body(Token token, Storage storage, Record* rec_ptr{}; if (Status::OK == get(storage, key, rec_ptr)) { // check local write - write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // NOLINT + write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // LINT if (in_ws != nullptr) { if (in_ws->get_op() == OP_TYPE::DELETE) { return Status::WARN_NOT_FOUND; @@ -83,7 +83,7 @@ Status update_body(Token token, Storage storage, // prepare write ti->push_to_write_set( - {storage, OP_TYPE::UPDATE, rec_ptr, val}); // NOLINT + {storage, OP_TYPE::UPDATE, rec_ptr, val}); // LINT register_read_if_ltx(ti, rec_ptr); return Status::OK; } @@ -92,7 +92,7 @@ Status update_body(Token token, Storage storage, } Status update(Token token, Storage storage, - std::string_view const key, // NOLINT + std::string_view const key, // LINT std::string_view const val) { shirakami_log_entry << "update, token: " << token << ", storage: " << storage << shirakami_binstring(key) diff --git a/src/concurrency_control/interface/upsert.cpp b/src/concurrency_control/interface/upsert.cpp index 8c0b819ac..639e74a26 100644 --- a/src/concurrency_control/interface/upsert.cpp +++ b/src/concurrency_control/interface/upsert.cpp @@ -33,7 +33,7 @@ static inline Status insert_process(session* const ti, Storage st, const std::string_view key, const std::string_view val) { Record* rec_ptr{}; - rec_ptr = new Record(key); // NOLINT + rec_ptr = new Record(key); // LINT tid_word tid{rec_ptr->get_tidw()}; rec_ptr->get_shared_tombstone_count().store(1, std::memory_order_release); @@ -71,7 +71,7 @@ static inline Status insert_process(session* const ti, Storage st, return Status::OK; } // fail insert rec_ptr - delete rec_ptr; // NOLINT + delete rec_ptr; // LINT return Status::WARN_CONCURRENT_INSERT; } @@ -96,7 +96,7 @@ Status upsert_body(Token token, Storage storage, const std::string_view key, Record* rec_ptr{}; if (Status::OK == get(storage, key, rec_ptr)) { // check local write - write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // NOLINT + write_set_obj* in_ws{ti->get_write_set().search(rec_ptr)}; // LINT if (in_ws != nullptr) { if (in_ws->get_op() == OP_TYPE::DELETE) { in_ws->set_op(OP_TYPE::UPDATE); @@ -117,18 +117,18 @@ Status upsert_body(Token token, Storage storage, const std::string_view key, rc = try_deleted_to_inserting(storage, key, rec_ptr, dummy_tid); if (rc == Status::WARN_NOT_FOUND) { // the rec_ptr is gced. - goto INSERT_PROCESS; // NOLINT + goto INSERT_PROCESS; // LINT } if (rc == Status::OK) { // sharing tombstone // prepare insert / upsert with tombstone count ti->push_to_write_set({storage, OP_TYPE::UPSERT, rec_ptr, val, - true}); // NOLINT + true}); // LINT return Status::OK; } if (rc == Status::WARN_ALREADY_EXISTS) { // prepare update ti->push_to_write_set( - {storage, OP_TYPE::UPSERT, rec_ptr, val}); // NOLINT + {storage, OP_TYPE::UPSERT, rec_ptr, val}); // LINT return Status::OK; } if (rc == Status::WARN_CONCURRENT_INSERT) { continue; } // else diff --git a/src/concurrency_control/local_set.cpp b/src/concurrency_control/local_set.cpp index 55a4e0e38..12b1edcfc 100644 --- a/src/concurrency_control/local_set.cpp +++ b/src/concurrency_control/local_set.cpp @@ -69,12 +69,12 @@ void local_write_set::push(Token token, write_set_obj&& elem) { } } } else { - cont_for_occ_.emplace_back(std::move(elem)); // NOLINT - if (cont_for_occ_.size() > 100) { // NOLINT + cont_for_occ_.emplace_back(std::move(elem)); // LINT + if (cont_for_occ_.size() > 100) { // LINT // swtich to use cont_for_bt_ for performance set_for_batch(true); for (auto&& elem_occ : cont_for_occ_) { - cont_for_bt_.insert_or_assign(elem_occ.get_rec_ptr(), // NOLINT + cont_for_bt_.insert_or_assign(elem_occ.get_rec_ptr(), // LINT std::move(elem_occ)); } // clear occ set diff --git a/src/concurrency_control/ongoing_tx.cpp b/src/concurrency_control/ongoing_tx.cpp index 4a23bd3b4..2a51254c6 100644 --- a/src/concurrency_control/ongoing_tx.cpp +++ b/src/concurrency_control/ongoing_tx.cpp @@ -251,7 +251,7 @@ void ongoing_tx::remove_id(std::size_t const id) { epoch::epoch_t lep{0}; bool first{true}; bool erased{false}; - for (auto it = tx_info_.begin(); it != tx_info_.end();) { // NOLINT + for (auto it = tx_info_.begin(); it != tx_info_.end();) { // LINT if (!erased && std::get(*it) == id) { tx_info_.erase(it); // TODO: it = ? diff --git a/src/concurrency_control/read_by.cpp b/src/concurrency_control/read_by.cpp index ddac1f591..c6994d7fc 100644 --- a/src/concurrency_control/read_by.cpp +++ b/src/concurrency_control/read_by.cpp @@ -46,7 +46,7 @@ void point_read_by_long::push(body_elem_type const elem) { // gc // TODO at 559: too erase, threshold must be cc safe ss epoch std::size_t erase_count{0}; - for (auto itr = body_.begin(); itr != body_.end();) { // NOLINT + for (auto itr = body_.begin(); itr != body_.end();) { // LINT if ((*itr).second < elem.second) { // high priori // check gc @@ -67,7 +67,7 @@ void point_read_by_long::push(body_elem_type const elem) { } // erase in bulk if (erase_count > 0) { - body_.erase(body_.begin(), body_.begin() + erase_count); // NOLINT + body_.erase(body_.begin(), body_.begin() + erase_count); // LINT } // push info @@ -76,7 +76,7 @@ void point_read_by_long::push(body_elem_type const elem) { void point_read_by_long::print() { LOG(INFO) << ">> print point_read_by_long"; - for (auto itr = body_.begin(); itr != body_.end();) { // NOLINT + for (auto itr = body_.begin(); itr != body_.end();) { // LINT LOG(INFO) << (*itr).first << ", " << (*itr).second; } LOG(INFO) << "<< print point_read_by_long"; @@ -135,7 +135,7 @@ void range_read_by_long::push(body_elem_type const& elem) { // gc std::size_t erase_count{0}; - for (auto itr = body_.begin(); itr != body_.end();) { // NOLINT + for (auto itr = body_.begin(); itr != body_.end();) { // LINT if (std::get(*itr) < tx_id) { // high priori if (std::get(*itr) < @@ -156,7 +156,7 @@ void range_read_by_long::push(body_elem_type const& elem) { // erase in bulk if (erase_count > 0) { - body_.erase(body_.begin(), body_.begin() + erase_count); // NOLINT + body_.erase(body_.begin(), body_.begin() + erase_count); // LINT } // push info diff --git a/src/concurrency_control/read_plan.cpp b/src/concurrency_control/read_plan.cpp index 6364f29f5..ef08be83f 100644 --- a/src/concurrency_control/read_plan.cpp +++ b/src/concurrency_control/read_plan.cpp @@ -63,15 +63,15 @@ bool read_plan::check_potential_read_anti(std::size_t const tx_id, // check key range level // todo: use constant value, not magic number std::string w_lkey = - std::get<0>(elem.second); // NOLINT + std::get<0>(elem.second); // LINT std::string w_rkey = - std::get<1>(elem.second); // NOLINT - std::string r_lkey = std::get<2>(p_elem); // NOLINT + std::get<1>(elem.second); // LINT + std::string r_lkey = std::get<2>(p_elem); // LINT scan_endpoint r_lpoint = - std::get<3>(p_elem); // NOLINT - std::string r_rkey = std::get<4>(p_elem); // NOLINT + std::get<3>(p_elem); // LINT + std::string r_rkey = std::get<4>(p_elem); // LINT scan_endpoint r_rpoint = - std::get<5>(p_elem); // NOLINT + std::get<5>(p_elem); // LINT // define write range [], read range () if ( // case: [(]) diff --git a/src/concurrency_control/record.cpp b/src/concurrency_control/record.cpp index 2aaee292e..aa0b1eb34 100644 --- a/src/concurrency_control/record.cpp +++ b/src/concurrency_control/record.cpp @@ -15,13 +15,13 @@ Record::~Record() { auto* ver = get_latest(); while (ver != nullptr) { auto* ver_tmp = ver->get_next(); - delete ver; // NOLINT + delete ver; // LINT ver = ver_tmp; } } Record::Record(std::string_view const key) : key_(key) { - latest_.store(new version(), std::memory_order_release); // NOLINT + latest_.store(new version(), std::memory_order_release); // LINT tidw_.set_lock(false); tidw_.set_latest(true); tidw_.set_absent(true); @@ -29,7 +29,7 @@ Record::Record(std::string_view const key) : key_(key) { Record::Record(std::string_view const key, std::string_view const val) : key_(key) { - latest_.store(new version(val), std::memory_order_release); // NOLINT + latest_.store(new version(val), std::memory_order_release); // LINT tidw_.set_lock(true); tidw_.set_latest(true); tidw_.set_absent(true); diff --git a/src/concurrency_control/sequence.cpp b/src/concurrency_control/sequence.cpp index 8d38cba3a..4d0a013f3 100644 --- a/src/concurrency_control/sequence.cpp +++ b/src/concurrency_control/sequence.cpp @@ -23,7 +23,7 @@ Status create_sequence(SequenceId* const id) { return ret; } -Status update_sequence(Token const token, SequenceId const id, // NOLINT +Status update_sequence(Token const token, SequenceId const id, // LINT SequenceVersion const version, SequenceValue const value) { shirakami_log_entry << "update_sequence, token: " << token << ", id: " << id @@ -73,7 +73,7 @@ void sequence::gc_sequence_map() { if (gc_epoch > garbage::get_min_batch_epoch()) { gc_epoch = garbage::get_min_batch_epoch(); } - for (auto it = sequence::sequence_map().begin(); // NOLINT + for (auto it = sequence::sequence_map().begin(); // LINT it != sequence::sequence_map().end();) { // avoid range based for-loop since erase() updates base map structure auto&& each_id_sequence_object = *it; @@ -283,16 +283,16 @@ Status sequence::create_sequence(SequenceId* id) { // logging sequence operation // gen key std::string key{}; - key.append(reinterpret_cast(id), sizeof(*id)); // NOLINT + key.append(reinterpret_cast(id), sizeof(*id)); // LINT // gen value std::tuple initial_pair = sequence::initial_value; SequenceVersion initial_version{std::get<0>(initial_pair)}; SequenceValue initial_value{std::get<1>(initial_pair)}; std::string value{}; // value is version + value - value.append(reinterpret_cast(&initial_version), // NOLINT + value.append(reinterpret_cast(&initial_version), // LINT sizeof(initial_version)); - value.append(reinterpret_cast(&initial_value), // NOLINT + value.append(reinterpret_cast(&initial_value), // LINT sizeof(initial_value)); ret = tx_begin({token, transaction_options::transaction_type::SHORT}); if (ret != Status::OK) { @@ -328,7 +328,7 @@ Status sequence::create_sequence(SequenceId* id) { return Status::OK; } -Status sequence::update_sequence(Token const token, // NOLINT +Status sequence::update_sequence(Token const token, // LINT SequenceId const id, SequenceVersion const version, SequenceValue const value) { @@ -394,16 +394,16 @@ Status sequence::delete_sequence(SequenceId const id) { // logging sequence operation // gen key std::string key{}; - key.append(reinterpret_cast(&id), sizeof(id)); // NOLINT + key.append(reinterpret_cast(&id), sizeof(id)); // LINT // gen value std::tuple new_tuple = sequence::non_exist_value; SequenceVersion version = std::get<0>(new_tuple); SequenceValue value = std::get<1>(new_tuple); std::string new_value{}; // value is version + value - new_value.append(reinterpret_cast(&version), // NOLINT + new_value.append(reinterpret_cast(&version), // LINT sizeof(version)); - new_value.append(reinterpret_cast(&value), // NOLINT + new_value.append(reinterpret_cast(&value), // LINT sizeof(value)); ret = tx_begin({token, transaction_options::transaction_type::SHORT}); if (ret != Status::OK) { diff --git a/src/concurrency_control/session.cpp b/src/concurrency_control/session.cpp index 2daac3325..13571b495 100644 --- a/src/concurrency_control/session.cpp +++ b/src/concurrency_control/session.cpp @@ -53,7 +53,7 @@ void session::commit_sequence(tid_word ctid) { #ifdef PWAL std::vector log_recs{}; #endif - for (auto itr = ss.begin(); itr != ss.end();) { // NOLINT + for (auto itr = ss.begin(); itr != ss.end();) { // LINT SequenceId id = itr->first; SequenceVersion version = std::get<0>(itr->second); SequenceValue value = std::get<1>(itr->second); @@ -76,13 +76,13 @@ void session::commit_sequence(tid_word ctid) { // This entry is valid. it generates log. // gen key std::string key{}; - key.append(reinterpret_cast(&id), // NOLINT + key.append(reinterpret_cast(&id), // LINT sizeof(id)); // gen value std::string new_value{}; // value is version + value - new_value.append(reinterpret_cast(&version), // NOLINT + new_value.append(reinterpret_cast(&version), // LINT sizeof(version)); - new_value.append(reinterpret_cast(&value), // NOLINT + new_value.append(reinterpret_cast(&value), // LINT sizeof(value)); log_operation lo{log_operation::UPSERT}; // log to local to reduce contention for locks diff --git a/src/concurrency_control/session_table.cpp b/src/concurrency_control/session_table.cpp index ee347ba83..9d5b39abb 100644 --- a/src/concurrency_control/session_table.cpp +++ b/src/concurrency_control/session_table.cpp @@ -5,7 +5,7 @@ namespace shirakami { -Status session_table::decide_token(Token& token) { // NOLINT +Status session_table::decide_token(Token& token) { // LINT for (auto&& itr : get_session_table()) { if (!itr.get_visible()) { bool expected(false); diff --git a/src/concurrency_control/tid.cpp b/src/concurrency_control/tid.cpp index 3fba5ff01..eb1d85124 100644 --- a/src/concurrency_control/tid.cpp +++ b/src/concurrency_control/tid.cpp @@ -13,7 +13,7 @@ namespace shirakami { -void tid_word::lock(bool by_gc) { // NOLINT +void tid_word::lock(bool by_gc) { // LINT tid_word expected; tid_word desired; expected.get_obj() = loadAcquire(get_obj()); @@ -34,13 +34,13 @@ void tid_word::lock(bool by_gc) { // NOLINT } void tid_word::display() { - std::cout << "obj_ : " << std::bitset(obj_) // NOLINT - << std::endl; // NOLINT - std::cout << "lock_ : " << lock_ << std::endl; // NOLINT - std::cout << "latest_ : " << latest_ << std::endl; // NOLINT - std::cout << "absent_ : " << absent_ << std::endl; // NOLINT - std::cout << "tid_ : " << tid_ << std::endl; // NOLINT - std::cout << "epoch_ : " << epoch_ << std::endl; // NOLINT + std::cout << "obj_ : " << std::bitset(obj_) // LINT + << std::endl; // LINT + std::cout << "lock_ : " << lock_ << std::endl; // LINT + std::cout << "latest_ : " << latest_ << std::endl; // LINT + std::cout << "absent_ : " << absent_ << std::endl; // LINT + std::cout << "tid_ : " << tid_ << std::endl; // LINT + std::cout << "epoch_ : " << epoch_ << std::endl; // LINT } } // namespace shirakami diff --git a/src/concurrency_control/transaction_state.cpp b/src/concurrency_control/transaction_state.cpp index 74dd4321f..fef17ab09 100644 --- a/src/concurrency_control/transaction_state.cpp +++ b/src/concurrency_control/transaction_state.cpp @@ -11,7 +11,7 @@ namespace shirakami { -Status acquire_tx_state_handle_body(Token const token, // NOLINT +Status acquire_tx_state_handle_body(Token const token, // LINT TxStateHandle& handle) { auto* ti{static_cast(token)}; // check whether it already begun. @@ -57,7 +57,7 @@ Status acquire_tx_state_handle_body(Token const token, // NOLINT return Status::OK; } -Status acquire_tx_state_handle(Token const token, // NOLINT +Status acquire_tx_state_handle(Token const token, // LINT TxStateHandle& handle) { shirakami_log_entry << "acquire_tx_state_handle, token: " << token << ", handle: " << handle; diff --git a/src/concurrency_control/wp.cpp b/src/concurrency_control/wp.cpp index 37c8c0515..d6c86f812 100644 --- a/src/concurrency_control/wp.cpp +++ b/src/concurrency_control/wp.cpp @@ -164,19 +164,19 @@ Status fin() { Status find_page_set_meta(Storage st, page_set_meta*& ret) { Storage page_set_meta_storage = get_page_set_meta_storage(); std::string_view page_set_meta_storage_view = { - reinterpret_cast(&page_set_meta_storage), // NOLINT + reinterpret_cast(&page_set_meta_storage), // LINT sizeof(page_set_meta_storage)}; std::string_view storage_view = { - reinterpret_cast(&st), // NOLINT + reinterpret_cast(&st), // LINT sizeof(st)}; std::pair out{}; - auto rc{yakushima::get(page_set_meta_storage_view, // NOLINT + auto rc{yakushima::get(page_set_meta_storage_view, // LINT storage_view, out)}; if (rc != yakushima::status::OK) { ret = nullptr; return Status::WARN_NOT_FOUND; } - ret = reinterpret_cast(out.first); // NOLINT + ret = reinterpret_cast(out.first); // LINT // by inline optimization return Status::OK; } @@ -234,15 +234,15 @@ Status write_preserve(Token token, std::vector storage, for (auto&& wp_target : storage) { Storage page_set_meta_storage = get_page_set_meta_storage(); std::string_view page_set_meta_storage_view = { - reinterpret_cast( // NOLINT + reinterpret_cast( // LINT &page_set_meta_storage), sizeof(page_set_meta_storage)}; std::string_view storage_view = { - reinterpret_cast(&wp_target), // NOLINT + reinterpret_cast(&wp_target), // LINT sizeof(wp_target)}; std::pair out{}; - auto rc{yakushima::get( // NOLINT - page_set_meta_storage_view, // NOLINT + auto rc{yakushima::get( // LINT + page_set_meta_storage_view, // LINT storage_view, out)}; auto cleanup_process = [ti, long_tx_id]() { @@ -263,7 +263,7 @@ Status write_preserve(Token token, std::vector storage, return Status::WARN_INVALID_ARGS; } wp_meta* target_wp_meta = - (reinterpret_cast(out.first)) // NOLINT + (reinterpret_cast(out.first)) // LINT ->get_wp_meta_ptr(); if (target_wp_meta->register_wp(valid_epoch, long_tx_id) != Status::OK) { diff --git a/src/concurrency_control/wp_lock.cpp b/src/concurrency_control/wp_lock.cpp index 6a838387c..ae30df0b7 100644 --- a/src/concurrency_control/wp_lock.cpp +++ b/src/concurrency_control/wp_lock.cpp @@ -16,7 +16,7 @@ void wp_lock::lock() { expected = obj.load(std::memory_order_acquire); continue; } - std::uint64_t desired{expected | 1}; // NOLINT + std::uint64_t desired{expected | 1}; // LINT if (obj.compare_exchange_weak(expected, desired, std::memory_order_acq_rel, std::memory_order_acquire)) { @@ -27,9 +27,9 @@ void wp_lock::lock() { void wp_lock::unlock() { std::uint64_t desired{obj.load(std::memory_order_acquire)}; - std::uint64_t locked_num{desired >> 1}; // NOLINT + std::uint64_t locked_num{desired >> 1}; // LINT ++locked_num; - desired = locked_num << 1; // NOLINT + desired = locked_num << 1; // LINT obj.store(desired, std::memory_order_release); } diff --git a/src/database/database.cpp b/src/database/database.cpp index c574b8f84..760068ead 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -14,7 +14,7 @@ namespace shirakami { -[[maybe_unused]] Status delete_all_records() { // NOLINT +[[maybe_unused]] Status delete_all_records() { // LINT //check list of all storage std::vector storage_list; storage::list_storage(storage_list); diff --git a/src/database/include/database.h b/src/database/include/database.h index 87c2e2a94..f70564f9c 100644 --- a/src/database/include/database.h +++ b/src/database/include/database.h @@ -4,9 +4,9 @@ namespace shirakami { -inline std::atomic is_shutdowning_{false}; // NOLINT +inline std::atomic is_shutdowning_{false}; // LINT -inline database_options used_database_options_{}; // NOLINT +inline database_options used_database_options_{}; // LINT [[maybe_unused]] static database_options get_used_database_options() { return used_database_options_; @@ -32,6 +32,6 @@ set_used_database_options(database_options const& dos) { * This is not transactional operation. * @return Status::OK success */ -[[maybe_unused]] extern Status delete_all_records(); // NOLINT +[[maybe_unused]] extern Status delete_all_records(); // LINT } // namespace shirakami diff --git a/src/database/include/logging.h b/src/database/include/logging.h index a2ff978df..5aecc09ab 100644 --- a/src/database/include/logging.h +++ b/src/database/include/logging.h @@ -28,15 +28,15 @@ inline std::atomic is_debug_mode_{false}; namespace shirakami::logging { #define shirakami_log_entry \ - VLOG(log_trace) << std::boolalpha << log_location_prefix << "-->" // NOLINT + VLOG(log_trace) << std::boolalpha << log_location_prefix << "-->" // LINT #define shirakami_log_exit \ - VLOG(log_trace) << std::boolalpha << log_location_prefix << "<--" // NOLINT + VLOG(log_trace) << std::boolalpha << log_location_prefix << "<--" // LINT #define shirakami_ex_log_entry \ VLOG(log_ex_trace) << std::boolalpha << log_location_prefix \ - << "-->" // NOLINT + << "-->" // LINT #define shirakami_ex_log_exit \ VLOG(log_ex_trace) << std::boolalpha << log_location_prefix \ - << "<--" // NOLINT + << "<--" // LINT inline std::atomic enable_logging_detail_info_{false}; diff --git a/src/database/include/thread_pool.h b/src/database/include/thread_pool.h index f6fbcee51..73f3a8bd8 100644 --- a/src/database/include/thread_pool.h +++ b/src/database/include/thread_pool.h @@ -20,12 +20,12 @@ class alignas(CACHE_LINE_SIZE) thread_pool { /** * @brief init thread pool */ - static void init(std::size_t thread_pool_size = 10) { // NOLINT + static void init(std::size_t thread_pool_size = 10) { // LINT // set thread pool size set_thread_pool_size(thread_pool_size); // gen thread array - get_threads().reset(new std::thread[get_thread_pool_size()]); // NOLINT + get_threads().reset(new std::thread[get_thread_pool_size()]); // LINT // set flag set_running(true); @@ -61,7 +61,7 @@ class alignas(CACHE_LINE_SIZE) thread_pool { return running_.load(std::memory_order_acquire); } - static std::unique_ptr& get_threads() { // NOLINT + static std::unique_ptr& get_threads() { // LINT return threads_; } @@ -84,22 +84,22 @@ class alignas(CACHE_LINE_SIZE) thread_pool { /** * @brief # of threads of thread pool. */ - static inline std::size_t thread_pool_size_{}; // NOLINT + static inline std::size_t thread_pool_size_{}; // LINT /** * @brief whether thread pool runs */ - static inline std::atomic running_{false}; // NOLINT + static inline std::atomic running_{false}; // LINT /** * @brief threads of thread pool */ - static inline std::unique_ptr threads_; // NOLINT + static inline std::unique_ptr threads_; // LINT /** * @brief task container */ - static inline concurrent_queue task_queue_; // NOLINT + static inline concurrent_queue task_queue_; // LINT }; } // namespace shirakami diff --git a/src/database/include/tx_state_notification.h b/src/database/include/tx_state_notification.h index 976a75eee..ca2a83bd5 100644 --- a/src/database/include/tx_state_notification.h +++ b/src/database/include/tx_state_notification.h @@ -7,7 +7,7 @@ namespace shirakami { -inline std::vector durability_callbacks{}; // NOLINT +inline std::vector durability_callbacks{}; // LINT inline std::mutex mtx_durability_callbacks{}; diff --git a/src/database/tx_state_notification.cpp b/src/database/tx_state_notification.cpp index c9ad1fb1f..3e37b5556 100644 --- a/src/database/tx_state_notification.cpp +++ b/src/database/tx_state_notification.cpp @@ -36,7 +36,7 @@ void clear_durability_callbacks() { } Status -register_durability_callback(durability_callback_type const cb) { // NOLINT +register_durability_callback(durability_callback_type const cb) { // LINT shirakami_log_entry << "register_durability_callback"; add_durability_callbacks(cb); shirakami_log_exit << "register_durability_callback"; diff --git a/src/datastore/limestone/datastore.cpp b/src/datastore/limestone/datastore.cpp index 3c50a7685..9bd9a5272 100644 --- a/src/datastore/limestone/datastore.cpp +++ b/src/datastore/limestone/datastore.cpp @@ -33,8 +33,8 @@ void init_about_session_table(std::string_view log_dir_path) { void recovery_storage_meta(std::vector& st_list) { std::sort(st_list.begin(), st_list.end()); st_list.erase(std::unique(st_list.begin(), st_list.end()), st_list.end()); - if (st_list.back() >= (storage::initial_strg_ctr << 32)) { // NOLINT - storage::set_strg_ctr((st_list.back() >> 32) + 1); // NOLINT + if (st_list.back() >= (storage::initial_strg_ctr << 32)) { // LINT + storage::set_strg_ctr((st_list.back() >> 32) + 1); // LINT } else { storage::set_strg_ctr(storage::initial_strg_ctr); } @@ -66,7 +66,7 @@ void recovery_from_datastore() { rec_ptr->set_value(val); } else { // create record - rec_ptr = new Record(key); // NOLINT + rec_ptr = new Record(key); // LINT // fix record contents // about value rec_ptr->set_value(val); @@ -106,16 +106,16 @@ void recovery_from_datastore() { } memcpy(&st2, val.data(), sizeof(st2)); storage_option::id_t id{}; - memcpy(&id, val.data() + sizeof(st2), sizeof(id)); // NOLINT + memcpy(&id, val.data() + sizeof(st2), sizeof(id)); // LINT std::string payload{}; if (val.size() > sizeof(st2) + sizeof(id)) { - payload.append(val.data() + sizeof(st2) + sizeof(id), // NOLINT + payload.append(val.data() + sizeof(st2) + sizeof(id), // LINT val.size() - sizeof(st2) - sizeof(id)); } std::string new_value{}; - new_value.append(reinterpret_cast(&st2), // NOLINT + new_value.append(reinterpret_cast(&st2), // LINT sizeof(st2)); - new_value.append(reinterpret_cast(&id), // NOLINT + new_value.append(reinterpret_cast(&id), // LINT sizeof(id)); new_value.append(payload); // check st2 existence @@ -171,7 +171,7 @@ void recovery_from_datastore() { SequenceVersion version{}; memcpy(&version, val.data(), sizeof(version)); SequenceValue value{}; - memcpy(&value, val.data() + sizeof(version), // NOLINT + memcpy(&value, val.data() + sizeof(version), // LINT sizeof(version)); auto ret = sequence::sequence_map_push(id, 0, version, value); if (ret != Status::OK) { @@ -212,7 +212,7 @@ void scan_all_and_logging() { if (rc == Status::OK) { // It found some records for (auto&& each_rec : scan_res) { - Record* rec_ptr{reinterpret_cast( // NOLINT + Record* rec_ptr{reinterpret_cast( // LINT std::get<1>(each_rec))}; // get key val info. std::string key{}; diff --git a/src/datastore/limestone/include/datastore.h b/src/datastore/limestone/include/datastore.h index 1c4305a6d..37f10a9ff 100644 --- a/src/datastore/limestone/include/datastore.h +++ b/src/datastore/limestone/include/datastore.h @@ -7,7 +7,7 @@ namespace shirakami::datastore { -inline std::unique_ptr datastore_; // NOLINT +inline std::unique_ptr datastore_; // LINT [[maybe_unused]] static limestone::api::datastore* get_datastore() { return datastore_.get(); diff --git a/src/include/atomic_wrapper.h b/src/include/atomic_wrapper.h index b16f11f17..0952e553c 100644 --- a/src/include/atomic_wrapper.h +++ b/src/include/atomic_wrapper.h @@ -11,26 +11,26 @@ namespace shirakami { * @brief atomic relaxed load. */ template -[[maybe_unused]] static T loadRelaxed(T& ptr) { // NOLINT - return __atomic_load_n(&ptr, __ATOMIC_RELAXED); // NOLINT +[[maybe_unused]] static T loadRelaxed(T& ptr) { // LINT + return __atomic_load_n(&ptr, __ATOMIC_RELAXED); // LINT } template -[[maybe_unused]] static T loadRelaxed(T* ptr) { // NOLINT - return __atomic_load_n(ptr, __ATOMIC_RELAXED); // NOLINT +[[maybe_unused]] static T loadRelaxed(T* ptr) { // LINT + return __atomic_load_n(ptr, __ATOMIC_RELAXED); // LINT } /** * @brief atomic acquire load. */ template -static T loadAcquire(T& ptr) { // NOLINT - return __atomic_load_n(&ptr, __ATOMIC_ACQUIRE); // NOLINT +static T loadAcquire(T& ptr) { // LINT + return __atomic_load_n(&ptr, __ATOMIC_ACQUIRE); // LINT } template -[[maybe_unused]] static T loadAcquire(T* ptr) { // NOLINT - return __atomic_load_n(ptr, __ATOMIC_ACQUIRE); // NOLINT +[[maybe_unused]] static T loadAcquire(T* ptr) { // LINT + return __atomic_load_n(ptr, __ATOMIC_ACQUIRE); // LINT } /** @@ -38,12 +38,12 @@ template */ template [[maybe_unused]] static void storeRelaxed(T& ptr, T2 val) { - __atomic_store_n(&ptr, (T) val, __ATOMIC_RELAXED); // NOLINT + __atomic_store_n(&ptr, (T) val, __ATOMIC_RELAXED); // LINT } template [[maybe_unused]] static void storeRelaxed(T* ptr, T2 val) { - __atomic_store_n(ptr, (T) val, __ATOMIC_RELAXED); // NOLINT + __atomic_store_n(ptr, (T) val, __ATOMIC_RELAXED); // LINT } /** @@ -51,20 +51,20 @@ template */ template static void storeRelease(T& ptr, T2 val) { - __atomic_store_n(&ptr, (T) val, __ATOMIC_RELEASE); // NOLINT + __atomic_store_n(&ptr, (T) val, __ATOMIC_RELEASE); // LINT } template [[maybe_unused]] static void storeRelease(T* ptr, T2 val) { - __atomic_store_n(ptr, (T) val, __ATOMIC_RELEASE); // NOLINT + __atomic_store_n(ptr, (T) val, __ATOMIC_RELEASE); // LINT } /** * @brief atomic acq-rel cas. */ template -static bool compareExchange(T& m, T& before, T2 after) { // NOLINT - return __atomic_compare_exchange_n(&m, &before, (T) after, false, // NOLINT +static bool compareExchange(T& m, T& before, T2 after) { // LINT + return __atomic_compare_exchange_n(&m, &before, (T) after, false, // LINT __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE); } diff --git a/src/include/clock.h b/src/include/clock.h index 8776807fa..f23726048 100644 --- a/src/include/clock.h +++ b/src/include/clock.h @@ -10,7 +10,7 @@ namespace shirakami { -[[maybe_unused]] static bool check_clock_span(uint64_t& start, // NOLINT +[[maybe_unused]] static bool check_clock_span(uint64_t& start, // LINT uint64_t& stop, uint64_t threshold) { uint64_t diff{stop - start}; diff --git a/src/include/compiler.h b/src/include/compiler.h index 498022331..02f5eeec9 100644 --- a/src/include/compiler.h +++ b/src/include/compiler.h @@ -6,10 +6,10 @@ namespace shirakami { -#define likely(x) __builtin_expect(!!(x), 1) // NOLINT -#define unlikely(x) __builtin_expect(!!(x), 0) // NOLINT +#define likely(x) __builtin_expect(!!(x), 1) // LINT +#define unlikely(x) __builtin_expect(!!(x), 0) // LINT -#define STRING(macro) #macro // NOLINT -#define MAC2STR(macro) STRING(macro) // NOLINT +#define STRING(macro) #macro // LINT +#define MAC2STR(macro) STRING(macro) // LINT } // namespace shirakami diff --git a/src/include/concurrent_queue.h b/src/include/concurrent_queue.h index a5f0db007..6c67145c5 100644 --- a/src/include/concurrent_queue.h +++ b/src/include/concurrent_queue.h @@ -9,7 +9,7 @@ namespace shirakami { template -class concurrent_queue { // NOLINT +class concurrent_queue { // LINT // Begin : intel tbb public: void clear() { return queue.clear(); } diff --git a/src/include/cpu.h b/src/include/cpu.h index 1ed2e218d..f6228f2c7 100644 --- a/src/include/cpu.h +++ b/src/include/cpu.h @@ -22,10 +22,10 @@ namespace shirakami { /** * @brief cache line size is 64 bytes. */ -static constexpr std::size_t CACHE_LINE_SIZE{64}; // NOLINT +static constexpr std::size_t CACHE_LINE_SIZE{64}; // LINT #else #undef CACHE_LINE_SIZE -static constexpr std::size_t CACHE_LINE_SIZE{64}; // NOLINT +static constexpr std::size_t CACHE_LINE_SIZE{64}; // LINT #endif #ifdef SHIRAKAMI_LINUX @@ -36,7 +36,7 @@ static constexpr std::size_t CACHE_LINE_SIZE{64}; // NOLINT int local_n_processors = n_processors.load(memory_order_acquire); for (;;) { if (local_n_processors != -1) { break; } - int desired = sysconf(_SC_NPROCESSORS_CONF); // NOLINT + int desired = sysconf(_SC_NPROCESSORS_CONF); // LINT if (n_processors.compare_exchange_strong(local_n_processors, desired, memory_order_acq_rel, memory_order_acquire)) { @@ -44,11 +44,11 @@ static constexpr std::size_t CACHE_LINE_SIZE{64}; // NOLINT } } - pid_t pid = syscall(SYS_gettid); // NOLINT + pid_t pid = syscall(SYS_gettid); // LINT cpu_set_t cpu_set; CPU_ZERO(&cpu_set); - CPU_SET(my_id % local_n_processors, &cpu_set); // NOLINT + CPU_SET(my_id % local_n_processors, &cpu_set); // LINT if (sched_setaffinity(pid, sizeof(cpu_set_t), &cpu_set) != 0) { LOG_FIRST_N(ERROR, 1); @@ -57,7 +57,7 @@ static constexpr std::size_t CACHE_LINE_SIZE{64}; // NOLINT } [[maybe_unused]] static void setThreadAffinity(const cpu_set_t id) { - pid_t pid = syscall(SYS_gettid); // NOLINT + pid_t pid = syscall(SYS_gettid); // LINT if (sched_setaffinity(pid, sizeof(cpu_set_t), &id) != 0) { LOG_FIRST_N(ERROR, 1); @@ -65,8 +65,8 @@ static constexpr std::size_t CACHE_LINE_SIZE{64}; // NOLINT } } -[[maybe_unused]] static cpu_set_t getThreadAffinity() { // NOLINT - pid_t pid = syscall(SYS_gettid); // NOLINT +[[maybe_unused]] static cpu_set_t getThreadAffinity() { // LINT + pid_t pid = syscall(SYS_gettid); // LINT cpu_set_t result; if (sched_getaffinity(pid, sizeof(cpu_set_t), &result) != 0) { diff --git a/src/include/memory.h b/src/include/memory.h index db9c5940a..027712b60 100644 --- a/src/include/memory.h +++ b/src/include/memory.h @@ -19,17 +19,17 @@ namespace shirakami { if (getrusage(RUSAGE_SELF, &r) != 0) { LOG_FIRST_N(ERROR, 1) << "getrusage error"; } - return r.ru_maxrss; // NOLINT + return r.ru_maxrss; // LINT } -[[maybe_unused]] static void displayRusageRUMaxrss() { // NOLINT +[[maybe_unused]] static void displayRusageRUMaxrss() { // LINT struct rusage r {}; if (getrusage(RUSAGE_SELF, &r) != 0) { LOG_FIRST_N(ERROR, 1) << "getrusage error."; return; } std::size_t maxrss{getRusageRUMaxrss()}; - printf("maxrss:\t%ld kB\n", maxrss); // NOLINT + printf("maxrss:\t%ld kB\n", maxrss); // LINT } } // namespace shirakami diff --git a/src/include/sequence.h b/src/include/sequence.h index 196a2602f..1321cdecd 100644 --- a/src/include/sequence.h +++ b/src/include/sequence.h @@ -120,7 +120,7 @@ class sequence { } private: - static inline std::map sequence_map_; // NOLINT + static inline std::map sequence_map_; // LINT static inline std::atomic id_generator_ctr_{0}; static inline std::shared_mutex sequence_map_smtx_; }; diff --git a/src/include/storage.h b/src/include/storage.h index 857c45836..0c960c43b 100644 --- a/src/include/storage.h +++ b/src/include/storage.h @@ -58,7 +58,7 @@ class storage { static Status key_handle_map_erase(Storage storage) { std::lock_guard lk{mtx_key_handle_map_}; - for (auto itr = key_handle_map_.begin(); // NOLINT + for (auto itr = key_handle_map_.begin(); // LINT itr != key_handle_map_.end(); ++itr) { if (itr->second == storage) { key_handle_map_.erase(itr); @@ -77,7 +77,7 @@ class storage { */ [[nodiscard]] static Status key_handle_map_erase_storage_without_lock(Storage st, std::string& out) { - for (auto itr = key_handle_map_.begin(); // NOLINT + for (auto itr = key_handle_map_.begin(); // LINT itr != key_handle_map_.end(); ++itr) { if (itr->second == st) { out = itr->first; @@ -154,7 +154,7 @@ class storage { * @return Status::OK success. */ static Status register_storage(Storage storage, - storage_option options = {}); // NOLINT + storage_option options = {}); // LINT /** * @brief Create a storage object @@ -209,20 +209,20 @@ class storage { /** * @attention The number of storages above UINT64_MAX is undefined behavior. */ - static inline std::atomic strg_ctr_{initial_strg_ctr}; // NOLINT + static inline std::atomic strg_ctr_{initial_strg_ctr}; // LINT /** * @brief key handle map * @details key is storage's key given by outside. value is storage id * given by internally. */ - static inline std::unordered_map // NOLINT - key_handle_map_; // NOLINT + static inline std::unordered_map // LINT + key_handle_map_; // LINT /** * @brief Mutex for key handle map. */ - static inline std::shared_mutex mtx_key_handle_map_; // NOLINT + static inline std::shared_mutex mtx_key_handle_map_; // LINT }; } // namespace shirakami diff --git a/src/include/tsc.h b/src/include/tsc.h index 3e645354e..cc1a2626b 100644 --- a/src/include/tsc.h +++ b/src/include/tsc.h @@ -8,24 +8,24 @@ namespace shirakami { -[[maybe_unused]] static uint64_t rdtsc() { // NOLINT +[[maybe_unused]] static uint64_t rdtsc() { // LINT uint64_t rax{}; uint64_t rdx{}; - asm volatile("cpuid" ::: "rax", "rbx", "rcx", "rdx"); // NOLINT - asm volatile("rdtsc" : "=a"(rax), "=d"(rdx)); // NOLINT + asm volatile("cpuid" ::: "rax", "rbx", "rcx", "rdx"); // LINT + asm volatile("rdtsc" : "=a"(rax), "=d"(rdx)); // LINT - return (rdx << 32) | rax; // NOLINT + return (rdx << 32) | rax; // LINT } -[[maybe_unused]] static uint64_t rdtscp() { // NOLINT +[[maybe_unused]] static uint64_t rdtscp() { // LINT uint64_t rax{}; uint64_t rdx{}; uint64_t aux{}; - asm volatile("rdtscp" : "=a"(rax), "=d"(rdx), "=c"(aux)::); // NOLINT + asm volatile("rdtscp" : "=a"(rax), "=d"(rdx), "=c"(aux)::); // LINT - return (rdx << 32) | rax; // NOLINT + return (rdx << 32) | rax; // LINT } } // namespace shirakami diff --git a/src/index/yakushima/include/interface.h b/src/index/yakushima/include/interface.h index 85612a900..4d3d20538 100644 --- a/src/index/yakushima/include/interface.h +++ b/src/index/yakushima/include/interface.h @@ -16,15 +16,15 @@ namespace shirakami { template Status get(Storage st, std::string_view const key, Record*& rec_ptr, - std::pair* checked_version = // NOLINT - nullptr) { // NOLINT + std::pair* checked_version = // LINT + nullptr) { // LINT std::pair out{}; - auto rc{yakushima::get({reinterpret_cast(&st), // NOLINT + auto rc{yakushima::get({reinterpret_cast(&st), // LINT sizeof(st)}, key, out, checked_version)}; if (rc == yakushima::status::OK) { - rec_ptr = reinterpret_cast(out.first); // NOLINT + rec_ptr = reinterpret_cast(out.first); // LINT // by inline optimization return Status::OK; } @@ -49,20 +49,20 @@ template yakushima::status put(yakushima::Token tk, Storage st, std::string_view key, Record* rec_ptr, yakushima::node_version64*& nvp) { return yakushima::put( - tk, {reinterpret_cast(&st), sizeof(st)}, key, // NOLINT - &rec_ptr, sizeof(Record*), nullptr, // NOLINT - static_cast(sizeof(Record*)), // NOLINT + tk, {reinterpret_cast(&st), sizeof(st)}, key, // LINT + &rec_ptr, sizeof(Record*), nullptr, // LINT + static_cast(sizeof(Record*)), // LINT true, &nvp); } template yakushima::status put(yakushima::Token tk, Storage st, std::string_view key, std::string_view val) { - Record* rec_ptr = new Record(key, val); // NOLINT + Record* rec_ptr = new Record(key, val); // LINT rec_ptr->reset_ts(); yakushima::node_version64* nvp{}; auto rc{put(tk, st, key, rec_ptr, nvp)}; - if (rc != yakushima::status::OK) { delete rec_ptr; } // NOLINT + if (rc != yakushima::status::OK) { delete rec_ptr; } // LINT return rc; } @@ -100,7 +100,7 @@ scan(Storage st, std::string_view const l_key, scan_endpoint const l_end, yakushima::node_version64*>>* nvec, bool right_to_left) { auto rc{yakushima::scan( - {reinterpret_cast(&st), sizeof(st)}, // NOLINT + {reinterpret_cast(&st), sizeof(st)}, // LINT l_key, parse_scan_endpoint(l_end), r_key, parse_scan_endpoint(r_end), scan_res, nvec, max_size, right_to_left)}; if (rc == yakushima::status::WARN_STORAGE_NOT_EXIST) { @@ -119,7 +119,7 @@ scan(Storage st, std::string_view const l_key, scan_endpoint const l_end, static inline Status remove(yakushima::Token tk, Storage st, std::string_view key) { auto rc{yakushima::remove( - tk, {reinterpret_cast(&st), sizeof(st)}, // NOLINT + tk, {reinterpret_cast(&st), sizeof(st)}, // LINT key)}; if (yakushima::status::OK != rc) { return Status::INTERNAL_WARN_NOT_FOUND; } return Status::OK;