File tree 4 files changed +28
-5
lines changed
4 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 1
1
#include " statestorage_impl.h"
2
+ #include < ydb/core/node_whiteboard/node_whiteboard.h>
2
3
#include < ydb/library/services/services.pb.h>
3
4
#include < ydb/library/actors/core/interconnect.h>
4
5
17
18
18
19
namespace NKikimr {
19
20
20
- class TBoardReplicaActor : public TActor <TBoardReplicaActor> {
21
+ class TBoardReplicaActor : public TActorBootstrapped <TBoardReplicaActor> {
21
22
22
23
using TOwnerIndex = TMap<TActorId, ui32, TActorId::TOrderedCmp>;
23
24
using TPathIndex = TMap<TString, TSet<ui32>>;
@@ -419,9 +420,15 @@ class TBoardReplicaActor : public TActor<TBoardReplicaActor> {
419
420
}
420
421
421
422
TBoardReplicaActor ()
422
- : TActor(&TThis::StateWork)
423
423
{}
424
424
425
+ void Bootstrap () {
426
+ auto localNodeId = SelfId ().NodeId ();
427
+ auto whiteboardId = NNodeWhiteboard::MakeNodeWhiteboardServiceId (localNodeId);
428
+ Send (whiteboardId, new NNodeWhiteboard::TEvWhiteboard::TEvSystemStateAddRole (" StateStorageBoard" ));
429
+ Become (&TThis::StateWork);
430
+ }
431
+
425
432
STATEFN (StateWork) {
426
433
switch (ev->GetTypeRewrite ()) {
427
434
hFunc (TEvStateStorage::TEvReplicaBoardPublish, Handle );
Original file line number Diff line number Diff line change 7
7
#include < ydb/library/actors/core/interconnect.h>
8
8
#include < ydb/library/actors/core/hfunc.h>
9
9
#include < ydb/library/actors/core/log.h>
10
+ #include < ydb/core/node_whiteboard/node_whiteboard.h>
10
11
11
12
#include < util/generic/map.h>
12
13
#include < util/generic/hash_set.h>
22
23
23
24
namespace NKikimr {
24
25
25
- class TStateStorageReplica : public TActor <TStateStorageReplica> {
26
+ class TStateStorageReplica : public TActorBootstrapped <TStateStorageReplica> {
26
27
TIntrusivePtr<TStateStorageInfo> Info;
27
28
const ui32 ReplicaIndex;
28
29
@@ -416,13 +417,19 @@ class TStateStorageReplica : public TActor<TStateStorageReplica> {
416
417
}
417
418
418
419
TStateStorageReplica (const TIntrusivePtr<TStateStorageInfo> &info, ui32 replicaIndex)
419
- : TActor(&TThis::StateInit)
420
- , Info(info)
420
+ : Info(info)
421
421
, ReplicaIndex(replicaIndex)
422
422
{
423
423
Y_UNUSED (ReplicaIndex);
424
424
}
425
425
426
+ void Bootstrap () {
427
+ auto localNodeId = SelfId ().NodeId ();
428
+ auto whiteboardId = NNodeWhiteboard::MakeNodeWhiteboardServiceId (localNodeId);
429
+ Send (whiteboardId, new NNodeWhiteboard::TEvWhiteboard::TEvSystemStateAddRole (" StateStorage" ));
430
+ Become (&TThis::StateInit);
431
+ }
432
+
426
433
STATEFN (StateInit) {
427
434
switch (ev->GetTypeRewrite ()) {
428
435
hFunc (TEvStateStorage::TEvReplicaLookup, Handle );
Original file line number Diff line number Diff line change 3
3
#include < ydb/core/base/tablet.h>
4
4
#include < ydb/core/base/statestorage.h>
5
5
#include < ydb/core/base/appdata.h>
6
+ #include < ydb/core/node_whiteboard/node_whiteboard.h>
6
7
7
8
#include < ydb/library/actors/core/interconnect.h>
8
9
#include < ydb/library/actors/core/hfunc.h>
@@ -190,6 +191,10 @@ class TBootstrapper : public TActor<TBootstrapper> {
190
191
}
191
192
192
193
void BeginNewRound (const TActorContext &ctx) {
194
+ auto localNodeId = SelfId ().NodeId ();
195
+ auto whiteboardId = NNodeWhiteboard::MakeNodeWhiteboardServiceId (localNodeId);
196
+ Send (whiteboardId, new NNodeWhiteboard::TEvWhiteboard::TEvSystemStateAddRole (" Bootstrapper" ));
197
+
193
198
if (BootstrapperInfo->OtherNodes .empty ())
194
199
return Boot (ctx);
195
200
Original file line number Diff line number Diff line change 8
8
#include " replica.h"
9
9
10
10
#include < ydb/core/scheme/scheme_pathid.h>
11
+ #include < ydb/core/node_whiteboard/node_whiteboard.h>
11
12
12
13
#include < ydb/library/services/services.pb.h>
13
14
#include < ydb/library/yverify_stream/yverify_stream.h>
@@ -1269,6 +1270,9 @@ class TReplica: public TMonitorableActor<TReplica> {
1269
1270
1270
1271
void Bootstrap () {
1271
1272
TMonitorableActor::Bootstrap ();
1273
+ auto localNodeId = SelfId ().NodeId ();
1274
+ auto whiteboardId = NNodeWhiteboard::MakeNodeWhiteboardServiceId (localNodeId);
1275
+ Send (whiteboardId, new NNodeWhiteboard::TEvWhiteboard::TEvSystemStateAddRole (" SchemeBoard" ));
1272
1276
Become (&TThis::StateWork);
1273
1277
}
1274
1278
You can’t perform that action at this time.
0 commit comments