Skip to content

Commit

Permalink
NOLINT
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Jan 16, 2025
1 parent b8a8e30 commit b3ace8b
Show file tree
Hide file tree
Showing 68 changed files with 257 additions and 257 deletions.
2 changes: 1 addition & 1 deletion include/shirakami/api_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace shirakami {
* Please review your usage.
*/
Status create_storage(std::string_view key, Storage& storage,
storage_option const& options = {}); // LINT
storage_option const& options = {}); // NOLINT

/**
* @brief delete existing storage and records under the storage.
Expand Down
4 changes: 2 additions & 2 deletions include/shirakami/binary_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::uint8_t const*>(value.ptr_) + // LINT
auto c = *(static_cast<std::uint8_t const*>(value.ptr_) + // NOLINT
idx);
if (std::isprint(c) != 0) {
out << c;
Expand All @@ -45,7 +45,7 @@ class binary_printer {
out << std::hex << std::setw(2) << std::setfill('0')
<< static_cast<std::uint32_t>(
*(static_cast<std::uint8_t const*>(
value.ptr_) + // LINT
value.ptr_) + // NOLINT
idx));
}
}
Expand Down
4 changes: 2 additions & 2 deletions include/shirakami/database_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class database_options final {

database_options() = default; // LINT

database_options(open_mode om) : open_mode_(om) {} // LINT
database_options(open_mode om) : open_mode_(om) {} // NOLINT

database_options(open_mode om, std::filesystem::path&& log_directory_path)
: open_mode_(om), log_directory_path_(log_directory_path) {}
Expand Down Expand Up @@ -99,7 +99,7 @@ class database_options final {
/**
* @brief Parameter of epoch [us]
*/
std::size_t epoch_time_{40000}; // LINT
std::size_t epoch_time_{40000}; // NOLINT
// ==========

// ==========
Expand Down
10 changes: 5 additions & 5 deletions include/shirakami/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); // LINT
void fin(bool force_shut_down_logging = true); // NOLINT

/**
* @brief It initializes shirakami's environment.
Expand All @@ -174,7 +174,7 @@ void fin(bool force_shut_down_logging = true); // LINT
* @return Status::WARN_ALREADY_INIT Since it have already called int, it have
* not done anything in this call.
*/
Status init(database_options options = {}); // LINT
Status init(database_options options = {}); // NOLINT

/**
* @brief insert the record with given key/value
Expand Down Expand Up @@ -258,8 +258,8 @@ Status leave(Token token); // LINT
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, // LINT
bool right_to_left = false); // LINT
std::size_t max_size = 0, // NOLINT
bool right_to_left = false); // NOLINT

/**
* @brief advance cursor
Expand Down Expand Up @@ -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 = {}); // LINT
Status tx_begin(transaction_options options = {}); // NOLINT

/**
* @brief It updates the record for the given key.
Expand Down
12 changes: 6 additions & 6 deletions include/shirakami/log_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,35 @@ struct log_record {
* @brief operation type for log record entry.
*
*/
log_operation operation_{}; // LINT
log_operation operation_{}; // NOLINT

/**
* @brief key part of the log record
*/
std::string_view key_{}; // LINT
std::string_view key_{}; // NOLINT

/**
* @brief value part of the log record
*
*/
std::string_view value_{}; // LINT
std::string_view value_{}; // NOLINT

/**
* @brief major version of the log record
*
*/
std::uint64_t major_version_{}; // LINT
std::uint64_t major_version_{}; // NOLINT

/**
* @brief minor version of the log record
*
*/
std::uint64_t minor_version_{}; // LINT
std::uint64_t minor_version_{}; // NOLINT

/**
* @brief storage id where the log record is made
*/
storage_id_type storage_id_{}; // LINT
storage_id_type storage_id_{}; // NOLINT
};

