/Users/deen/code/yugabyte-db/src/yb/tablet/transaction_intent_applier.h
Line | Count | Source |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #ifndef YB_TABLET_TRANSACTION_INTENT_APPLIER_H |
15 | | #define YB_TABLET_TRANSACTION_INTENT_APPLIER_H |
16 | | |
17 | | #include <type_traits> |
18 | | |
19 | | #include "yb/common/transaction.h" |
20 | | |
21 | | #include "yb/docdb/docdb_fwd.h" |
22 | | |
23 | | #include "yb/tablet/tablet_fwd.h" |
24 | | |
25 | | #include "yb/util/status_fwd.h" |
26 | | |
27 | | namespace yb { |
28 | | namespace tablet { |
29 | | |
30 | | // Interface to object that should apply intents in RocksDB when transaction is applying. |
31 | | class TransactionIntentApplier { |
32 | | public: |
33 | | virtual Result<docdb::ApplyTransactionState> ApplyIntents(const TransactionApplyData& data) = 0; |
34 | | virtual CHECKED_STATUS RemoveIntents( |
35 | | const RemoveIntentsData& data, const TransactionId& transaction_id) = 0; |
36 | | virtual CHECKED_STATUS RemoveIntents( |
37 | | const RemoveIntentsData& data, const TransactionIdSet& transactions) = 0; |
38 | | |
39 | | virtual Result<HybridTime> ApplierSafeTime(HybridTime min_allowed, CoarseTimePoint deadline) = 0; |
40 | | |
41 | | // See TransactionParticipant::WaitMinRunningHybridTime below |
42 | | virtual void MinRunningHybridTimeSatisfied() = 0; |
43 | | |
44 | | protected: |
45 | 48.0k | ~TransactionIntentApplier() {} |
46 | | }; |
47 | | |
48 | | } // namespace tablet |
49 | | } // namespace yb |
50 | | |
51 | | #endif // YB_TABLET_TRANSACTION_INTENT_APPLIER_H |