Skip to content

Commit 86bff9d

Browse files
authored
Replace DEFINE_SIMPLE_LOCAL_EVENT to TEventLocal (#8302)
1 parent be50511 commit 86bff9d

File tree

7 files changed

+16
-90
lines changed

7 files changed

+16
-90
lines changed

ydb/core/client/minikql_compile/yql_expr_minikql.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ struct TMiniKQLCompileActorEvents {
4343
End
4444
};
4545
static_assert(End < EventSpaceEnd(NActors::TEvents::ES_PRIVATE), "expect End < EventSpaceEnd(TEvents::ES_PRIVATE)");
46-
struct TEvCompileResult : public NActors::TEventBase<TEvCompileResult, CompileResult> {
46+
struct TEvCompileResult : public NActors::TEventLocal<TEvCompileResult, CompileResult> {
4747
explicit TEvCompileResult(const TMiniKQLCompileResult& result, THashMap<TString, ui64> &&resolveCookies);
48-
DEFINE_SIMPLE_LOCAL_EVENT(TEvCompileResult, "EvCompileResult");
4948

5049
TMiniKQLCompileResult Result;
5150
THashMap<TString, ui64> CompileResolveCookies;

ydb/library/actors/core/event.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -374,20 +374,6 @@ namespace NActors {
374374
typedef TAutoPtr<THandle> TPtr;
375375
};
376376

377-
#define DEFINE_SIMPLE_LOCAL_EVENT(eventType, header) \
378-
TString ToStringHeader() const override { \
379-
return TString(header); \
380-
} \
381-
bool SerializeToArcadiaStream(NActors::TChunkSerializer*) const override { \
382-
Y_ABORT("Local event " #eventType " is not serializable"); \
383-
} \
384-
static IEventBase* Load(NActors::TEventSerializedData*) { \
385-
Y_ABORT("Local event " #eventType " has no load method"); \
386-
} \
387-
bool IsSerializable() const override { \
388-
return false; \
389-
}
390-
391377
#define DEFINE_SIMPLE_NONLOCAL_EVENT(eventType, header) \
392378
TString ToStringHeader() const override { \
393379
return TString(header); \

ydb/library/actors/core/events.h

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "event.h"
3+
#include "event_local.h"
44
#include "event_pb.h"
55

66
#include <util/system/unaligned_mem.h>
@@ -113,28 +113,23 @@ namespace NActors {
113113
static_assert(End < EventSpaceEnd(ES_SYSTEM), "expect End < EventSpaceEnd(ES_SYSTEM)");
114114
};
115115

116-
struct TEvBootstrap: public TEventBase<TEvBootstrap, TSystem::Bootstrap> {
117-
DEFINE_SIMPLE_LOCAL_EVENT(TEvBootstrap, "System: TEvBootstrap")
116+
struct TEvBootstrap: public TEventLocal<TEvBootstrap, TSystem::Bootstrap> {
118117
};
119118

120119
struct TEvPoison : public TEventBase<TEvPoison, TSystem::Poison> {
121120
DEFINE_SIMPLE_NONLOCAL_EVENT(TEvPoison, "System: TEvPoison")
122121
};
123122

124-
struct TEvWakeup: public TEventBase<TEvWakeup, TSystem::Wakeup> {
125-
DEFINE_SIMPLE_LOCAL_EVENT(TEvWakeup, "System: TEvWakeup")
126-
123+
struct TEvWakeup: public TEventLocal<TEvWakeup, TSystem::Wakeup> {
127124
TEvWakeup(ui64 tag = 0) : Tag(tag) { }
128125

129126
const ui64 Tag = 0;
130127
};
131128

132-
struct TEvSubscribe: public TEventBase<TEvSubscribe, TSystem::Subscribe> {
133-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSubscribe, "System: TEvSubscribe")
129+
struct TEvSubscribe: public TEventLocal<TEvSubscribe, TSystem::Subscribe> {
134130
};
135131

136-
struct TEvUnsubscribe: public TEventBase<TEvUnsubscribe, TSystem::Unsubscribe> {
137-
DEFINE_SIMPLE_LOCAL_EVENT(TEvUnsubscribe, "System: TEvUnsubscribe")
132+
struct TEvUnsubscribe: public TEventLocal<TEvUnsubscribe, TSystem::Unsubscribe> {
138133
};
139134

140135
struct TEvUndelivered: public TEventBase<TEvUndelivered, TSystem::Undelivered> {
@@ -174,45 +169,36 @@ namespace NActors {
174169
}
175170
};
176171

177-
struct TEvCompleted: public TEventBase<TEvCompleted, TSystem::Completed> {
172+
struct TEvCompleted: public TEventLocal<TEvCompleted, TSystem::Completed> {
178173
const ui32 Id;
179174
const ui32 Status;
180175
TEvCompleted(ui32 id = 0, ui32 status = 0)
181176
: Id(id)
182177
, Status(status)
183178
{
184179
}
185-
186-
DEFINE_SIMPLE_LOCAL_EVENT(TEvCompleted, "System: TEvCompleted")
187180
};
188181

189-
struct TEvPoisonTaken: public TEventBase<TEvPoisonTaken, TSystem::PoisonTaken> {
190-
DEFINE_SIMPLE_LOCAL_EVENT(TEvPoisonTaken, "System: TEvPoisonTaken")
182+
struct TEvPoisonTaken: public TEventLocal<TEvPoisonTaken, TSystem::PoisonTaken> {
191183
};
192184

193-
struct TEvFlushLog: public TEventBase<TEvFlushLog, TSystem::FlushLog> {
194-
DEFINE_SIMPLE_LOCAL_EVENT(TEvFlushLog, "System: TEvFlushLog")
185+
struct TEvFlushLog: public TEventLocal<TEvFlushLog, TSystem::FlushLog> {
195186
};
196187

197-
struct TEvCallbackException : TEventBase<TEvCallbackException, TSystem::CallbackException> {
198-
DEFINE_SIMPLE_LOCAL_EVENT(TEvCallbackException, "System: TEvCallbackException")
199-
188+
struct TEvCallbackException : TEventLocal<TEvCallbackException, TSystem::CallbackException> {
200189
const TActorId Id;
201190
TString Msg;
202191

203192
TEvCallbackException(const TActorId& id, const TString& msg) : Id(id), Msg(msg) {}
204193
};
205194

206-
struct TEvCallbackCompletion : TEventBase<TEvCallbackCompletion, TSystem::CallbackCompletion> {
207-
DEFINE_SIMPLE_LOCAL_EVENT(TEvCallbackException, "System: TEvCallbackCompletion")
208-
195+
struct TEvCallbackCompletion : TEventLocal<TEvCallbackCompletion, TSystem::CallbackCompletion> {
209196
const TActorId Id;
210197

211198
TEvCallbackCompletion(const TActorId& id) : Id(id) {}
212199
};
213200

214-
struct TEvGone: public TEventBase<TEvGone, TSystem::Gone> {
215-
DEFINE_SIMPLE_LOCAL_EVENT(TEvGone, "System: TEvGone")
201+
struct TEvGone: public TEventLocal<TEvGone, TSystem::Gone> {
216202
};
217203

218204
struct TEvInvokeResult;

ydb/library/actors/core/interconnect.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,12 @@ namespace NActors {
152152
struct TEvResolveNode;
153153
struct TEvNodeAddress;
154154

155-
struct TEvConnectNode: public TEventBase<TEvConnectNode, EvConnectNode> {
156-
DEFINE_SIMPLE_LOCAL_EVENT(TEvConnectNode, "TEvInterconnect::TEvConnectNode")
155+
struct TEvConnectNode: public TEventLocal<TEvConnectNode, EvConnectNode> {
157156
};
158157

159158
struct TEvAcceptIncoming;
160159

161160
struct TEvNodeConnected: public TEventLocal<TEvNodeConnected, EvNodeConnected> {
162-
DEFINE_SIMPLE_LOCAL_EVENT(TEvNodeConnected, "TEvInterconnect::TEvNodeConnected")
163161
TEvNodeConnected(ui32 node) noexcept
164162
: NodeId(node)
165163
{
@@ -168,7 +166,6 @@ namespace NActors {
168166
};
169167

170168
struct TEvNodeDisconnected: public TEventLocal<TEvNodeDisconnected, EvNodeDisconnected> {
171-
DEFINE_SIMPLE_LOCAL_EVENT(TEvNodeDisconnected, "TEvInterconnect::TEvNodeDisconnected")
172169
TEvNodeDisconnected(ui32 node) noexcept
173170
: NodeId(node)
174171
{

ydb/library/actors/core/ut/executor_pool_basic_ut.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ using namespace NActors;
1616

1717
////////////////////////////////////////////////////////////////////////////////
1818

19-
struct TEvMsg : public NActors::TEventBase<TEvMsg, 10347> {
20-
DEFINE_SIMPLE_LOCAL_EVENT(TEvMsg, "ExecutorPoolTest: Msg");
19+
struct TEvMsg : public NActors::TEventLocal<TEvMsg, 10347> {
2120
};
2221

2322
////////////////////////////////////////////////////////////////////////////////

ydb/library/actors/interconnect/events_local.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,12 @@ namespace NActors {
6969
};
7070

7171
struct TEvSocketReadyRead: public TEventLocal<TEvSocketReadyRead, ui32(ENetwork::SocketReadyRead)> {
72-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSocketReadyRead, "Network: TEvSocketReadyRead")
7372
};
7473

7574
struct TEvSocketReadyWrite: public TEventLocal<TEvSocketReadyWrite, ui32(ENetwork::SocketReadyWrite)> {
76-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSocketReadyWrite, "Network: TEvSocketReadyWrite")
7775
};
7876

7977
struct TEvSocketError: public TEventLocal<TEvSocketError, ui32(ENetwork::SocketError)> {
80-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSocketError, ::strerror(Error))
8178
TString GetReason() const {
8279
return ::strerror(Error);
8380
}
@@ -92,11 +89,9 @@ namespace NActors {
9289
};
9390

9491
struct TEvSocketConnect: public TEventLocal<TEvSocketConnect, ui32(ENetwork::Connect)> {
95-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSocketConnect, "Network: TEvSocketConnect")
9692
};
9793

9894
struct TEvSocketDisconnect: public TEventLocal<TEvSocketDisconnect, ui32(ENetwork::Disconnect)> {
99-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSocketDisconnect, "Network: TEvSocketDisconnect")
10095
TDisconnectReason Reason;
10196

10297
TEvSocketDisconnect(TDisconnectReason reason)
@@ -106,19 +101,15 @@ namespace NActors {
106101
};
107102

108103
struct TEvHandshakeBrokerTake: TEventLocal<TEvHandshakeBrokerTake, ui32(ENetwork::HandshakeBrokerTake)> {
109-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeBrokerTake, "Network: TEvHandshakeBrokerTake")
110104
};
111105

112106
struct TEvHandshakeBrokerFree: TEventLocal<TEvHandshakeBrokerFree, ui32(ENetwork::HandshakeBrokerFree)> {
113-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeBrokerFree, "Network: TEvHandshakeBrokerFree")
114107
};
115108

116109
struct TEvHandshakeBrokerPermit: TEventLocal<TEvHandshakeBrokerPermit, ui32(ENetwork::HandshakeBrokerPermit)> {
117-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeBrokerPermit, "Network: TEvHandshakeBrokerPermit")
118110
};
119111

120112
struct TEvHandshakeAsk: public TEventLocal<TEvHandshakeAsk, ui32(ENetwork::HandshakeAsk)> {
121-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeAsk, "Network: TEvHandshakeAsk")
122113
TEvHandshakeAsk(const TActorId& self,
123114
const TActorId& peer,
124115
ui64 counter)
@@ -133,8 +124,6 @@ namespace NActors {
133124
};
134125

135126
struct TEvHandshakeAck: public TEventLocal<TEvHandshakeAck, ui32(ENetwork::HandshakeAck)> {
136-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeAck, "Network: TEvHandshakeAck")
137-
138127
TEvHandshakeAck(const TActorId& self, ui64 nextPacket, TSessionParams params)
139128
: Self(self)
140129
, NextPacket(nextPacket)
@@ -147,32 +136,25 @@ namespace NActors {
147136
};
148137

149138
struct TEvHandshakeNak : TEventLocal<TEvHandshakeNak, ui32(ENetwork::HandshakeNak)> {
150-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSocketReadyRead, "Network: TEvHandshakeNak")
151139
};
152140

153141
struct TEvHandshakeRequest
154142
: public TEventLocal<TEvHandshakeRequest,
155143
ui32(ENetwork::HandshakeRequest)> {
156-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeRequest,
157-
"Network: TEvHandshakeRequest")
158144

159145
NActorsInterconnect::THandshakeRequest Record;
160146
};
161147

162148
struct TEvHandshakeReplyOK
163149
: public TEventLocal<TEvHandshakeReplyOK,
164150
ui32(ENetwork::HandshakeReplyOK)> {
165-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeReplyOK,
166-
"Network: TEvHandshakeReplyOK")
167151

168152
NActorsInterconnect::THandshakeReply Record;
169153
};
170154

171155
struct TEvHandshakeReplyError
172156
: public TEventLocal<TEvHandshakeReplyError,
173157
ui32(ENetwork::HandshakeReplyError)> {
174-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeReplyError,
175-
"Network: TEvHandshakeReplyError")
176158

177159
TEvHandshakeReplyError(TString error) {
178160
Record.SetErrorExplaination(error);
@@ -182,7 +164,6 @@ namespace NActors {
182164
};
183165

184166
struct TEvIncomingConnection: public TEventLocal<TEvIncomingConnection, ui32(ENetwork::IncomingConnection)> {
185-
DEFINE_SIMPLE_LOCAL_EVENT(TEvIncomingConnection, "Network: TEvIncomingConnection")
186167
TIntrusivePtr<NInterconnect::TStreamSocket> Socket;
187168
NInterconnect::TAddress Address;
188169

@@ -193,8 +174,6 @@ namespace NActors {
193174
};
194175

195176
struct TEvHandshakeDone: public TEventLocal<TEvHandshakeDone, ui32(ENetwork::HandshakeDone)> {
196-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeDone, "Network: TEvHandshakeDone")
197-
198177
TEvHandshakeDone(
199178
TIntrusivePtr<NInterconnect::TStreamSocket> socket,
200179
const TActorId& peer,
@@ -223,8 +202,6 @@ namespace NActors {
223202
};
224203

225204
struct TEvHandshakeFail: public TEventLocal<TEvHandshakeFail, ui32(ENetwork::HandshakeFail)> {
226-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHandshakeFail, "Network: TEvHandshakeFail")
227-
228205
enum EnumHandshakeFail {
229206
HANDSHAKE_FAIL_TRANSIENT,
230207
HANDSHAKE_FAIL_PERMANENT,
@@ -242,25 +219,19 @@ namespace NActors {
242219
};
243220

244221
struct TEvKick: public TEventLocal<TEvKick, ui32(ENetwork::Kick)> {
245-
DEFINE_SIMPLE_LOCAL_EVENT(TEvKick, "Network: TEvKick")
246222
};
247223

248224
struct TEvFlush: public TEventLocal<TEvFlush, ui32(ENetwork::Flush)> {
249-
DEFINE_SIMPLE_LOCAL_EVENT(TEvFlush, "Network: TEvFlush")
250225
};
251226

252227
struct TEvLocalNodeInfo
253228
: public TEventLocal<TEvLocalNodeInfo, ui32(ENetwork::NodeInfo)> {
254-
DEFINE_SIMPLE_LOCAL_EVENT(TEvLocalNodeInfo, "Network: TEvLocalNodeInfo")
255229

256230
ui32 NodeId;
257231
std::vector<NInterconnect::TAddress> Addresses;
258232
};
259233

260234
struct TEvBunchOfEventsToDestroy : TEventLocal<TEvBunchOfEventsToDestroy, ui32(ENetwork::BunchOfEventsToDestroy)> {
261-
DEFINE_SIMPLE_LOCAL_EVENT(TEvBunchOfEventsToDestroy,
262-
"Network: TEvBunchOfEventsToDestroy")
263-
264235
TEvBunchOfEventsToDestroy(TDeque<TAutoPtr<IEventBase>> events)
265236
: Events(std::move(events))
266237
{
@@ -271,31 +242,26 @@ namespace NActors {
271242

272243
struct TEvResolveAddress
273244
: public TEventLocal<TEvResolveAddress, ui32(ENetwork::ResolveAddress)> {
274-
DEFINE_SIMPLE_LOCAL_EVENT(TEvResolveAddress, "Network: TEvResolveAddress")
275245

276246
TString Address;
277247
ui16 Port;
278248
};
279249

280250
struct TEvAddressInfo
281251
: public TEventLocal<TEvAddressInfo, ui32(ENetwork::AddressInfo)> {
282-
DEFINE_SIMPLE_LOCAL_EVENT(TEvAddressInfo, "Network: TEvAddressInfo")
283252

284253
NAddr::IRemoteAddrPtr Address;
285254
};
286255

287256
struct TEvResolveError
288257
: public TEventLocal<TEvResolveError, ui32(ENetwork::ResolveError)> {
289-
DEFINE_SIMPLE_LOCAL_EVENT(TEvResolveError, "Network: TEvResolveError")
290258

291259
TString Explain;
292260
TString Host;
293261
};
294262

295263
struct TEvHTTPStreamStatus
296264
: public TEventLocal<TEvHTTPStreamStatus, ui32(ENetwork::HTTPStreamStatus)> {
297-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHTTPStreamStatus,
298-
"Network: TEvHTTPStreamStatus")
299265
enum EStatus {
300266
READY,
301267
COMPLETE,
@@ -309,7 +275,6 @@ namespace NActors {
309275

310276
struct TEvHTTPSendContent
311277
: public TEventLocal<TEvHTTPSendContent, ui32(ENetwork::HTTPSendContent)> {
312-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHTTPSendContent, "Network: TEvHTTPSendContent")
313278

314279
const char* Data;
315280
size_t Len;
@@ -319,14 +284,11 @@ namespace NActors {
319284
struct TEvConnectWakeup
320285
: public TEventLocal<TEvConnectWakeup,
321286
ui32(ENetwork::ConnectProtocolWakeup)> {
322-
DEFINE_SIMPLE_LOCAL_EVENT(TEvConnectWakeup, "Protocols: TEvConnectWakeup")
323287
};
324288

325289
struct TEvHTTPProtocolRetry
326290
: public TEventLocal<TEvHTTPProtocolRetry,
327291
ui32(ENetwork::HTTPProtocolRetry)> {
328-
DEFINE_SIMPLE_LOCAL_EVENT(TEvHTTPProtocolRetry,
329-
"Protocols: TEvHTTPProtocolRetry")
330292
};
331293

332294
struct TEvLoadMessage
@@ -377,8 +339,6 @@ namespace NActors {
377339
{};
378340

379341
struct TEvSessionBufferSizeRequest : TEventLocal<TEvSessionBufferSizeRequest, static_cast<ui32>(ENetwork::EvSessionBufferSizeRequest)> {
380-
//DEFINE_SIMPLE_LOCAL_EVENT(TEvSessionBufferSizeRequest, "Session: TEvSessionBufferSizeRequest")
381-
DEFINE_SIMPLE_LOCAL_EVENT(TEvSessionBufferSizeRequest, "Network: TEvSessionBufferSizeRequest");
382342
};
383343

384344
struct TEvSessionBufferSizeResponse : TEventLocal<TEvSessionBufferSizeResponse, static_cast<ui32>(ENetwork::EvSessionBufferSizeResponse)> {

ydb/library/yql/providers/dq/actors/events.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <ydb/library/yql/minikql/computation/mkql_computation_node_holders.h>
99
#include <ydb/library/yql/minikql/mkql_node.h>
1010

11+
#include <ydb/library/actors/core/event_local.h>
1112
#include <ydb/library/actors/core/event_pb.h>
1213
#include <ydb/library/actors/core/events.h>
1314

@@ -116,9 +117,7 @@ namespace NYql::NDqs {
116117
explicit TEvFullResultWriterAck(NDqProto::TFullResultWriterAck& data);
117118
};
118119

119-
struct TEvMessageProcessed : NActors::TEventBase<TEvMessageProcessed, TDqDataEvents::ES_MESSAGE_PROCESSED> {
120-
DEFINE_SIMPLE_LOCAL_EVENT(TEvMessageProcessed, "");
121-
120+
struct TEvMessageProcessed : NActors::TEventLocal<TEvMessageProcessed, TDqDataEvents::ES_MESSAGE_PROCESSED> {
122121
explicit TEvMessageProcessed(const TString& messageId);
123122

124123
const TString MessageId;

0 commit comments

Comments
 (0)