From 5af21f5fcec098a4a1958fb1f17019945952fcdd Mon Sep 17 00:00:00 2001 From: Yoshiaki Nishimura Date: Thu, 17 Oct 2024 09:01:24 +0900 Subject: [PATCH] Refactor: replace tabs with spaces for consistent indentation --- .../executor/process/impl/ops/context_base.h | 4 +- .../executor/process/impl/ops/operator_base.h | 8 ++-- .../executor/process/impl/ops/scan.cpp | 10 ++-- src/jogasaki/executor/process/task.cpp | 4 +- src/jogasaki/serializer/value_output.cpp | 4 +- src/jogasaki/serializer/value_writer.h | 24 +++++----- src/tateyama/proto/kvs/response.proto | 46 +++++++++---------- 7 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/jogasaki/executor/process/impl/ops/context_base.h b/src/jogasaki/executor/process/impl/ops/context_base.h index ed1775cb4..f26329d8e 100644 --- a/src/jogasaki/executor/process/impl/ops/context_base.h +++ b/src/jogasaki/executor/process/impl/ops/context_base.h @@ -48,8 +48,8 @@ enum class context_state { [[nodiscard]] constexpr inline std::string_view to_string_view(context_state state) noexcept { using namespace std::string_view_literals; switch (state) { - case context_state::active: return "active"sv; - case context_state::abort: return "abort"sv; + case context_state::active: return "active"sv; + case context_state::abort: return "abort"sv; } std::abort(); } diff --git a/src/jogasaki/executor/process/impl/ops/operator_base.h b/src/jogasaki/executor/process/impl/ops/operator_base.h index 8de5faf4d..70a5b5bf5 100644 --- a/src/jogasaki/executor/process/impl/ops/operator_base.h +++ b/src/jogasaki/executor/process/impl/ops/operator_base.h @@ -1,5 +1,5 @@ /* - * Copyright 2018-2023 Project Tsurugi. + * Copyright 2018-2024 Project Tsurugi. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -229,11 +229,11 @@ class cogroup_operator : public operator_base { return "record_operator"sv; } if (dynamic_cast(&op)) { - return "group_operator"sv; + return "group_operator"sv; } if (dynamic_cast const*>(&op)) { - return "cogroup_operator"sv; + return "cogroup_operator"sv; } return "unknown"sv; } -} +} // namespace jogasaki::executor::process::impl::ops diff --git a/src/jogasaki/executor/process/impl/ops/scan.cpp b/src/jogasaki/executor/process/impl/ops/scan.cpp index e1648be7c..8d6b862a6 100644 --- a/src/jogasaki/executor/process/impl/ops/scan.cpp +++ b/src/jogasaki/executor/process/impl/ops/scan.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2018-2023 Project Tsurugi. + * Copyright 2018-2024 Project Tsurugi. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -207,15 +207,15 @@ operation_status scan::operator()( //NOLINT(readability-function-cognitive-comp return {operation_status_kind::aborted}; } } - if (scan_block_size != 0 && scan_block_size == loop_count ){ + if (scan_block_size != 0 && scan_block_size == loop_count ){ auto current_time = std::chrono::steady_clock::now(); auto elapsed_time = std::chrono::duration_cast(current_time - previous_time); if (elapsed_time.count() >= scan_yield_interval ) { return {operation_status_kind::yield}; } - } - loop_count++; + } + loop_count++; } finish(context); if (st != status::not_found) { @@ -370,4 +370,4 @@ void scan::dump() const noexcept { std::cerr << head << std::setw(width) << "field_mapper_:" << "not implemented yet" << std::endl; } -} +} // namespace jogasaki::executor::process::impl::ops diff --git a/src/jogasaki/executor/process/task.cpp b/src/jogasaki/executor/process/task.cpp index 5d02f1a05..d35d341cf 100644 --- a/src/jogasaki/executor/process/task.cpp +++ b/src/jogasaki/executor/process/task.cpp @@ -72,7 +72,7 @@ model::task_result task::operator()() { // TODO support sleep/yield fail_with_exception(); - break; + break; case abstract::status::to_yield: VLOG_LP(log_warning) << *this << " process::task to_yield."; break; @@ -108,7 +108,7 @@ bool task::has_transactional_io() { return has_transactional_io_; } -} +} // namespace jogasaki::executor::process diff --git a/src/jogasaki/serializer/value_output.cpp b/src/jogasaki/serializer/value_output.cpp index d736b3efd..8b36602ca 100644 --- a/src/jogasaki/serializer/value_output.cpp +++ b/src/jogasaki/serializer/value_output.cpp @@ -44,7 +44,7 @@ static void write_fixed8( buffer_view::iterator& position, buffer_view::const_iterator end) { BOOST_ASSERT(position < end); // NOLINT - (void) end; + (void) end; *position = static_cast(value); ++position; } @@ -65,7 +65,7 @@ static void write_bytes( buffer_view::iterator& position, buffer_view::const_iterator end) { BOOST_ASSERT(position + count <= end); // NOLINT - (void) end; + (void) end; std::memcpy(position, data, count); position += count; } diff --git a/src/jogasaki/serializer/value_writer.h b/src/jogasaki/serializer/value_writer.h index b14661d3b..410f39757 100644 --- a/src/jogasaki/serializer/value_writer.h +++ b/src/jogasaki/serializer/value_writer.h @@ -61,7 +61,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_null(iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -75,7 +75,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_int(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -90,7 +90,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_float4(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -105,7 +105,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_float8(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -120,7 +120,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_decimal(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -135,7 +135,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_character(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -150,7 +150,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_octet(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -194,7 +194,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_date(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -209,7 +209,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_time_of_day(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -240,7 +240,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_time_point(value, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -285,7 +285,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_array_begin(size, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); @@ -300,7 +300,7 @@ class value_writer { auto *iter = buf.begin(); auto ret = ::jogasaki::serializer::write_row_begin(size, iter, buf.end()); BOOST_ASSERT(ret); // NOLINT - (void) ret; + (void) ret; auto write_size = static_cast(std::distance(buf.begin(), iter)); return writer_->write(buf.data(), write_size); diff --git a/src/tateyama/proto/kvs/response.proto b/src/tateyama/proto/kvs/response.proto index 7c77527a1..4dfd541ef 100644 --- a/src/tateyama/proto/kvs/response.proto +++ b/src/tateyama/proto/kvs/response.proto @@ -14,8 +14,8 @@ message Void {} /* For response of error containing a error message. */ message Error { - sint32 code = 1; - string detail = 2; + sint32 code = 1; + string detail = 2; } // response message for RPC. @@ -68,8 +68,8 @@ message Begin { // request is successfully completed. message Success { - // the target transaction handle. - transaction.Handle transaction_handle = 1; + // the target transaction handle. + transaction.Handle transaction_handle = 1; } // the response body. @@ -116,8 +116,8 @@ message Get { // request is successfully completed. message Success { - // the record. - repeated data.Record records = 1; + // the record. + repeated data.Record records = 1; } // the response body. @@ -175,27 +175,27 @@ message Batch { reserved 1 to 10; message Opresult { - oneof opresult { - // result of begin - Begin begin = 21; - - // result of commit - Commit commit = 22; - - // result of put - Put put = 23; - - // result of get - Get get = 24; - - // result of remove - Remove remove = 25; - } + oneof opresult { + // result of begin + Begin begin = 21; + + // result of commit + Commit commit = 22; + + // result of put + Put put = 23; + + // result of get + Get get = 24; + + // result of remove + Remove remove = 25; + } } // request is successfully completed. message Success { - repeated Opresult results = 1; + repeated Opresult results = 1; } // the response body.