2017-07-28 20:55:19 +00:00
|
|
|
// Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
|
2017-07-15 23:03:42 +00:00
|
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
|
|
// (found in the LICENSE.Apache file in the root directory).
|
2017-06-16 21:12:52 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
2022-10-24 23:38:09 +00:00
|
|
|
|
2019-05-30 18:21:38 +00:00
|
|
|
#include "test_util/testharness.h"
|
2017-07-21 21:42:32 +00:00
|
|
|
#include "utilities/cassandra/format.h"
|
|
|
|
#include "utilities/cassandra/serialize.h"
|
2017-06-16 21:12:52 +00:00
|
|
|
|
2020-02-20 20:07:53 +00:00
|
|
|
namespace ROCKSDB_NAMESPACE {
|
2017-06-16 21:12:52 +00:00
|
|
|
namespace cassandra {
|
|
|
|
extern const char kData[];
|
|
|
|
extern const char kExpiringData[];
|
|
|
|
extern const int32_t kTtl;
|
|
|
|
extern const int8_t kColumn;
|
|
|
|
extern const int8_t kTombstone;
|
|
|
|
extern const int8_t kExpiringColumn;
|
|
|
|
|
2022-10-24 23:38:09 +00:00
|
|
|
std::shared_ptr<ColumnBase> CreateTestColumn(int8_t mask, int8_t index,
|
2017-06-16 21:12:52 +00:00
|
|
|
int64_t timestamp);
|
|
|
|
|
2017-12-14 19:57:11 +00:00
|
|
|
std::tuple<int8_t, int8_t, int64_t> CreateTestColumnSpec(int8_t mask,
|
|
|
|
int8_t index,
|
|
|
|
int64_t timestamp);
|
|
|
|
|
2017-06-16 21:12:52 +00:00
|
|
|
RowValue CreateTestRowValue(
|
|
|
|
std::vector<std::tuple<int8_t, int8_t, int64_t>> column_specs);
|
|
|
|
|
|
|
|
RowValue CreateRowTombstone(int64_t timestamp);
|
|
|
|
|
|
|
|
void VerifyRowValueColumns(
|
2020-06-02 20:54:03 +00:00
|
|
|
const std::vector<std::shared_ptr<ColumnBase>> &columns,
|
|
|
|
std::size_t index_of_vector, int8_t expected_mask, int8_t expected_index,
|
|
|
|
int64_t expected_timestamp);
|
2017-06-16 21:12:52 +00:00
|
|
|
|
2017-07-21 21:42:32 +00:00
|
|
|
int64_t ToMicroSeconds(int64_t seconds);
|
2017-08-31 17:10:47 +00:00
|
|
|
int32_t ToSeconds(int64_t microseconds);
|
2022-10-24 23:38:09 +00:00
|
|
|
} // namespace cassandra
|
2020-02-20 20:07:53 +00:00
|
|
|
} // namespace ROCKSDB_NAMESPACE
|