From dd39b4cc696ce9e5b192d30e8ebef4ec3e75a875 Mon Sep 17 00:00:00 2001 From: Kirill Gavrilov Date: Tue, 22 Oct 2024 15:11:05 +0000 Subject: [PATCH] fix external_bytes column in yezzey_offload_relation_status_internal --- src/util.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index deab3a4..680c39f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -11,6 +11,8 @@ #include #include "virtual_index.h" +#include "storage_lister.h" +#include "yproxy.h" #include "io.h" #include "io_adv.h" @@ -149,12 +151,12 @@ std::string make_yezzey_url(const std::string &prefix, int64_t modcount, int64_t yezzey_virtual_relation_size(std::shared_ptr adv, int32_t segid) { try { - // auto lister = StorageLister(adv, GpIdentity.segindex); + auto lister = YProxyLister(adv, segid); int64_t sz = 0; - // for (auto key : lister.reader_->getKeyList().contents) { - // sz += - // lister.reader_->bucketReader.constructReaderParams(key).getKeySize(); - // } + auto chunks = lister.list_relation_chunks(); + for (auto chunk : chunks) { + sz += chunk.chunkSize; + } /* external reader destruct */ return sz; } catch (...) {