MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / findObjectAt

Method findObjectAt

src/IO/OffsetMap.cpp:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46const StoredObject * OffsetMap::findObjectAt(size_t logical_offset, size_t * object_logical_start_offset) const
47{
48 /// Linear scan: the segment count equals the file's object count, a handful at most.
49 for (const auto & seg : segments)
50 {
51 if (seg.logical_offset <= logical_offset && logical_offset < seg.logical_offset + seg.size)
52 {
53 if (object_logical_start_offset)
54 *object_logical_start_offset = seg.logical_offset;
55 return &seg.object;
56 }
57 }
58 return nullptr;
59}
60
61}

Callers 2

readNextWindowMethod · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64