作者似乎將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();