/Users/deen/code/yugabyte-db/src/yb/tablet/cleanup_intents_task.h
Line | Count | Source (jump to first uncovered line) |
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_CLEANUP_INTENTS_TASK_H |
15 | | #define YB_TABLET_CLEANUP_INTENTS_TASK_H |
16 | | |
17 | | #include "yb/common/transaction.h" |
18 | | |
19 | | #include "yb/rpc/strand.h" |
20 | | |
21 | | #include "yb/tablet/tablet_fwd.h" |
22 | | |
23 | | namespace yb { |
24 | | namespace tablet { |
25 | | |
26 | | // Used by TransactionParticipant to remove intents of specified transaction. |
27 | | class CleanupIntentsTask : public rpc::StrandTask { |
28 | | public: |
29 | | CleanupIntentsTask( |
30 | | TransactionParticipantContext* participant_context, TransactionIntentApplier* applier, |
31 | | const TransactionId& id); |
32 | | |
33 | | void Prepare(std::shared_ptr<CleanupIntentsTask> self); |
34 | | |
35 | | void Run() override; |
36 | | |
37 | | void Done(const Status& status) override; |
38 | | |
39 | 0 | virtual ~CleanupIntentsTask() = default; |
40 | | |
41 | | private: |
42 | | TransactionParticipantContext& participant_context_; |
43 | | TransactionIntentApplier& applier_; |
44 | | TransactionId id_; |
45 | | std::shared_ptr<CleanupIntentsTask> retain_self_; |
46 | | }; |
47 | | |
48 | | } // namespace tablet |
49 | | } // namespace yb |
50 | | |
51 | | #endif // YB_TABLET_CLEANUP_INTENTS_TASK_H |