From 12fbff384ddce9db8a73b01a39adef1e45ac4d27 Mon Sep 17 00:00:00 2001 From: koko2pp Date: Fri, 13 Oct 2023 22:56:07 +0800 Subject: [PATCH] style: Apply Clang format to modified files ,and restore patch files, and rebase all conficts. --- src/chunkserver/chunkserver.cpp | 12 ++++-------- src/chunkserver/clone_core.cpp | 10 +++++----- src/chunkserver/conf_epoch_file.h | 12 ++++++------ src/common/bitmap.h | 4 ++-- src/tools/chunkserver_client.h | 24 +++++++++++------------ test/integration/cluster_common/cluster.h | 2 +- 6 files changed, 30 insertions(+), 34 deletions(-) diff --git a/src/chunkserver/chunkserver.cpp b/src/chunkserver/chunkserver.cpp index 18205a05d1..101de1ae0a 100644 --- a/src/chunkserver/chunkserver.cpp +++ b/src/chunkserver/chunkserver.cpp @@ -86,8 +86,7 @@ int ChunkServer::Run(int argc, char** argv) { RegisterCurveSegmentLogStorageOrDie(); - // ==========================Load Configuration - // Items===============================// + // ============Load Configuration Items============ // LOG(INFO) << "Loading Configuration."; common::Configuration conf; conf.SetConfigPath(FLAGS_conf.c_str()); @@ -107,8 +106,7 @@ int ChunkServer::Run(int argc, char** argv) { conf.ExposeMetric("chunkserver_config"); curve::common::ExposeCurveVersion(); - // ============================nitialize each - // module==========================// + // ============Initialize each module============ // LOG(INFO) << "Initializing ChunkServer modules"; // Prioritize initializing the metric collection module @@ -418,8 +416,7 @@ int ChunkServer::Run(int argc, char** argv) { } } - // =======================Start each - // module==================================// + // ==========Start each module==========// LOG(INFO) << "ChunkServer starts."; /** * Placing module startup after RPC service startup is mainly to address @@ -436,8 +433,7 @@ int ChunkServer::Run(int argc, char** argv) { LOG_IF(FATAL, !chunkfilePool->StartCleaning()) << "Failed to start file pool clean worker."; - // =======================Wait for the process to - // exit==================================// + // ==========Wait for the process to exit========== // while (!brpc::IsAskedToQuit()) { bthread_usleep(1000000L); } diff --git a/src/chunkserver/clone_core.cpp b/src/chunkserver/clone_core.cpp index af05a01646..99eb260a95 100644 --- a/src/chunkserver/clone_core.cpp +++ b/src/chunkserver/clone_core.cpp @@ -223,11 +223,11 @@ int CloneCore::HandleReadRequest(std::shared_ptr readRequest, CSErrorCode errorCode = dataStore->GetChunkInfo(id, &chunkInfo); /* - *Chunk exists: Check and analyze Bitmap to determine if it can be read - *locally Chunk does not exist: if it contains clone information, it will be - *read from clonesource, otherwise an error will be returned Because the - *upper level ReadChunkRequest::OnApply has already processed NoExist And - *the situation where cloneinfo does not exist + * Chunk exists: Check and analyze Bitmap to determine if it can be read + * locally Chunk does not exist: if it contains clone information, it will be + * read from clonesource, otherwise an error will be returned Because the + * upper level ReadChunkRequest::OnApply has already processed NoExist And + * the situation where cloneinfo does not exist */ switch (errorCode) { case CSErrorCode::Success: diff --git a/src/chunkserver/conf_epoch_file.h b/src/chunkserver/conf_epoch_file.h index 4d2513fc2b..979dd90032 100644 --- a/src/chunkserver/conf_epoch_file.h +++ b/src/chunkserver/conf_epoch_file.h @@ -59,12 +59,12 @@ class ConfEpochFile { /** * Serialize configuration version information and save it to a snapshot - *file. The format is as follows: The 'head' indicates the length and is in - *binary format. The rest is in text format for easy viewing when necessary. - *'sync' ensures data persistence. | head | - *Configuration version information | | 8 bytes size_t | uint32_t | - *Variable length text | | length | crc32 | logic pool id - *| copyset id | epoch| The persistence above is separated by ':' + * file. The format is as follows: The 'head' indicates the length and is in + * binary format. The rest is in text format for easy viewing when necessary. + * 'sync' ensures data persistence. | head | + * Configuration version information | | 8 bytes size_t | uint32_t | + * Variable length text | | length | crc32 | logic pool id + * | copyset id | epoch| The persistence above is separated by ':' * @param path: File path * @param logicPoolID: Logical Pool ID * @param copysetID: Copy group ID diff --git a/src/common/bitmap.h b/src/common/bitmap.h index f4b6f76ce7..34cf72edbd 100644 --- a/src/common/bitmap.h +++ b/src/common/bitmap.h @@ -57,8 +57,8 @@ class Bitmap { explicit Bitmap(uint32_t bits); /** * Constructor when initializing from an existing snapshot file - *The constructor will create a new bitmap internally, and then use the - *bitmap memcpy in the parameters + * The constructor will create a new bitmap internally, and then use the + * bitmap memcpy in the parameters * @param bits: Bitmap bits * @param bitmap: An externally provided bitmap for initialization */ diff --git a/src/tools/chunkserver_client.h b/src/tools/chunkserver_client.h index 400755cb30..6c6e006e31 100644 --- a/src/tools/chunkserver_client.h +++ b/src/tools/chunkserver_client.h @@ -80,22 +80,22 @@ class ChunkServerClient { virtual bool CheckChunkServerOnline(); /** - * @brief calls the GetCopysetStatus interface of chunkserver - * @param request Query the request for the copyset - * @param response The response returned contains detailed information about - * the replication group, which is valid when the return value is 0 - * @return returns 0 for success, -1 for failure - */ + * @brief calls the GetCopysetStatus interface of chunkserver + * @param request Query the request for the copyset + * @param response The response returned contains detailed information + * about the replication group, which is valid when the return value is 0 + * @return returns 0 for success, -1 for failure + */ virtual int GetCopysetStatus(const CopysetStatusRequest& request, CopysetStatusResponse* response); /** - * @brief Get the hash value of chunks from chunkserver - * @param chunk The chunk to query - * @param[out] The hash value chunkHash chunk, valid when the return value - * is 0 - * @return returns 0 for success, -1 for failure - */ + * @brief Get the hash value of chunks from chunkserver + * @param chunk The chunk to query + * @param[out] The hash value chunkHash chunk, valid when the return value + * is 0 + * @return returns 0 for success, -1 for failure + */ virtual int GetChunkHash(const Chunk& chunk, std::string* chunkHash); private: diff --git a/test/integration/cluster_common/cluster.h b/test/integration/cluster_common/cluster.h index 71777d5241..f663594f4a 100644 --- a/test/integration/cluster_common/cluster.h +++ b/test/integration/cluster_common/cluster.h @@ -120,7 +120,7 @@ class CurveCluster { /** * StartSingleMDS starts an mds * If need chunkservers with different IPs, please set the ipPort to - 192.168.200.1:XXXX + * 192.168.200.1:XXXX * * @param[in] id mdsId * @param[in] ipPort specifies the ipPort of the mds