cassandra_options.h 1.5 KB

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