Why leveldb uses a static function Open to initialize table object?

36 Views Asked by At

I have read the code in table.cc of leveldb, but I don't understand why we need to create a static Open function to initialize the Table variable, instead of using a constructor function for initialization.

  static Status Open(const Options& options, RandomAccessFile* file,
                     int level, uint64_t file_size, Table** table);

I guess it's because it needs to correspond to the Finish() function in TableBuilder?

0

There are 0 best solutions below