Loading...
Searching...
No Matches
geo_transaction_executor.h
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#pragma once
25
26namespace resdb {
27
29 public:
31 const ResDBConfig& config, std::unique_ptr<SystemInfo> system_info,
32 std::unique_ptr<ReplicaCommunicator> replica_communicator,
33 std::unique_ptr<TransactionManager> local_transaction_manager);
34
36 virtual std::unique_ptr<BatchUserResponse> ExecuteBatch(
37 const BatchUserRequest& request) override;
38 bool IsStop();
39
40 private:
41 void SendGeoMessages();
42 void SendBatchGeoMessage(
43 const std::vector<std::unique_ptr<Request>>& requests);
44
45 protected:
47 std::unique_ptr<SystemInfo> system_info_;
48 std::unique_ptr<ReplicaCommunicator> replica_communicator_;
49 std::unique_ptr<TransactionManager> local_transaction_manager_ = nullptr;
50 std::thread geo_thread_;
51 size_t batch_size_ = 50;
53 std::atomic<bool> is_stop_;
54
55 std::vector<std::unique_ptr<BatchUserRequest>> messages_;
56};
57
58} // namespace resdb
std::vector< std::unique_ptr< BatchUserRequest > > messages_
std::unique_ptr< TransactionManager > local_transaction_manager_
virtual std::unique_ptr< BatchUserResponse > ExecuteBatch(const BatchUserRequest &request) override
std::unique_ptr< SystemInfo > system_info_
std::unique_ptr< ReplicaCommunicator > replica_communicator_