作者似乎将TEST_
前缀用于不打算成为API一部分的公共方法。这些方法是公开的,只是为了使测试更容易,并且它们的前缀为TEST_
以阻止用户调用它们。
为什么这些方法不应该出现在关键路径中?它们就像私人方法,但可用于测试。
其他的想法:
编辑:要清楚,我只是做基础上,与TEST_
前缀方法的几个猜测。清除代码库显示唯一的这种方法如下(全部公开):
// Compact any files in the named level that overlap [*begin,*end]
void TEST_CompactRange(int level, const Slice* begin, const Slice* end);
// Force current memtable contents to be compacted.
Status TEST_CompactMemTable();
// Return an internal iterator over the current state of the database.
// The keys of this iterator are internal keys (see format.h).
// The returned iterator should be deleted when no longer needed.
Iterator* TEST_NewInternalIterator();
// Return the maximum overlapping data (in bytes) at next level for any
// file at a level >= 1.
int64_t TEST_MaxNextLevelOverlappingBytes();