MCPcopy Create free account
hub / github.com/bytedance/terarkdb / Create

Method Create

table/block_based_table_reader.cc:214–239  ·  view source on GitHub ↗

Read the partition index from the file and create an instance for `PartitionIndexReader`. On success, index_reader will be populated; otherwise it will remain unmodified.

Source from the content-addressed store, hash-verified

212 // On success, index_reader will be populated; otherwise it will remain
213 // unmodified.
214 static Status Create(BlockBasedTable* table, RandomAccessFileReader* file,
215 FilePrefetchBuffer* prefetch_buffer,
216 const Footer& footer, const BlockHandle& index_handle,
217 const ImmutableCFOptions& ioptions,
218 const InternalKeyComparator* icomparator,
219 IndexReader** index_reader,
220 const PersistentCacheOptions& cache_options,
221 const int level, const bool index_key_includes_seq,
222 const bool index_value_is_full,
223 MemoryAllocator* memory_allocator) {
224 std::unique_ptr<Block> index_block;
225 auto s = ReadBlockFromFile(
226 file, prefetch_buffer, footer, ReadOptions(), index_handle,
227 &index_block, ioptions, true /* decompress */,
228 true /*maybe_compressed*/, Slice() /*compression dict*/, cache_options,
229 kDisableGlobalSequenceNumber, 0 /* read_amp_bytes_per_bit */,
230 memory_allocator);
231
232 if (s.ok()) {
233 *index_reader = new PartitionIndexReader(
234 table, icomparator, std::move(index_block), ioptions.statistics,
235 level, index_key_includes_seq, index_value_is_full);
236 }
237
238 return s;
239 }
240
241 // return a two-level iterator: first level is on the partition index
242 virtual InternalIteratorBase<BlockHandle>* NewIterator(

Callers

nothing calls this directly

Calls 4

ReadBlockFromFileFunction · 0.85
ReadOptionsClass · 0.70
SliceClass · 0.70
okMethod · 0.45

Tested by

no test coverage detected