static_assert(std::is_trivially_copyable_v<log_record>);
Expand Down
2 changes: 1 addition & 1 deletion include/shirakami/storage_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class storage_option {
// constructor
storage_option() = default;

storage_option(id_t id) : id_(id) {} // LINT
storage_option(id_t id) : id_(id) {} // NOLINT

storage_option(id_t id, std::string_view pl)
: id_(id), payload_(pl) {} // LINT
Expand Down
4 changes: 2 additions & 2 deletions include/shirakami/transaction_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class transaction_options final {

transaction_options() = default; // LINT

transaction_options(Token token) : token_(token) {} // LINT
transaction_options(Token token) : token_(token) {} // NOLINT

transaction_options(Token token, transaction_type tt)
: token_(token), transaction_type_(tt) {}
Expand Down Expand Up @@ -212,7 +212,7 @@ to_string(const transaction_options::read_area& ra) noexcept {
}

inline std::ostream& operator<<(std::ostream& out,
const transaction_options to) { // LINT
const transaction_options to) { // NOLINT
return out << "Token: " << to.get_token()
<< ", transaction_type: " << to.get_transaction_type()
<< ", write_preserve: " << to_string(to.get_write_preserve())
Expand Down
4 changes: 2 additions & 2 deletions include/shirakami/transaction_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ class TxState final {
*/
Token token_{};
static inline std::atomic<TxStateHandle> handle_ctr_{1}; // LINT
static inline handle_container_type handle_container_; // LINT
static inline handle_container_type handle_container_; // NOLINT
static inline std::shared_mutex mtx_hc_; // LINT
static inline std::vector<TxStateHandle> reuse_ctr_container_; // LINT
static inline std::vector<TxStateHandle> reuse_ctr_container_; // NOLINT
static inline std::mutex mtx_reuse_ctr_container_; // LINT
};

Expand Down
4 changes: 2 additions & 2 deletions src/concurrency_control/bg_work/bg_commit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void bg_commit::worker() {
std::unique_lock<std::mutex> lk2{mtx_used_ids()};
used_ids().erase(tx_id);
}
goto REFIND; // LINT
goto REFIND; // NOLINT
} // termination was successed
ti->set_result_requested_commit(rc);

Expand All @@ -168,7 +168,7 @@ void bg_commit::worker() {
* リストが空になったら安全に used_ids をクリアする。
*/

goto REFIND; // LINT
goto REFIND; // NOLINT
}

// normal termination, update joined_waiting_resolver
Expand Down
8 changes: 4 additions & 4 deletions src/concurrency_control/bg_work/include/bg_commit.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ class bg_commit {
* @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<std::size_t> // LINT
static inline std::atomic<std::size_t> // NOLINT
joined_waiting_resolver_threads_{};

/**
* @brief ltx commit verify threads
*/
static inline worker_cont_type worker_threads_; // LINT
static inline worker_cont_type worker_threads_; // NOLINT

/**
* @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_; // LINT
static inline used_ids_type used_ids_; // NOLINT

/**
* @brief mutex for @a used_ids_
Expand All @@ -120,7 +120,7 @@ class bg_commit {
/**
* @brief container of long transactions waiting to commit.
*/
static inline cont_type cont_wait_tx_; // LINT
static inline cont_type cont_wait_tx_; // NOLINT
};

} // namespace shirakami::bg_work
12 changes: 6 additions & 6 deletions src/concurrency_control/garbage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; // LINT
delete ver; // NOLINT
++get_gc_ct_ver();
ver = v_next;
}
Expand Down Expand Up @@ -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<char*>(&st), // LINT
std::string_view st_view = {reinterpret_cast<char*>(&st), // NOLINT
sizeof(st)};
// init about stats
record_num = 0;
Expand Down Expand Up @@ -308,7 +308,7 @@ inline void unhooking_keys_and_pruning_versions_at_the_storage(
};

for (auto&& sr : scan_res) {
Record* rec_ptr = reinterpret_cast<Record*>(std::get<1>(sr)); // LINT
Record* rec_ptr = reinterpret_cast<Record*>(std::get<1>(sr)); // NOLINT

// gathering stats info
average_key_size += rec_ptr->get_key_view().size();
Expand Down Expand Up @@ -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; } // LINT
for (auto& elem : cont) { delete elem.first; } // NOLINT
cont.clear();
}

