4
4
#include " tablet_flat_executor.h"
5
5
#include " flat_sausagecache.h"
6
6
7
+ #include < util/generic/intrlist.h>
7
8
#include < util/generic/ptr.h>
8
9
#include < util/system/hp_timer.h>
9
10
#include < ydb/library/actors/wilson/wilson_span.h>
12
13
namespace NKikimr {
13
14
namespace NTabletFlatExecutor {
14
15
15
- struct TSeat {
16
+ enum class ESeatState {
17
+ None,
18
+ Pending,
19
+ Active,
20
+ ActiveLow,
21
+ Postponed,
22
+ Waiting,
23
+ Done,
24
+ };
25
+
26
+ struct TSeat : public TIntrusiveListItem <TSeat> {
16
27
using TPinned = THashMap<TLogoBlobID, THashMap<ui32, TIntrusivePtr<TPrivatePageCachePinPad>>>;
17
28
18
29
TSeat (const TSeat&) = delete ;
@@ -30,9 +41,11 @@ namespace NTabletFlatExecutor {
30
41
out << " }" ;
31
42
}
32
43
33
- void Complete (const TActorContext& ctx, bool isRW) noexcept ;
44
+ bool IsTerminated () const {
45
+ return TerminationReason != ETerminationReason::None;
46
+ }
34
47
35
- void Terminate (ETerminationReason reason, const TActorContext& ctx) noexcept ;
48
+ void Complete ( const TActorContext& ctx, bool isRW ) noexcept ;
36
49
37
50
void StartEnqueuedSpan () noexcept {
38
51
WaitingSpan = NWilson::TSpan (TWilsonTablet::TabletDetailed, Self->TxSpan .GetTraceId (), " Tablet.Transaction.Enqueued" );
@@ -54,7 +67,7 @@ namespace NTabletFlatExecutor {
54
67
return Self->TxSpan .GetTraceId ();
55
68
}
56
69
57
- const ui64 UniqID = Max<ui64>() ;
70
+ const ui64 UniqID;
58
71
const TAutoPtr<ITransaction> Self;
59
72
NWilson::TSpan WaitingSpan;
60
73
ui64 Retries = 0 ;
@@ -74,6 +87,10 @@ namespace NTabletFlatExecutor {
74
87
ui32 NotEnoughMemoryCount = 0 ;
75
88
ui64 TaskId = 0 ;
76
89
90
+ ESeatState State = ESeatState::Done;
91
+ bool LowPriority = false ;
92
+ bool Cancelled = false ;
93
+
77
94
TAutoPtr<TMemoryToken> AttachedMemory;
78
95
TIntrusivePtr<TMemoryGCToken> CapturedMemory;
79
96
TVector<std::function<void ()>> OnPersistent;
0 commit comments