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