aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/on_disk/chunks/reader.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/on_disk/chunks/reader.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/on_disk/chunks/reader.h')
-rw-r--r--library/cpp/on_disk/chunks/reader.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/library/cpp/on_disk/chunks/reader.h b/library/cpp/on_disk/chunks/reader.h
index c5fe783319..aba81a355f 100644
--- a/library/cpp/on_disk/chunks/reader.h
+++ b/library/cpp/on_disk/chunks/reader.h
@@ -7,51 +7,51 @@
class TBlob;
class TChunkedDataReader {
-public:
- TChunkedDataReader(const TBlob& blob);
+public:
+ TChunkedDataReader(const TBlob& blob);
- inline const void* GetBlock(size_t index) const {
- CheckIndex(index);
- return Offsets[index];
- }
+ inline const void* GetBlock(size_t index) const {
+ CheckIndex(index);
+ return Offsets[index];
+ }
- inline size_t GetBlockLen(size_t index) const {
- CheckIndex(index);
+ inline size_t GetBlockLen(size_t index) const {
+ CheckIndex(index);
- if (Version == 0) {
- if (index + 1 < Offsets.size()) {
- return Offsets[index + 1] - Offsets[index];
+ if (Version == 0) {
+ if (index + 1 < Offsets.size()) {
+ return Offsets[index + 1] - Offsets[index];
}
- return Size - (Offsets.back() - Offsets.front());
+ return Size - (Offsets.back() - Offsets.front());
}
- return Lengths[index];
- }
+ return Lengths[index];
+ }
- TBlob GetBlob(size_t index) const;
+ TBlob GetBlob(size_t index) const;
- template <typename T>
+ template <typename T>
TArrayRef<const T> GetRegion(size_t index) const {
- size_t len = GetBlockLen(index);
- Y_ENSURE(len % sizeof(T) == 0, "wrong data padding");
+ size_t len = GetBlockLen(index);
+ Y_ENSURE(len % sizeof(T) == 0, "wrong data padding");
return TArrayRef<const T>(reinterpret_cast<const T*>(GetBlock(index)), len / sizeof(T));
- }
+ }
- inline size_t GetBlocksCount() const {
- return Offsets.size();
- }
+ inline size_t GetBlocksCount() const {
+ return Offsets.size();
+ }
-private:
- inline void CheckIndex(size_t index) const {
- if (index >= GetBlocksCount()) {
- ythrow yexception() << "requested block " << index << " of " << GetBlocksCount() << " blocks";
+private:
+ inline void CheckIndex(size_t index) const {
+ if (index >= GetBlocksCount()) {
+ ythrow yexception() << "requested block " << index << " of " << GetBlocksCount() << " blocks";
}
- }
+ }
-private:
- ui64 Version = 0;
- TVector<const char*> Offsets;
- TVector<size_t> Lengths;
- size_t Size = 0;
+private:
+ ui64 Version = 0;
+ TVector<const char*> Offsets;
+ TVector<size_t> Lengths;
+ size_t Size = 0;
};