table_reader_caller.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. namespace ROCKSDB_NAMESPACE {
  7. // A list of callers for a table reader. It is used to trace the caller that
  8. // accesses on a block. This is only used for block cache tracing and analysis.
  9. // A user may use kUncategorized if the caller is not interesting for analysis
  10. // or the table reader is called in the test environment, e.g., unit test, table
  11. // reader benchmark, etc.
  12. enum TableReaderCaller : char {
  13. kUserGet = 1,
  14. kUserMultiGet = 2,
  15. kUserIterator = 3,
  16. kUserApproximateSize = 4,
  17. kUserVerifyChecksum = 5,
  18. kSSTDumpTool = 6,
  19. kExternalSSTIngestion = 7,
  20. kRepair = 8,
  21. kPrefetch = 9,
  22. kCompaction = 10,
  23. // A compaction job may refill the block cache with blocks in the new SST
  24. // files if paranoid_file_checks is true.
  25. kCompactionRefill = 11,
  26. // After building a table, it may load all its blocks into the block cache if
  27. // paranoid_file_checks is true.
  28. kFlush = 12,
  29. // sst_file_reader.
  30. kSSTFileReader = 13,
  31. // A list of callers that are either not interesting for analysis or are
  32. // calling from a test environment, e.g., unit test, benchmark, etc.
  33. kUncategorized = 14,
  34. // All callers should be added before kMaxBlockCacheLookupCaller.
  35. kMaxBlockCacheLookupCaller
  36. };
  37. } // namespace ROCKSDB_NAMESPACE