Skip to content

Commit

Permalink
Remove TEventSimple (#6715)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximyurchuk authored Jul 16, 2024
1 parent a037131 commit d116509
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
3 changes: 3 additions & 0 deletions ydb/core/protos/tx_proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ message TEvInvalidateTable {
optional uint64 TableId = 2;
}

message TEvInvalidateTableResult {
}

message TEvExportRequest {
optional string DatabaseName = 1;
optional string UserToken = 2;
Expand Down
6 changes: 3 additions & 3 deletions ydb/core/tx/tx_proxy/datareq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class TDataReq : public TActor<TDataReq> {

static_assert(EvEnd < EventSpaceEnd(TEvents::ES_PRIVATE), "expect EvEnd < EventSpaceEnd(TEvents::ES_PRIVATE)");

struct TEvProxyDataReqOngoingTransactionWatchdog : public TEventSimple<TEvProxyDataReqOngoingTransactionWatchdog, EvProxyDataReqOngoingTransactionsWatchdog> {};
struct TEvProxyDataReqOngoingTransactionsWatchdog : public TEventLocal<TEvProxyDataReqOngoingTransactionsWatchdog, EvProxyDataReqOngoingTransactionsWatchdog> {};

struct TEvReattachToShard : public TEventLocal<TEvReattachToShard, EvReattachToShard> {
const ui64 TabletId;
Expand Down Expand Up @@ -1306,7 +1306,7 @@ void TDataReq::Handle(TEvTxProxyReq::TEvMakeRequest::TPtr &ev, const TActorConte
}

WallClockAccepted = Now();
ctx.Schedule(TDuration::MilliSeconds(KIKIMR_DATAREQ_WATCHDOG_PERIOD), new TEvPrivate::TEvProxyDataReqOngoingTransactionWatchdog());
ctx.Schedule(TDuration::MilliSeconds(KIKIMR_DATAREQ_WATCHDOG_PERIOD), new TEvPrivate::TEvProxyDataReqOngoingTransactionsWatchdog());

// Schedule execution timeout
{
Expand Down Expand Up @@ -2942,7 +2942,7 @@ void TDataReq::HandleWatchdog(const TActorContext &ctx) {
LOG_LOG_S_SAMPLED_BY(ctx, NActors::NLog::PRI_INFO, NKikimrServices::TX_PROXY, TxId,
"Actor# " << ctx.SelfID.ToString() << " txid# " << TxId
<< " Transactions still running for " << fromStart);
ctx.Schedule(TDuration::MilliSeconds(KIKIMR_DATAREQ_WATCHDOG_PERIOD), new TEvPrivate::TEvProxyDataReqOngoingTransactionWatchdog());
ctx.Schedule(TDuration::MilliSeconds(KIKIMR_DATAREQ_WATCHDOG_PERIOD), new TEvPrivate::TEvProxyDataReqOngoingTransactionsWatchdog());
}

void TDataReq::SendStreamClearanceResponse(ui64 shard, bool cleared, const TActorContext &ctx)
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/tx_proxy/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct TEvTxUserProxy {
}
};

struct TEvInvalidateTableResult : public TEventSimple<TEvInvalidateTableResult, EvInvalidateTableResult> {};
struct TEvInvalidateTableResult : public TEventPB<TEvInvalidateTableResult, NKikimrTxUserProxy::TEvInvalidateTableResult, EvInvalidateTableResult> {};

struct TEvProposeKqpTransaction : public TEventLocal<TEvProposeKqpTransaction, EvProposeKqpTransaction> {
TActorId ExecuterId;
Expand Down
25 changes: 0 additions & 25 deletions ydb/library/actors/core/event_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,4 @@ namespace NActors {
}
};

template <typename TEv, ui32 TEventType>
class TEventSimple: public TEventBase<TEv, TEventType> {
public:
TString ToStringHeader() const override {
static TString header(TypeName<TEv>());
return header;
}

bool SerializeToArcadiaStream(TChunkSerializer* /*serializer*/) const override {
static_assert(sizeof(TEv) == sizeof(TEventSimple<TEv, TEventType>), "Descendant should be an empty class");
return true;
}

bool IsSerializable() const override {
return true;
}

static IEventBase* Load(NActors::TEventSerializedData*) {
return new TEv();
}

static IEventBase* Load(const TString&) {
return new TEv();
}
};
}

0 comments on commit d116509

Please sign in to comment.