File tree 6 files changed +39
-29
lines changed
6 files changed +39
-29
lines changed Original file line number Diff line number Diff line change 3
3
#include < ydb/core/tablet/tablet_setup.h>
4
4
#include < ydb/core/base/tablet.h>
5
5
#include < ydb/core/base/blobstorage.h>
6
+ #include < ydb/library/actors/core/event_simple_non_local.h>
6
7
7
8
namespace NKikimr {
8
9
@@ -19,12 +20,10 @@ struct TEvBootstrapper {
19
20
20
21
static_assert (EvEnd < EventSpaceEnd(TKikimrEvents::ES_BOOTSTRAPPER), " event space overrun" );
21
22
22
- struct TEvActivate : public TEventBase <TEvActivate, EvActivate> {
23
- DEFINE_SIMPLE_NONLOCAL_EVENT (TEvActivate, " TEvBootstrapper::Activate" );
23
+ struct TEvActivate : public TEventSimpleNonLocal <TEvActivate, EvActivate> {
24
24
};
25
25
26
- struct TEvStandBy : public TEventBase <TEvStandBy, EvStandBy> {
27
- DEFINE_SIMPLE_NONLOCAL_EVENT (TEvStandBy, " TEvBootstrapper::StandBy" );
26
+ struct TEvStandBy : public TEventSimpleNonLocal <TEvStandBy, EvStandBy> {
28
27
};
29
28
30
29
struct TEvWatch ;
Original file line number Diff line number Diff line change @@ -373,18 +373,4 @@ namespace NActors {
373
373
typedef TEventHandle<TEventType> THandle;
374
374
typedef TAutoPtr<THandle> TPtr;
375
375
};
376
-
377
- #define DEFINE_SIMPLE_NONLOCAL_EVENT (eventType, header ) \
378
- TString ToStringHeader () const override { \
379
- return TString (header); \
380
- } \
381
- bool SerializeToArcadiaStream (NActors::TChunkSerializer*) const override { \
382
- return true ; \
383
- } \
384
- static IEventBase* Load (NActors::TEventSerializedData*) { \
385
- return new eventType (); \
386
- } \
387
- bool IsSerializable () const override { \
388
- return true ; \
389
- }
390
376
}
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include " event.h"
4
+ #include " event_load.h"
5
+ #include < util/system/type_name.h>
6
+
7
+ namespace NActors {
8
+ // Non-local event with empty serialization
9
+ template <typename TEv, ui32 TEventType>
10
+ class TEventSimpleNonLocal : public TEventBase <TEv, TEventType> {
11
+ public:
12
+ TString ToStringHeader () const override {
13
+ return TypeName<TEv>();
14
+ }
15
+
16
+ bool SerializeToArcadiaStream (TChunkSerializer* /* serializer*/ ) const override {
17
+ return true ;
18
+ }
19
+
20
+ bool IsSerializable () const override {
21
+ return true ;
22
+ }
23
+
24
+ static IEventBase* Load (TEventSerializedData*) {
25
+ return new TEv ();
26
+ }
27
+ };
28
+ }
Original file line number Diff line number Diff line change 1
1
#pragma once
2
2
3
3
#include " event_local.h"
4
+ #include " event_simple_non_local.h"
4
5
#include " event_pb.h"
5
6
6
7
#include < util/system/unaligned_mem.h>
@@ -48,12 +49,10 @@ namespace NActors {
48
49
static_assert (End < EventSpaceEnd(ES_HELLOWORLD), " expect End < EventSpaceEnd(ES_HELLOWORLD)" );
49
50
};
50
51
51
- struct TEvPing : public TEventBase <TEvPing, THelloWorld::Ping> {
52
- DEFINE_SIMPLE_NONLOCAL_EVENT (TEvPing, " HelloWorld: Ping" );
52
+ struct TEvPing : public TEventSimpleNonLocal <TEvPing, THelloWorld::Ping> {
53
53
};
54
54
55
- struct TEvPong : public TEventBase <TEvPong, THelloWorld::Pong> {
56
- DEFINE_SIMPLE_NONLOCAL_EVENT (TEvPong, " HelloWorld: Pong" );
55
+ struct TEvPong : public TEventSimpleNonLocal <TEvPong, THelloWorld::Pong> {
57
56
};
58
57
59
58
struct TEvBlob : public TEventBase <TEvBlob, THelloWorld::Blob> {
@@ -116,8 +115,7 @@ namespace NActors {
116
115
struct TEvBootstrap : public TEventLocal <TEvBootstrap, TSystem::Bootstrap> {
117
116
};
118
117
119
- struct TEvPoison : public TEventBase <TEvPoison, TSystem::Poison> {
120
- DEFINE_SIMPLE_NONLOCAL_EVENT (TEvPoison, " System: TEvPoison" )
118
+ struct TEvPoison : public TEventSimpleNonLocal <TEvPoison, TSystem::Poison> {
121
119
};
122
120
123
121
struct TEvWakeup : public TEventLocal <TEvWakeup, TSystem::Wakeup> {
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ Y_UNIT_TEST_SUITE(AskActor) {
92
92
UNIT_ASSERT_EXCEPTION_CONTAINS (
93
93
fut.ExtractValueSync (),
94
94
yexception,
95
- " received unexpected response HelloWorld: Pong " );
95
+ " received unexpected response NActors::TEvents::TEvPong " );
96
96
}
97
97
}
98
98
Original file line number Diff line number Diff line change 10
10
11
11
#include < ydb/library/actors/core/event_local.h>
12
12
#include < ydb/library/actors/core/event_pb.h>
13
+ #include < ydb/library/actors/core/event_simple_non_local.h>
13
14
#include < ydb/library/actors/core/events.h>
14
15
15
16
namespace NYql ::NDqs {
@@ -50,8 +51,7 @@ namespace NYql::NDqs {
50
51
explicit TEvReadyState (NDqProto::TReadyState&& proto);
51
52
};
52
53
53
- struct TEvPullResult : NActors::TEventBase<TEvPullResult, TDqExecuterEvents::ES_PULL_RESULT> {
54
- DEFINE_SIMPLE_NONLOCAL_EVENT (TEvPullResult, " " );
54
+ struct TEvPullResult : NActors::TEventSimpleNonLocal<TEvPullResult, TDqExecuterEvents::ES_PULL_RESULT> {
55
55
};
56
56
57
57
struct TEvGraphExecutionEvent
@@ -99,8 +99,7 @@ namespace NYql::NDqs {
99
99
explicit TEvFullResultWriterStatusResponse (NDqProto::TFullResultWriterStatusResponse& data);
100
100
};
101
101
102
- struct TEvGraphFinished : NActors::TEventBase<TEvGraphFinished, TDqExecuterEvents::ES_GRAPH_FINISHED> {
103
- DEFINE_SIMPLE_NONLOCAL_EVENT (TEvGraphFinished, " " );
102
+ struct TEvGraphFinished : NActors::TEventSimpleNonLocal<TEvGraphFinished, TDqExecuterEvents::ES_GRAPH_FINISHED> {
104
103
};
105
104
106
105
struct TEvFullResultWriterWriteRequest
You can’t perform that action at this time.
0 commit comments