Expand All @@ -367,15 +367,15 @@ void release_key_memory() {
* have finished.
*/
if ((*itr).second < me) {
delete (*itr).first; // LINT
delete (*itr).first; // NOLINT
++erase_count;
++itr;
} else {
break;
}
}
if (erase_count > 0) {
cont.erase(cont.begin(), cont.begin() + erase_count); // LINT
cont.erase(cont.begin(), cont.begin() + erase_count); // NOLINT
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/concurrency_control/include/epoch.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ inline std::atomic<epoch_t> global_epoch{initial_epoch}; // LINT
/**
* @brief Global epoch time. Default is 40 ms == 40,000 us.
*/
inline std::atomic<std::size_t> global_epoch_time_us{40 * 1000}; // LINT
inline std::atomic<std::size_t> global_epoch_time_us{40 * 1000}; // NOLINT

/**
* @brief safe snapshot epoch in the viewpoint of concurrency control.
Expand All @@ -47,9 +47,9 @@ inline std::atomic<epoch_t> min_epoch_occ_potentially_write{0};

inline std::atomic<epoch_t> datastore_durable_epoch{0}; // LINT

[[maybe_unused]] inline std::thread epoch_thread; // LINT
[[maybe_unused]] inline std::thread epoch_thread; // NOLINT

[[maybe_unused]] inline std::atomic<bool> epoch_thread_end; // LINT
[[maybe_unused]] inline std::atomic<bool> epoch_thread_end; // NOLINT

[[maybe_unused]] inline std::mutex ep_mtx_; // LINT

Expand Down
6 changes: 3 additions & 3 deletions src/concurrency_control/include/garbage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; // LINT
[[maybe_unused]] inline std::thread cleaner; // NOLINT

/**
* @brief garbage collection manager thread.
* @details Periodically calculate @a min_step_epoch and @a min_batch_epoch.
*/
[[maybe_unused]] inline std::thread manager; // LINT
[[maybe_unused]] inline std::thread manager; // NOLINT

// function for background thread
[[maybe_unused]] void work_manager();
Expand Down Expand Up @@ -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< // LINT
[[maybe_unused]] inline std::vector< // NOLINT
std::pair<Record*, epoch::epoch_t>>
container_rec_{};

Expand Down
2 changes: 1 addition & 1 deletion src/concurrency_control/include/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ namespace shirakami {
* @return Status
*/
Status read_record(Record* rec_ptr, tid_word& tid, std::string& val,
bool read_value = true); // LINT
bool read_value = true); // NOLINT

} // namespace shirakami
6 changes: 3 additions & 3 deletions src/concurrency_control/include/local_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

namespace shirakami {

class read_set_obj { // LINT
class read_set_obj { // NOLINT
public:
read_set_obj(Storage const storage, Record* const rec_ptr,
tid_word const tid) // LINT
tid_word const tid) // NOLINT
: storage_(storage), rec_ptr_(rec_ptr), tid_(tid) {}

read_set_obj(const read_set_obj& right) = delete;
Expand Down Expand Up @@ -66,7 +66,7 @@ class read_set_obj { // LINT

static_assert(std::is_nothrow_move_constructible_v<read_set_obj>);

class write_set_obj { // LINT
class write_set_obj { // NOLINT
public:
// for update / upsert / insert
write_set_obj(Storage const storage, OP_TYPE const op,
Expand Down
4 changes: 2 additions & 2 deletions src/concurrency_control/include/lpwal.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace shirakami::lpwal {
* @brief log directory pointed at initialize.
*
*/
[[maybe_unused]] inline std::string log_dir_{""}; // LINT
[[maybe_unused]] inline std::string log_dir_{""}; // NOLINT

/**
* @brief Whether log_dir is pointed at initialize.
Expand All @@ -51,7 +51,7 @@ namespace shirakami::lpwal {
* @brief This thread is collecting each worker's log.
*
*/
[[maybe_unused]] inline std::thread daemon_thread_; // LINT
[[maybe_unused]] inline std::thread daemon_thread_; // NOLINT

class write_version_type {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/concurrency_control/include/ongoing_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ongoing_tx {
/**
* @brief register info of running long tx's epoch and id.
*/
static inline tx_info_type tx_info_; // LINT
static inline tx_info_type tx_info_; // NOLINT
/**
* @brief enable/disable waiting bypass.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/concurrency_control/include/read_plan.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class read_plan {
/**
* @brief container for read area
*/
static inline cont_type cont_; // LINT
static inline cont_type cont_; // NOLINT
};

} // namespace shirakami
4 changes: 2 additions & 2 deletions src/concurrency_control/include/record.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace shirakami {

class alignas(CACHE_LINE_SIZE) Record { // LINT
class alignas(CACHE_LINE_SIZE) Record { // NOLINT
public:
Record() = default;

Expand All @@ -37,7 +37,7 @@ class alignas(CACHE_LINE_SIZE) Record { // LINT
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); // LINT
latest_.store(new version(vinfo), std::memory_order_release); // NOLINT
}

// start: getter
Expand Down
Loading

0 comments on commit b3ace8b

Please sign in to comment.