RocksDB Get operation retrieves the record value for a given key. RocksDB code is very flexible and has several levels of abstractions. If you are planning to understand the code path you can start reading from the functions specified in this post.
DB Get Operation
RocksDB stores the recently inserted data in the MemTable and periodically flushes the data to disk based SSTables (sst files). It needs to search both MemTable and SSTables for the given key.
The entry function for the Get operation is db_impl_readonly.cc:DBImplReadOnly::Get() .
If the record not found in the MemTable then it will search the key in the table cache this code is in db/table_cache.cc:TableCache::Get()
If it is not found in table cache then it searches the files at each level starting from level 0. If you use BlockBasedTable the default option the entry point is table/block_based/block_based_table_reader.cc:BlockBasedTable::Get(). It will search the block index to find the given key. It uses BlockIter::Seek() function to search. The keys are compared using the comparator function and the corresponding value is returned.