backup_engine_impl.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) Facebook, Inc. and its affiliates. 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 "rocksdb/utilities/backup_engine.h"
  7. namespace ROCKSDB_NAMESPACE {
  8. struct TEST_BackupMetaSchemaOptions {
  9. std::string version = "2";
  10. bool crc32c_checksums = false;
  11. bool file_sizes = true;
  12. std::map<std::string, std::string> meta_fields;
  13. std::map<std::string, std::string> file_fields;
  14. std::map<std::string, std::string> footer_fields;
  15. };
  16. // Modifies the BackupEngine(Impl) to write backup meta files using the
  17. // unpublished schema version 2, for the life of this object (not backup_dir).
  18. // TEST_BackupMetaSchemaOptions offers some customization for testing.
  19. void TEST_SetBackupMetaSchemaOptions(
  20. BackupEngine* engine, const TEST_BackupMetaSchemaOptions& options);
  21. // Modifies the BackupEngine(Impl) to use specified clocks for backup and
  22. // restore rate limiters created by default if not specified by users for
  23. // test speedup.
  24. void TEST_SetDefaultRateLimitersClock(
  25. BackupEngine* engine,
  26. const std::shared_ptr<SystemClock>& backup_rate_limiter_clock = nullptr,
  27. const std::shared_ptr<SystemClock>& restore_rate_limiter_clock = nullptr);
  28. } // namespace ROCKSDB_NAMESPACE