Loading...
Searching...
No Matches
consensus_manager_geo_pbft.cpp
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the
7
* "License"); you may not use this file except in compliance
8
* with the License. You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing,
13
* software distributed under the License is distributed on an
14
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
* KIND, either express or implied. See the License for the
16
* specific language governing permissions and limitations
17
* under the License.
18
*/
19
20
#include "
platform/consensus/ordering/geo_pbft/consensus_manager_geo_pbft.h
"
21
22
namespace
resdb
{
23
24
ConsensusManagerGeoPBFT::ConsensusManagerGeoPBFT
(
25
const
ResDBConfig
& config,
26
std::unique_ptr<GeoTransactionExecutor> local_executor,
27
std::unique_ptr<GeoGlobalExecutor> global_executor)
28
:
ConsensusManagerPBFT
(config, std::move(local_executor)) {
29
commitment_ = std::make_unique<GeoPBFTCommitment>(
30
std::move(global_executor), config, std::make_unique<SystemInfo>(config),
31
GetBroadCastClient
(),
GetSignatureVerifier
());
32
ConsensusManagerPBFT::SetNeedCommitQC
(
true
);
33
}
34
35
int
ConsensusManagerGeoPBFT::ConsensusCommit
(std::unique_ptr<Context> context,
36
std::unique_ptr<Request> request) {
37
switch
(request->type()) {
38
case
Request::TYPE_GEO_REQUEST:
39
return
commitment_->GeoProcessCcm(std::move(context), std::move(request));
40
}
41
return
ConsensusManagerPBFT::ConsensusCommit
(std::move(context),
42
std::move(request));
43
}
44
45
}
// namespace resdb
resdb::ConsensusManagerGeoPBFT::ConsensusManagerGeoPBFT
ConsensusManagerGeoPBFT(const ResDBConfig &config, std::unique_ptr< GeoTransactionExecutor > local_executor, std::unique_ptr< GeoGlobalExecutor > global_executor)
Definition
consensus_manager_geo_pbft.cpp:24
resdb::ConsensusManagerGeoPBFT::ConsensusCommit
int ConsensusCommit(std::unique_ptr< Context > context, std::unique_ptr< Request > request) override
Definition
consensus_manager_geo_pbft.cpp:35
resdb::ConsensusManagerPBFT
Definition
consensus_manager_pbft.h:36
resdb::ConsensusManagerPBFT::ConsensusCommit
int ConsensusCommit(std::unique_ptr< Context > context, std::unique_ptr< Request > request) override
Definition
consensus_manager_pbft.cpp:139
resdb::ConsensusManagerPBFT::SetNeedCommitQC
void SetNeedCommitQC(bool need_qc)
Definition
consensus_manager_pbft.cpp:76
resdb::ConsensusManager::GetSignatureVerifier
SignatureVerifier * GetSignatureVerifier()
Definition
consensus_manager.cpp:65
resdb::ConsensusManager::GetBroadCastClient
ReplicaCommunicator * GetBroadCastClient()
Definition
consensus_manager.cpp:61
resdb::ResDBConfig
Definition
resdb_config.h:28
consensus_manager_geo_pbft.h
resdb
Definition
chain_state.cpp:24
platform
consensus
ordering
geo_pbft
consensus_manager_geo_pbft.cpp
Generated by
1.9.8