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
21
22namespace resdb {
23
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),
33}
34
35int 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
ConsensusManagerGeoPBFT(const ResDBConfig &config, std::unique_ptr< GeoTransactionExecutor > local_executor, std::unique_ptr< GeoGlobalExecutor > global_executor)
int ConsensusCommit(std::unique_ptr< Context > context, std::unique_ptr< Request > request) override
int ConsensusCommit(std::unique_ptr< Context > context, std::unique_ptr< Request > request) override
SignatureVerifier * GetSignatureVerifier()
ReplicaCommunicator * GetBroadCastClient()