Skip to content

Commit 8ee2bd9

Browse files
correction
1 parent 7c5a2c4 commit 8ee2bd9

File tree

24 files changed

+335
-90
lines changed

24 files changed

+335
-90
lines changed
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+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#pragma once
2+
3+
namespace NKikimr::NOlap {
4+
class TGranuleMeta;
5+
}
6+
7+
namespace NKikimr::NOlap::NDataAccessorControl {
8+
class IMetadataMemoryManager {
9+
private:
10+
virtual std::unique_ptr<IGranuleDataAccessor> DoBuildCollector() = 0;
11+
virtual std::shared_ptr<ITxReader> DoBuildGranuleLoader(
12+
const TVersionedIndex& versionedIndex, TGranuleMeta* granule, const std::shared_ptr<IBlobGroupSelector>& dsGroupSelector) = 0;
13+
14+
public:
15+
virtual std::unique_ptr<IGranuleDataAccessor> BuildCollector() override {
16+
return DoBuildCollector();
17+
}
18+
19+
std::shared_ptr<ITxReader> BuildGranuleLoader(
20+
const TVersionedIndex& versionedIndex, TGranuleMeta* granule, const std::shared_ptr<IBlobGroupSelector>& dsGroupSelector) {
21+
return DoBuildGranuleLoader(versionedIndex, granule, dsGroupSelector);
22+
}
23+
};
24+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
LIBRARY()
2+
3+
SRCS(
4+
manager.cpp
5+
collector.cpp
6+
constructor.cpp
7+
)
8+
9+
PEERDIR(
10+
)
11+
12+
END()

ydb/core/tx/columnshard/data_accessor/controller.h

Lines changed: 0 additions & 77 deletions
This file was deleted.
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::NInMem {
4+
5+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#pragma once
2+
3+
namespace NKikimr::NOlap::NDataAccessorControl::NInMem {
4+
class TCollector: public IGranuleDataAccessor {
5+
private:
6+
using TBase = IGranuleDataAccessor;
7+
THashMap<ui64, TPortionDataAccessor> Accessors;
8+
virtual void DoAskData(const std::shared_ptr<TDataAccessorsRequest>& request) override {
9+
std::vector<TPortionDataAccessor> accessors;
10+
auto& portions = request->StartFetching(GetPathId());
11+
for (auto&& i : portions) {
12+
auto it = Accessors.find(i->GetPortionId());
13+
AFL_VERIFY(it != Accessors.end());
14+
accessors.emplace_back(it->second);
15+
}
16+
request->AddData(GetPathId(), std::move(accessors));
17+
}
18+
virtual void DoModifyPortions(const std::vector<TPortionDataAccessor>& add, const std::vector<ui64>& remove) override {
19+
for (auto&& i : remove) {
20+
AFL_VERIFY(Accessors.erase(i));
21+
}
22+
for (auto&& i : add) {
23+
AFL_VERIFY(Accessors.emplace(i.GetPortionInfo().GetPortionId(), i).second);
24+
}
25+
}
26+
27+
public:
28+
TCollector(const ui64 pathId)
29+
: TBase(pathId) {
30+
}
31+
};
32+
33+
} // namespace NKikimr::NOlap::NDataAccessorControl

0 commit comments

Comments
 (0)