]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/utilities/cassandra/cassandra_options.h
efa73a30836060e7af378884399cb8e1a2f2ea04
[ceph.git] / ceph / src / rocksdb / utilities / cassandra / cassandra_options.h
1 // Copyright (c) 2011-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
8 #include <cstddef>
9 #include <cstdint>
10 #include <string>
11
12 #include "rocksdb/rocksdb_namespace.h"
13
14 namespace ROCKSDB_NAMESPACE {
15 class ObjectLibrary;
16 namespace cassandra {
17 struct CassandraOptions {
18 static const char* kName() { return "CassandraOptions"; }
19 CassandraOptions(int32_t _gc_grace_period_in_seconds, size_t _operands_limit,
20 bool _purge_ttl_on_expiration = false)
21 : operands_limit(_operands_limit),
22 gc_grace_period_in_seconds(_gc_grace_period_in_seconds),
23 purge_ttl_on_expiration(_purge_ttl_on_expiration) {}
24 // Limit on the number of merge operands.
25 size_t operands_limit;
26
27 // How long (in seconds) tombstoned data remains before it is purged
28 int32_t gc_grace_period_in_seconds;
29
30 // If is set to true, expired data will be directly purged.
31 // Otherwise expired data will be converted tombstones first,
32 // then be eventually removed after gc grace period. This value should
33 // only true if all writes have same ttl setting, otherwise it could bring old
34 // data back.
35 bool purge_ttl_on_expiration;
36 };
37 #ifndef ROCKSDB_LITE
38 extern "C" {
39 int RegisterCassandraObjects(ObjectLibrary& library, const std::string& arg);
40 } // extern "C"
41 #endif // ROCKSDB_LITE
42 } // namespace cassandra
43 } // namespace ROCKSDB_NAMESPACE