LevelDB DeleteObsoleteFiles是私人的

leveldb DeleteObsoleteFiles is private

本文关键字:DeleteObsoleteFiles LevelDB      更新时间:2023-10-16

是否有人知道为什么deleteobsoletefiles成员函数在leveldb中是私有的?在某些情况下,我需要释放一些磁盘空间,而这样做的方法之一就是尝试删除LevelDB过时的文件。那么我可以公开并安全地致电吗?

压实后文件变为'obsolute':

DeleteObsoleteFiles()在每个末尾被调用 压实和恢复结束时。它找到了所有人的名字 数据库中的文件。它删除所有不是 当前日志文件。它删除所有未引用的表文件 从某种程度上级别,不是主动压实的输出。

如果您想减少光盘空间,则可以运行压实

  // Compact the underlying storage for the key range [*begin,*end].
  // In particular, deleted and overwritten versions are discarded,
  // and the data is rearranged to reduce the cost of operations
  // needed to access the data.  This operation should typically only
  // be invoked by users who understand the underlying implementation.
  //
  // begin==NULL is treated as a key before all keys in the database.
  // end==NULL is treated as a key after all keys in the database.
  // Therefore the following call will compact the entire database:
  //    db->CompactRange(NULL, NULL);
  virtual void CompactRange(const Slice* begin, const Slice* end)
相关文章:
  • 没有找到相关文章