From 7b0a341f9fcfb30a6f7d0eae8c6714d017e8f616 Mon Sep 17 00:00:00 2001 From: Sherman The Tank <5414276+sherman-the-tank@users.noreply.github.com> Date: Wed, 22 Aug 2018 21:25:57 +0800 Subject: [PATCH] Renamed consensus.thrift to raftex.thrift --- interface/CMakeLists.txt | 36 +++++++++---------- interface/{consensus.thrift => raftex.thrift} | 11 +++--- 2 files changed, 23 insertions(+), 24 deletions(-) rename interface/{consensus.thrift => raftex.thrift} (90%) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index fbe21c14f70..886d2b98ee6 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -14,15 +14,15 @@ add_custom_command( add_custom_command( OUTPUT - gen-cpp2/ConsensusService.cpp - gen-cpp2/ConsensusService_client.cpp - gen-cpp2/ConsensusService_processmap_binary.cpp - gen-cpp2/ConsensusService_processmap_compact.cpp - gen-cpp2/consensus_constants.cpp - gen-cpp2/consensus_data.cpp - gen-cpp2/consensus_types.cpp - COMMAND "${CMAKE_HOME_DIRECTORY}/third-party/fbthrift/_install/bin/thrift1" "--allow-neg-enum-vals" "--templates" "${CMAKE_HOME_DIRECTORY}/third-party/fbthrift/_install/include/thrift/templates" "--gen" "mstch_cpp2:include_prefix=\"interface\",process_in_event_base,stack_arguments" "--gen" "java:hashcode" "--gen" "go" "--gen" "py:new_style" "-o" "." "./consensus.thrift" - DEPENDS consensus.thrift + gen-cpp2/RaftexService.cpp + gen-cpp2/RaftexService_client.cpp + gen-cpp2/RaftexService_processmap_binary.cpp + gen-cpp2/RaftexService_processmap_compact.cpp + gen-cpp2/raftex_constants.cpp + gen-cpp2/raftex_data.cpp + gen-cpp2/raftex_types.cpp + COMMAND "${CMAKE_HOME_DIRECTORY}/third-party/fbthrift/_install/bin/thrift1" "--allow-neg-enum-vals" "--templates" "${CMAKE_HOME_DIRECTORY}/third-party/fbthrift/_install/include/thrift/templates" "--gen" "mstch_cpp2:include_prefix=\"interface\",process_in_event_base,stack_arguments" "--gen" "java:hashcode" "--gen" "go" "--gen" "py:new_style" "-o" "." "./raftex.thrift" + DEPENDS raftex.thrift ) @@ -46,13 +46,13 @@ add_dependencies(vgraph_thrift_obj tgt_fbthrift) add_library( - consensus_thrift_obj OBJECT - gen-cpp2/ConsensusService.cpp - gen-cpp2/ConsensusService_client.cpp - gen-cpp2/ConsensusService_processmap_binary.cpp - gen-cpp2/ConsensusService_processmap_compact.cpp - gen-cpp2/consensus_constants.cpp - gen-cpp2/consensus_data.cpp - gen-cpp2/consensus_types.cpp + raftex_thrift_obj OBJECT + gen-cpp2/RaftexService.cpp + gen-cpp2/RaftexService_client.cpp + gen-cpp2/RaftexService_processmap_binary.cpp + gen-cpp2/RaftexService_processmap_compact.cpp + gen-cpp2/raftex_constants.cpp + gen-cpp2/raftex_data.cpp + gen-cpp2/raftex_types.cpp ) -add_dependencies(consensus_thrift_obj tgt_fbthrift) +add_dependencies(raftex_thrift_obj tgt_fbthrift) diff --git a/interface/consensus.thrift b/interface/raftex.thrift similarity index 90% rename from interface/consensus.thrift rename to interface/raftex.thrift index 9a73fa765d9..3c20dc1a520 100644 --- a/interface/consensus.thrift +++ b/interface/raftex.thrift @@ -4,9 +4,9 @@ * (found in the LICENSE.Apache file in the root directory) */ -namespace cpp vesoft.vgraph.consensus -namespace java vesoft.vgraph.consensus -namespace go vesoft.vgraph.consensus +namespace cpp vesoft.vgraph.raftex +namespace java vesoft.vgraph.raftex +namespace go vesoft.vgraph.raftex enum ResultCode { @@ -42,8 +42,7 @@ typedef i32 Port // A request to ask for vote struct AskForVoteRequest { 1: GraphSpaceID space; // My graph space id - 2: PartitionID partition; // The data partition that the current - // replica represents + 2: PartitionID partition; // The data partition 3: IPv4 candidateIp; // My IP 4: Port candidatePort; // My port 5: TermID term; // Proposed term (current term + 1) @@ -108,7 +107,7 @@ struct AppendLogResponse { } -service ConsensusService { +service RaftexService { AskForVoteResponse askForVote(1: AskForVoteRequest req); AppendLogResponse appendLog(1: AppendLogRequest req); }