merge_operators.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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. #include <stdio.h>
  8. #include <memory>
  9. #include <string>
  10. #include "rocksdb/merge_operator.h"
  11. namespace ROCKSDB_NAMESPACE {
  12. class MergeOperators {
  13. public:
  14. static std::shared_ptr<MergeOperator> CreatePutOperator();
  15. static std::shared_ptr<MergeOperator> CreateDeprecatedPutOperator();
  16. static std::shared_ptr<MergeOperator> CreateUInt64AddOperator();
  17. static std::shared_ptr<MergeOperator> CreateStringAppendOperator();
  18. static std::shared_ptr<MergeOperator> CreateStringAppendOperator(
  19. char delim_char);
  20. static std::shared_ptr<MergeOperator> CreateStringAppendOperator(
  21. const std::string& delim);
  22. static std::shared_ptr<MergeOperator> CreateStringAppendTESTOperator();
  23. static std::shared_ptr<MergeOperator> CreateMaxOperator();
  24. static std::shared_ptr<MergeOperator> CreateBytesXOROperator();
  25. static std::shared_ptr<MergeOperator> CreateSortOperator();
  26. // Will return a different merge operator depending on the string.
  27. static std::shared_ptr<MergeOperator> CreateFromStringId(
  28. const std::string& name);
  29. };
  30. } // namespace ROCKSDB_NAMESPACE