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 ffb2363 commit 41fece7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/concurrency_control/interface/long_tx/helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) { // LINT
for (auto itr = pset.begin(); itr != pset.end(); ++itr) { // NOLINT
if (elem == *itr) {
ra.erase_from_positive_list(elem);
break;
Expand Down Expand Up @@ -158,7 +158,7 @@ Status tx_begin(session* const ti, std::vector<Storage> write_preserve,
// after deciding success
wp::long_tx::set_counter(long_tx_id + 1);

if (long_tx_id >= pow(2, 63)) { // LINT
if (long_tx_id >= pow(2, 63)) { // NOLINT
LOG_FIRST_N(ERROR, 1)
<< log_location_prefix
<< "long tx id depletion. limit of specification.";
Expand Down
8 changes: 4 additions & 4 deletions src/concurrency_control/interface/scan/next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace shirakami {

Status next_body(Token const token, ScanHandle const handle) { // LINT
Status next_body(Token const token, ScanHandle const handle) { // NOLINT
auto* ti = static_cast<session*>(token);
if (!ti->get_tx_began()) { return Status::WARN_NOT_BEGIN; }

Expand Down Expand Up @@ -55,7 +55,7 @@ Status next_body(Token const token, ScanHandle const handle) { // LINT
// check target record
auto& scan_buf = std::get<scan_handler::scan_cache_vec_pos>(
sh.get_scan_cache()[handle]);
auto itr = scan_buf.begin() + scan_index; // LINT
auto itr = scan_buf.begin() + scan_index; // NOLINT
rec_ptr = const_cast<Record*>(std::get<0>(*itr));
}

Expand Down Expand Up @@ -183,7 +183,7 @@ Status next_body(Token const token, ScanHandle const handle) { // LINT
/**
* @pre This is called by only long tx mode
*/
void check_ltx_scan_range_rp_and_log(Token const token, // LINT
void check_ltx_scan_range_rp_and_log(Token const token, // NOLINT
ScanHandle const handle) {
auto* ti = static_cast<session*>(token);
auto& sh = ti->get_scan_handle();
Expand Down Expand Up @@ -222,7 +222,7 @@ void check_ltx_scan_range_rp_and_log(Token const token, // LINT
}
}

Status next(Token const token, ScanHandle const handle) { // LINT
Status next(Token const token, ScanHandle const handle) { // NOLINT
shirakami_log_entry << "next, token: " << token << ", handle: " << handle;
auto* ti = static_cast<session*>(token);
ti->process_before_start_step();
Expand Down
8 changes: 4 additions & 4 deletions src/concurrency_control/interface/scan/open_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record*>(std::get<1>(elem))}; // LINT
Record* rec_ptr{reinterpret_cast<Record*>(std::get<1>(elem))}; // NOLINT
// by inline optimization
tid_word tid{loadAcquire(rec_ptr->get_tidw().get_obj())};
if (!tid.get_absent()) {
Expand Down Expand Up @@ -170,7 +170,7 @@ Status check_not_found(
return Status::WARN_NOT_FOUND;
}

Status open_scan_body(Token const token, Storage storage, // LINT
Status open_scan_body(Token const token, Storage storage, // NOLINT
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,
Expand Down Expand Up @@ -385,7 +385,7 @@ Status open_scan_body(Token const token, Storage storage, // LINT
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<Record*>( // LINT
vec.emplace_back(reinterpret_cast<Record*>( // NOLINT
std::get<index_rec_ptr>(scan_res.at(i))),
// by inline optimization
std::get<index_nvec_body>(nvec.at(i + nvec_delta)),
Expand All @@ -405,7 +405,7 @@ Status open_scan_body(Token const token, Storage storage, // LINT
return fin_process(ti, Status::OK);
}

Status open_scan(Token const token, Storage storage, // LINT
Status open_scan(Token const token, Storage storage, // NOLINT
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace shirakami {

Status scannable_total_index_size_body(Token const token, // LINT
Status scannable_total_index_size_body(Token const token, // NOLINT
ScanHandle const handle,
std::size_t& size) {
auto* ti = static_cast<session*>(token);
Expand All @@ -43,7 +43,7 @@ Status scannable_total_index_size_body(Token const token, // LINT
return Status::OK;
}

Status scannable_total_index_size(Token const token, // LINT
Status scannable_total_index_size(Token const token, // NOLINT
ScanHandle const handle, std::size_t& size) {
shirakami_log_entry << "scannable_total_index_size, "
<< "token: " << token << ", handle: " << handle
Expand Down
4 changes: 2 additions & 2 deletions src/concurrency_control/interface/session_management.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void unlock_for_other_client(session* const ti) {
ti->set_visible(false); // unlock
}

Status leave_body(Token const token) { // LINT
Status leave_body(Token const token) { // NOLINT
for (auto&& itr : session_table::get_session_table()) {
auto* ti = static_cast<session*>(token);
if (&itr == ti) {
Expand Down Expand Up @@ -106,7 +106,7 @@ Status leave_body(Token const token) { // LINT
return Status::WARN_INVALID_ARGS;
}

Status leave(Token const token) { // LINT
Status leave(Token const token) { // NOLINT
shirakami_log_entry << "leave, token: " << token;
auto ret = leave_body(token);
shirakami_log_exit << "leave, Status: " << ret;
Expand Down
32 changes: 16 additions & 16 deletions src/concurrency_control/interface/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ 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<char*>(&storage), // LINT
reinterpret_cast<char*>(&storage), // NOLINT
sizeof(storage)};
auto rc = yakushima::create_storage(std::string_view(storage_view));
// create storage must return WARN_UNIQUE_RESTRICTION or OK
Expand All @@ -324,7 +324,7 @@ Status storage::register_storage(Storage storage, storage_option options) {
{reinterpret_cast<char*>(&page_set_meta_storage), // NOLINT
sizeof(page_set_meta_storage)},
storage_view, &page_set_meta_ptr,
sizeof(page_set_meta_ptr)); // LINT
sizeof(page_set_meta_ptr)); // NOLINT
if (yakushima::status::OK != rc) {
LOG_FIRST_N(ERROR, 1)
<< log_location_prefix << rc << ", unreachable path";
Expand All @@ -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) { // LINT
if ((storage >> 32) > 0) { // NOLINT
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; // LINT
storage <<= 32; // NOLINT
} else {
// storage id is specified by shirakami-user.
storage = storage_id;
// check depletion
if ((storage >> 32) > 0) { // LINT
if ((storage >> 32) > 0) { // NOLINT
VLOG(log_trace) << "user defined storage id depletion. you should "
"implement re-using storage id.";
return Status::WARN_STORAGE_ID_DEPLETION;
Expand All @@ -385,7 +385,7 @@ Status storage::delete_storage(Storage storage) {
std::unique_lock lk{garbage::get_mtx_cleaner()};

std::string_view storage_view = {
reinterpret_cast<char*>(&storage), // LINT
reinterpret_cast<char*>(&storage), // NOLINT
sizeof(storage)};
auto ret = yakushima::find_storage(storage_view);
if ((ret != yakushima::status::OK) ||
Expand All @@ -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) { // LINT
if (scan_res.size() < std::thread::hardware_concurrency() * 10) { // NOLINT
// single thread clean up
for (auto&& itr : scan_res) {
if (wp::get_finalizing()) {
delete reinterpret_cast<wp::page_set_meta*>( // LINT
delete reinterpret_cast<wp::page_set_meta*>( // NOLINT
std::get<v_index>(itr));
} else {
Record* target_rec{reinterpret_cast<Record*>( // LINT
Record* target_rec{reinterpret_cast<Record*>( // NOLINT
std::get<v_index>(itr))};
// by inline optimization
delete target_rec; // LINT
delete target_rec; // NOLINT
}
}
} else {
Expand All @@ -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<wp::page_set_meta*>( // LINT
delete reinterpret_cast<wp::page_set_meta*>( // NOLINT
std::get<v_index>(scan_res[i]));
} else {
Record* target_rec{reinterpret_cast<Record*>( // LINT
Record* target_rec{reinterpret_cast<Record*>( // NOLINT
std::get<v_index>(scan_res[i]))};
delete target_rec; // LINT
delete target_rec; // NOLINT
}
}
};
Expand All @@ -448,7 +448,7 @@ Status storage::delete_storage(Storage storage) {
}
std::pair<wp::page_set_meta**, std::size_t> out{};
auto rc{yakushima::get<wp::page_set_meta*>(
{reinterpret_cast<char*>(&page_set_meta_storage), // LINT
{reinterpret_cast<char*>(&page_set_meta_storage), // NOLINT
sizeof(page_set_meta_storage)},
storage_view, out)};
if (rc != yakushima::status::OK) {
Expand All @@ -458,11 +458,11 @@ Status storage::delete_storage(Storage storage) {
<< std::endl;
return Status::ERR_FATAL;
}
delete reinterpret_cast<wp::page_set_meta*>(out.first); // LINT
delete reinterpret_cast<wp::page_set_meta*>(out.first); // NOLINT
// by inline optimization
rc = yakushima::remove(
ytoken,
{reinterpret_cast<char*>(&page_set_meta_storage), // LINT
{reinterpret_cast<char*>(&page_set_meta_storage), // NOLINT
sizeof(page_set_meta_storage)},
storage_view);
if (yakushima::status::OK != rc) {
Expand Down
18 changes: 9 additions & 9 deletions src/datastore/limestone/datastore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void init_about_session_table(std::string_view log_dir_path) {
void recovery_storage_meta(std::vector<Storage>& 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)) { // LINT
storage::set_strg_ctr((st_list.back() >> 32) + 1); // LINT
if (st_list.back() >= (storage::initial_strg_ctr << 32)) { // NOLINT
storage::set_strg_ctr((st_list.back() >> 32) + 1); // NOLINT
} else {
storage::set_strg_ctr(storage::initial_strg_ctr);
}
Expand Down Expand Up @@ -66,7 +66,7 @@ void recovery_from_datastore() {
rec_ptr->set_value(val);
} else {
// create record
rec_ptr = new Record(key); // LINT
rec_ptr = new Record(key); // NOLINT
// fix record contents
// about value
rec_ptr->set_value(val);
Expand Down Expand Up @@ -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)); // LINT
memcpy(&id, val.data() + sizeof(st2), sizeof(id)); // NOLINT
std::string payload{};
if (val.size() > sizeof(st2) + sizeof(id)) {
payload.append(val.data() + sizeof(st2) + sizeof(id), // LINT
payload.append(val.data() + sizeof(st2) + sizeof(id), // NOLINT
val.size() - sizeof(st2) - sizeof(id));
}
std::string new_value{};
new_value.append(reinterpret_cast<const char*>(&st2), // LINT
new_value.append(reinterpret_cast<const char*>(&st2), // NOLINT
sizeof(st2));
new_value.append(reinterpret_cast<const char*>(&id), // LINT
new_value.append(reinterpret_cast<const char*>(&id), // NOLINT
sizeof(id));
new_value.append(payload);
// check st2 existence
Expand Down Expand Up @@ -171,7 +171,7 @@ void recovery_from_datastore() {
SequenceVersion version{};
memcpy(&version, val.data(), sizeof(version));
SequenceValue value{};
memcpy(&value, val.data() + sizeof(version), // LINT
memcpy(&value, val.data() + sizeof(version), // NOLINT
sizeof(version));
auto ret = sequence::sequence_map_push(id, 0, version, value);
if (ret != Status::OK) {
Expand Down Expand Up @@ -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<Record*>( // LINT
Record* rec_ptr{reinterpret_cast<Record*>( // NOLINT
std::get<1>(each_rec))};
// get key val info.
std::string key{};
Expand Down

0 comments on commit 41fece7

Please sign in to comment.