YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/tablet/operations/truncate_operation.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_OPERATIONS_TRUNCATE_OPERATION_H
15
#define YB_TABLET_OPERATIONS_TRUNCATE_OPERATION_H
16
17
#include <mutex>
18
#include <string>
19
20
#include "yb/gutil/macros.h"
21
#include "yb/tablet/operations.pb.h"
22
#include "yb/tablet/operations/operation.h"
23
#include "yb/util/locks.h"
24
25
namespace yb {
26
27
class Schema;
28
29
namespace consensus {
30
class Consensus;
31
}
32
33
namespace tablet {
34
35
// Operation Context for the Truncate operation.
36
// Keeps track of the Operation states (request, result, ...)
37
// Executes the truncate transaction.
38
class TruncateOperation : public OperationBase<OperationType::kTruncate, TruncatePB> {
39
 public:
40
  template <class... Args>
41
  explicit TruncateOperation(Args&&... args)
42
158k
      : OperationBase(std::forward<Args>(args)...) {}
Unexecuted instantiation: _ZN2yb6tablet17TruncateOperationC2IJPNS0_6TabletERPNS0_10TruncatePBEEEEDpOT_
_ZN2yb6tablet17TruncateOperationC2IJPNS0_6TabletEEEEDpOT_
Line
Count
Source
42
105k
      : OperationBase(std::forward<Args>(args)...) {}
_ZN2yb6tablet17TruncateOperationC2IJPNS0_6TabletEPKNS0_10TruncatePBEEEEDpOT_
Line
Count
Source
42
53.2k
      : OperationBase(std::forward<Args>(args)...) {}
43
44
159k
  CHECKED_STATUS Prepare() override { return Status::OK(); }
45
46
 private:
47
  // Starts the TruncateOperation by assigning it a timestamp.
48
  CHECKED_STATUS DoReplicated(int64_t leader_term, Status* complete_status) override;
49
  CHECKED_STATUS DoAborted(const Status& status) override;
50
};
51
52
}  // namespace tablet
53
}  // namespace yb
54
55
#endif  // YB_TABLET_OPERATIONS_TRUNCATE_OPERATION_H