]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/utilities/cassandra/test_utils.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / utilities / cassandra / test_utils.h
CommitLineData
11fdf7f2
TL
1// Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
2// This source code is licensed under both the GPLv2 (found in the
3// COPYING file in the root directory) and Apache 2.0 License
4// (found in the LICENSE.Apache file in the root directory).
5
6#pragma once
7#include <memory>
f67539c2 8#include "test_util/testharness.h"
11fdf7f2
TL
9#include "utilities/cassandra/format.h"
10#include "utilities/cassandra/serialize.h"
11
f67539c2 12namespace ROCKSDB_NAMESPACE {
11fdf7f2
TL
13namespace cassandra {
14extern const char kData[];
15extern const char kExpiringData[];
16extern const int32_t kTtl;
17extern const int8_t kColumn;
18extern const int8_t kTombstone;
19extern const int8_t kExpiringColumn;
20
21
22std::shared_ptr<ColumnBase> CreateTestColumn(int8_t mask,
23 int8_t index,
24 int64_t timestamp);
25
26std::tuple<int8_t, int8_t, int64_t> CreateTestColumnSpec(int8_t mask,
27 int8_t index,
28 int64_t timestamp);
29
30RowValue CreateTestRowValue(
31 std::vector<std::tuple<int8_t, int8_t, int64_t>> column_specs);
32
33RowValue CreateRowTombstone(int64_t timestamp);
34
35void VerifyRowValueColumns(
20effc67
TL
36 const std::vector<std::shared_ptr<ColumnBase>> &columns,
37 std::size_t index_of_vector, int8_t expected_mask, int8_t expected_index,
38 int64_t expected_timestamp);
11fdf7f2
TL
39
40int64_t ToMicroSeconds(int64_t seconds);
41int32_t ToSeconds(int64_t microseconds);
42}
f67539c2 43} // namespace ROCKSDB_NAMESPACE