sstables: move timestamps to signed integer
This is to follow Origin Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
@@ -154,7 +154,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void consume_cell(bytes_view col_name, bytes_view value, uint64_t timestamp, uint32_t ttl, uint32_t expiration) override {
|
||||
virtual void consume_cell(bytes_view col_name, bytes_view value, int64_t timestamp, int32_t ttl, int32_t expiration) override {
|
||||
static bytes cql_row_marker(3, bytes::value_type(0x0));
|
||||
|
||||
// The row marker exists mainly so that one can create empty rows. It should not be present
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
consume_deleted_cell(col, deltime.marked_for_delete_at, gc_clock::time_point(secs));
|
||||
}
|
||||
|
||||
void consume_deleted_cell(column &col, uint64_t timestamp, gc_clock::time_point ttl) {
|
||||
void consume_deleted_cell(column &col, int64_t timestamp, gc_clock::time_point ttl) {
|
||||
auto ac = atomic_cell::make_dead(timestamp, ttl);
|
||||
|
||||
if (col.is_static) {
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
// absolute time (in seconds since the UNIX epoch) when this cell will
|
||||
// expire. Typical cells, not set to expire, will get expiration = 0.
|
||||
virtual void consume_cell(bytes_view col_name, bytes_view value,
|
||||
uint64_t timestamp,
|
||||
uint32_t ttl, uint32_t expiration) = 0;
|
||||
int64_t timestamp,
|
||||
int32_t ttl, int32_t expiration) = 0;
|
||||
|
||||
|
||||
// Consume a deleted cell (i.e., a cell tombstone).
|
||||
|
||||
@@ -235,8 +235,8 @@ struct statistics {
|
||||
};
|
||||
|
||||
struct deletion_time {
|
||||
uint32_t local_deletion_time;
|
||||
uint64_t marked_for_delete_at;
|
||||
int32_t local_deletion_time;
|
||||
int64_t marked_for_delete_at;
|
||||
|
||||
template <typename Describer>
|
||||
future<> describe_type(Describer f) { return f(local_deletion_time, marked_for_delete_at); }
|
||||
|
||||
@@ -314,8 +314,8 @@ SEASTAR_TEST_CASE(compressed_random_access_read) {
|
||||
|
||||
class test_row_consumer : public row_consumer {
|
||||
public:
|
||||
const uint64_t desired_timestamp;
|
||||
test_row_consumer(uint64_t t) : desired_timestamp(t) { }
|
||||
const int64_t desired_timestamp;
|
||||
test_row_consumer(int64_t t) : desired_timestamp(t) { }
|
||||
int count_row_start = 0;
|
||||
int count_cell = 0;
|
||||
int count_deleted_cell = 0;
|
||||
@@ -323,13 +323,13 @@ public:
|
||||
int count_row_end = 0;
|
||||
virtual void consume_row_start(sstables::key_view key, sstables::deletion_time deltime) override {
|
||||
BOOST_REQUIRE(bytes_view(key) == as_bytes("vinna"));
|
||||
BOOST_REQUIRE(deltime.local_deletion_time == (uint32_t)std::numeric_limits<int32_t>::max());
|
||||
BOOST_REQUIRE(deltime.marked_for_delete_at == (uint64_t)std::numeric_limits<int64_t>::min());
|
||||
BOOST_REQUIRE(deltime.local_deletion_time == std::numeric_limits<int32_t>::max());
|
||||
BOOST_REQUIRE(deltime.marked_for_delete_at == std::numeric_limits<int64_t>::min());
|
||||
count_row_start++;
|
||||
}
|
||||
|
||||
virtual void consume_cell(bytes_view col_name, bytes_view value,
|
||||
uint64_t timestamp, uint32_t ttl, uint32_t expiration) override {
|
||||
int64_t timestamp, int32_t ttl, int32_t expiration) override {
|
||||
BOOST_REQUIRE(ttl == 0);
|
||||
BOOST_REQUIRE(expiration == 0);
|
||||
switch (count_cell) {
|
||||
@@ -447,7 +447,7 @@ public:
|
||||
count_row_start++;
|
||||
}
|
||||
virtual void consume_cell(bytes_view col_name, bytes_view value,
|
||||
uint64_t timestamp, uint32_t ttl, uint32_t expiration) override {
|
||||
int64_t timestamp, int32_t ttl, int32_t expiration) override {
|
||||
count_cell++;
|
||||
}
|
||||
virtual void consume_deleted_cell(bytes_view col_name, sstables::deletion_time deltime) override {
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
}
|
||||
|
||||
virtual void consume_cell(bytes_view col_name, bytes_view value,
|
||||
uint64_t timestamp, uint32_t ttl, uint32_t expiration) override {
|
||||
int64_t timestamp, int32_t ttl, int32_t expiration) override {
|
||||
switch (count_cell) {
|
||||
case 0:
|
||||
// The silly "cql row marker" cell
|
||||
@@ -585,8 +585,8 @@ public:
|
||||
virtual void consume_row_start(sstables::key_view key, sstables::deletion_time deltime) override {
|
||||
count_row_consumer::consume_row_start(key, deltime);
|
||||
BOOST_REQUIRE(bytes_view(key) == as_bytes("nadav"));
|
||||
BOOST_REQUIRE(deltime.local_deletion_time == (uint32_t)std::numeric_limits<int32_t>::max());
|
||||
BOOST_REQUIRE(deltime.marked_for_delete_at == (uint64_t)std::numeric_limits<int64_t>::min());
|
||||
BOOST_REQUIRE(deltime.local_deletion_time == std::numeric_limits<int32_t>::max());
|
||||
BOOST_REQUIRE(deltime.marked_for_delete_at == std::numeric_limits<int64_t>::min());
|
||||
}
|
||||
|
||||
virtual void consume_deleted_cell(bytes_view col_name, sstables::deletion_time deltime) override {
|
||||
|
||||
Reference in New Issue
Block a user