MCPcopy Create free account
hub / github.com/catboost/catboost / GetBlock

Function GetBlock

library/cpp/on_disk/chunks/chunked_helpers.cpp:5–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "chunked_helpers.h"
4
5TBlob GetBlock(const TBlob& blob, size_t index) {
6 TChunkedDataReader reader(blob);
7 if (index >= reader.GetBlocksCount())
8 ythrow yexception() << "index " << index << " is >= than block count " << reader.GetBlocksCount();
9 size_t begin = (const char*)reader.GetBlock(index) - (const char*)blob.Data();
10 return blob.SubBlob(begin, begin + reader.GetBlockLen(index));
11}
12
13/*************************** TNamedChunkedDataReader ***************************/
14

Callers 8

GetBlobMethod · 0.85
GetRegionMethod · 0.85
GetBlockByNameMethod · 0.85
GetBlobByNameMethod · 0.85
TestStringsMethod · 0.85
TMappedAhoCorasickMethod · 0.85
CheckDataMethod · 0.85

Calls 6

yexceptionClass · 0.85
GetBlockMethod · 0.80
SubBlobMethod · 0.80
GetBlockLenMethod · 0.80
GetBlocksCountMethod · 0.45
DataMethod · 0.45

Tested by 1

TestStringsMethod · 0.68