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