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 8f8ddea commit 7e70883
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 37 deletions.
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
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
6 changes: 3 additions & 3 deletions src/concurrency_control/record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ Record::~Record() {
auto* ver = get_latest();
while (ver != nullptr) {
auto* ver_tmp = ver->get_next();
delete ver; // LINT
delete ver; // NOLINT
ver = ver_tmp;
}
}

Record::Record(std::string_view const key) : key_(key) {
latest_.store(new version(), std::memory_order_release); // LINT
latest_.store(new version(), std::memory_order_release); // NOLINT
tidw_.set_lock(false);
tidw_.set_latest(true);
tidw_.set_absent(true);
}

Record::Record(std::string_view const key, std::string_view const val)
: key_(key) {
latest_.store(new version(val), std::memory_order_release); // LINT
latest_.store(new version(val), std::memory_order_release); // NOLINT
tidw_.set_lock(true);
tidw_.set_latest(true);
tidw_.set_absent(true);
Expand Down
2 changes: 1 addition & 1 deletion src/database/include/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace shirakami {

inline std::atomic<bool> is_shutdowning_{false}; // LINT

inline database_options used_database_options_{}; // LINT
inline database_options used_database_options_{}; // NOLINT

[[maybe_unused]] static database_options get_used_database_options() {
return used_database_options_;
Expand Down
10 changes: 5 additions & 5 deletions src/database/include/thread_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) { // LINT
static void init(std::size_t thread_pool_size = 10) { // NOLINT
// set thread pool size
set_thread_pool_size(thread_pool_size);

// gen thread array
get_threads().reset(new std::thread[get_thread_pool_size()]); // LINT
get_threads().reset(new std::thread[get_thread_pool_size()]); // NOLINT

// set flag
set_running(true);
Expand Down Expand Up @@ -61,7 +61,7 @@ class alignas(CACHE_LINE_SIZE) thread_pool {
return running_.load(std::memory_order_acquire);
}

static std::unique_ptr<std::thread[]>& get_threads() { // LINT
static std::unique_ptr<std::thread[]>& get_threads() { // NOLINT
return threads_;
}

Expand Down Expand Up @@ -94,12 +94,12 @@ class alignas(CACHE_LINE_SIZE) thread_pool {
/**
* @brief threads of thread pool
*/
static inline std::unique_ptr<std::thread[]> threads_; // LINT
static inline std::unique_ptr<std::thread[]> threads_; // NOLINT

/**
* @brief task container
*/
static inline concurrent_queue<thread_task*> task_queue_; // LINT
static inline concurrent_queue<thread_task*> task_queue_; // NOLINT
};

} // namespace shirakami
2 changes: 1 addition & 1 deletion src/datastore/limestone/include/datastore.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace shirakami::datastore {

inline std::unique_ptr<limestone::api::datastore> datastore_; // LINT
inline std::unique_ptr<limestone::api::datastore> datastore_; // NOLINT

[[maybe_unused]] static limestone::api::datastore* get_datastore() {
return datastore_.get();
Expand Down
2 changes: 1 addition & 1 deletion src/include/atomic_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template<typename T>
* @brief atomic acquire load.
*/
template<typename T>
static T loadAcquire(T& ptr) { // LINT
static T loadAcquire(T& ptr) { // NOLINT
return __atomic_load_n(&ptr, __ATOMIC_ACQUIRE); // NOLINT
}

Expand Down
8 changes: 4 additions & 4 deletions src/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ static constexpr std::size_t CACHE_LINE_SIZE{64}; // LINT
int local_n_processors = n_processors.load(memory_order_acquire);
for (;;) {
if (local_n_processors != -1) { break; }
int desired = sysconf(_SC_NPROCESSORS_CONF); // LINT
int desired = sysconf(_SC_NPROCESSORS_CONF); // NOLINT
if (n_processors.compare_exchange_strong(local_n_processors, desired,
memory_order_acq_rel,
memory_order_acquire)) {
break;
}
}

pid_t pid = syscall(SYS_gettid); // LINT
pid_t pid = syscall(SYS_gettid); // NOLINT
cpu_set_t cpu_set;

CPU_ZERO(&cpu_set);
Expand All @@ -57,7 +57,7 @@ static constexpr std::size_t CACHE_LINE_SIZE{64}; // LINT
}

[[maybe_unused]] static void setThreadAffinity(const cpu_set_t id) {
pid_t pid = syscall(SYS_gettid); // LINT
pid_t pid = syscall(SYS_gettid); // NOLINT

if (sched_setaffinity(pid, sizeof(cpu_set_t), &id) != 0) {
LOG_FIRST_N(ERROR, 1);
Expand All @@ -66,7 +66,7 @@ static constexpr std::size_t CACHE_LINE_SIZE{64}; // LINT
}

[[maybe_unused]] static cpu_set_t getThreadAffinity() { // LINT
pid_t pid = syscall(SYS_gettid); // LINT
pid_t pid = syscall(SYS_gettid); // NOLINT
cpu_set_t result;

if (sched_getaffinity(pid, sizeof(cpu_set_t), &result) != 0) {
Expand Down
10 changes: 5 additions & 5 deletions src/include/tsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ namespace shirakami {
uint64_t rax{};
uint64_t rdx{};

asm volatile("cpuid" ::: "rax", "rbx", "rcx", "rdx"); // LINT
asm volatile("rdtsc" : "=a"(rax), "=d"(rdx)); // LINT
asm volatile("cpuid" ::: "rax", "rbx", "rcx", "rdx"); // NOLINT
asm volatile("rdtsc" : "=a"(rax), "=d"(rdx)); // NOLINT

return (rdx << 32) | rax; // LINT
return (rdx << 32) | rax; // 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)::); // LINT
asm volatile("rdtscp" : "=a"(rax), "=d"(rdx), "=c"(aux)::); // NOLINT

return (rdx << 32) | rax; // LINT
return (rdx << 32) | rax; // NOLINT
}

} // namespace shirakami

0 comments on commit 7e70883

Please sign in to comment.