Skip to content

Commit 24a891b

Browse files
Merge 8ee2bd9 into 6887352
2 parents 6887352 + 8ee2bd9 commit 24a891b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+623
-312
lines changed

ydb/core/tx/columnshard/blobs_action/transaction/tx_blobs_written.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void TTxBlobsWritingFinished::DoComplete(const TActorContext& ctx) {
9999
Self->GetOperationsManager().AddEventForLock(*Self, op->GetLockId(), evWrite);
100100
}
101101
}
102-
granule.InsertPortionOnComplete(portion.GetPortionInfo().MutablePortionInfoPtr());
102+
granule.InsertPortionOnComplete(portion.GetPortionInfo(), index);
103103
}
104104
if (op->GetBehaviour() == EOperationBehaviour::NoTxWrite) {
105105
AFL_VERIFY(CommitSnapshot);

ydb/core/tx/columnshard/columnshard__statistics.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ void TColumnShard::Handle(NStat::TEvStatistics::TEvStatisticsRequest::TPtr& ev,
7474
}
7575
AFL_VERIFY(indexMeta->GetColumnIds().size() == 1);
7676

77-
const std::vector<TString> data = portionInfo->GetIndexInplaceDataVerified(indexMeta->GetIndexId());
77+
const std::vector<TString> data
78+
//= portionInfo->GetIndexInplaceDataVerified(indexMeta->GetIndexId())
79+
;
7880

7981
for (const auto& sketchAsString : data) {
8082
auto sketch = std::unique_ptr<TCountMinSketch>(TCountMinSketch::FromString(sketchAsString.data(), sketchAsString.size()));

ydb/core/tx/columnshard/columnshard_impl.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,15 +1238,15 @@ class TTxAskPortionChunks: public TTransactionBase<TColumnShard> {
12381238
for (auto&& i : PortionsByPath) {
12391239
while (i.second.size()) {
12401240
auto p = i.second.back();
1241-
auto rowset = db.Table<NColumnShard::Schema::IndexColumnsV1>().Prefix(p->GetPathId(), p->GetPortionId()).Select();
1242-
NOlap::TPortionInfoConstructor constructor(*p, false, true, true);
1241+
std::vector<NOlap::TColumnChunkLoadContextV1> records;
1242+
std::vector<NOlap::TIndexChunkLoadContext> indexes;
12431243
{
1244+
auto rowset = db.Table<NColumnShard::Schema::IndexColumnsV1>().Prefix(p->GetPathId(), p->GetPortionId()).Select();
12441245
if (!rowset.IsReady()) {
12451246
return false;
12461247
}
12471248
while (!rowset.EndOfSet()) {
1248-
NOlap::TColumnChunkLoadContextV1 chunkLoadContext(rowset);
1249-
constructor.LoadRecord(chunkLoadContext);
1249+
records.emplace_back(NOlap::TColumnChunkLoadContextV1(rowset));
12501250
if (!rowset.Next()) {
12511251
return false;
12521252
}
@@ -1258,13 +1258,13 @@ class TTxAskPortionChunks: public TTransactionBase<TColumnShard> {
12581258
return false;
12591259
}
12601260
while (!rowset.EndOfSet()) {
1261-
NOlap::TIndexChunkLoadContext chunkLoadContext(rowset, &selector);
1262-
constructor.LoadIndex(chunkLoadContext);
1261+
indexes.emplace_back(NOlap::TIndexChunkLoadContext(rowset, &selector));
12631262
if (!rowset.Next()) {
12641263
return false;
12651264
}
12661265
}
12671266
}
1267+
NOlap::TPortionInfoConstructor constructor = NOlap::TPortionInfoConstructor::BuildForLoading(p, std::move(records), std::move(indexes));
12681268
Accessors[i.first].emplace_back(constructor.Build(true));
12691269
i.second.pop_back();
12701270
}

ydb/core/tx/columnshard/counters/portions.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ void TSimplePortionsGroupInfo::AddPortion(const TPortionInfo& p) {
3030
RawBytes += p.GetTotalRawBytes();
3131
Count += 1;
3232
RecordsCount += p.GetRecordsCount();
33-
ChunksCount += p.GetChunksCount();
3433
}
3534

3635
void TSimplePortionsGroupInfo::RemovePortion(const std::shared_ptr<const NOlap::TPortionInfo>& p) {
@@ -42,12 +41,10 @@ void TSimplePortionsGroupInfo::RemovePortion(const TPortionInfo& p) {
4241
RawBytes -= p.GetTotalRawBytes();
4342
Count -= 1;
4443
RecordsCount -= p.GetRecordsCount();
45-
ChunksCount -= p.GetChunksCount();
4644
AFL_VERIFY(RawBytes >= 0);
4745
AFL_VERIFY(BlobBytes >= 0);
4846
AFL_VERIFY(Count >= 0);
4947
AFL_VERIFY(RecordsCount >= 0);
50-
AFL_VERIFY(ChunksCount >= 0);
5148
}
5249

5350
} // namespace NKikimr::NOlap

ydb/core/tx/columnshard/counters/portions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class TSimplePortionsGroupInfo {
1515
YDB_READONLY(i64, RawBytes, 0);
1616
YDB_READONLY(i64, Count, 0);
1717
YDB_READONLY(i64, RecordsCount, 0);
18-
YDB_READONLY(i64, ChunksCount, 0);
1918

2019
public:
2120
NJson::TJsonValue SerializeToJson() const {
@@ -24,7 +23,6 @@ class TSimplePortionsGroupInfo {
2423
result.InsertValue("raw_bytes", RawBytes);
2524
result.InsertValue("count", Count);
2625
result.InsertValue("records_count", RecordsCount);
27-
result.InsertValue("chunks_count", ChunksCount);
2826
return result;
2927
}
3028

@@ -47,7 +45,6 @@ class TSimplePortionsGroupInfo {
4745
result.RawBytes = RawBytes + item.RawBytes;
4846
result.Count = Count + item.Count;
4947
result.RecordsCount = RecordsCount + item.RecordsCount;
50-
result.ChunksCount = ChunksCount + item.ChunksCount;
5148
return result;
5249
}
5350

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "collector.h"
2+
3+
namespace NKikimr::NOlap::NDataAccessorControl {
4+
5+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pragma once
2+
3+
namespace NKikimr::NOlap::NDataAccessorControl {
4+
class IGranuleDataAccessor {
5+
private:
6+
const ui64 PathId;
7+
8+
virtual void DoAskData(const std::shared_ptr<TDataAccessorsRequest>& request) = 0;
9+
virtual void DoModifyPortions(const std::vector<TPortionDataAccessor>& add, const std::vector<ui64>& remove) = 0;
10+
11+
public:
12+
virtual ~IGranuleDataAccessor() = default;
13+
14+
ui64 GetPathId() const {
15+
return PathId;
16+
}
17+
18+
IGranuleDataAccessor(const ui64 pathId)
19+
: PathId(pathId) {
20+
}
21+
22+
void AskData(const std::shared_ptr<TDataAccessorsRequest>& request) {
23+
AFL_VERIFY(request);
24+
AFL_VERIFY(request->HasSubscriber());
25+
return DoAskData(request);
26+
}
27+
void ModifyPortions(const std::vector<TPortionDataAccessor>& add, const std::vector<ui64>& remove) {
28+
return DoModifyPortions(add, remove);
29+
}
30+
};
31+
32+
} // namespace NKikimr::NOlap::NDataAccessorControl
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "constructor.h"
2+
3+
namespace NKikimr::NOlap::NDataAccessorControl {
4+
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma once
2+
3+
namespace NKikimr::NOlap::NDataAccessorControl {
4+
class IConstructor {
5+
private:
6+
public:
7+
};
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "manager.h"
2+
3+
namespace NKikimr::NOlap::NDataAccessorControl {
4+
5+
}

0 commit comments

Comments
 (0)