1
1
#include " blobstorage.h"
2
- #include < ydb/library/actors/wilson/wilson_span.h>
3
- #include < ydb/library/wilson_ids/wilson.h>
4
2
5
3
namespace NKikimr {
6
4
@@ -46,49 +44,13 @@ bool operator<(const TPDiskCategory x, const TPDiskCategory y) {
46
44
return std::make_tuple (x.Type (), x.Kind ()) < std::make_tuple (y.Type (), y.Kind ());
47
45
}
48
46
49
- void TEvBlobStorage::TEvPut::ToSpan (NWilson::TSpan& span) const {
50
- span
51
- .Attribute (" Id" , Id.ToString ())
52
- .Attribute (" PutHandleClass" , NKikimrBlobStorage::EPutHandleClass_Name (HandleClass));
53
- }
54
-
55
47
std::unique_ptr<TEvBlobStorage::TEvPutResult> TEvBlobStorage::TEvPut::MakeErrorResponse (
56
48
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId groupId) {
57
49
auto res = std::make_unique<TEvPutResult>(status, Id, TStorageStatusFlags (), groupId, 0 .0f );
58
50
res->ErrorReason = errorReason;
59
51
return res;
60
52
}
61
53
62
- void TEvBlobStorage::TEvGet::ToSpan (NWilson::TSpan& span) const {
63
- i64 totalSize = 0 ;
64
- for (ui32 i = 0 ; i < QuerySize; ++i) {
65
- const auto & q = Queries[i];
66
- if (q.Shift < q.Id .BlobSize ()) {
67
- totalSize += Min<size_t >(q.Id .BlobSize () - q.Shift , q.Size ? q.Size : Max<size_t >());
68
- }
69
- }
70
-
71
- span
72
- .Attribute (" TotalSize" , totalSize)
73
- .Attribute (" GetHandleClass" , NKikimrBlobStorage::EGetHandleClass_Name (GetHandleClass))
74
- .Attribute (" MustRestoreFirst" , MustRestoreFirst)
75
- .Attribute (" IsIndexOnly" , IsIndexOnly);
76
-
77
- if (span.GetTraceId ().GetVerbosity () >= TWilson::DsProxyInternals) {
78
- NWilson::TArrayValue queries;
79
- queries.reserve (QuerySize);
80
- for (ui32 i = 0 ; i < QuerySize; ++i) {
81
- const auto & q = Queries[i];
82
- queries.emplace_back (NWilson::TKeyValueList{{
83
- {" Id" , q.Id .ToString ()},
84
- {" Shift" , q.Shift },
85
- {" Size" , q.Size },
86
- }});
87
- }
88
- span.Attribute (" Queries" , std::move (queries));
89
- }
90
- }
91
-
92
54
std::unique_ptr<TEvBlobStorage::TEvGetResult> TEvBlobStorage::TEvGet::MakeErrorResponse (
93
55
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId groupId) {
94
56
auto res = std::make_unique<TEvGetResult>(status, QuerySize, groupId);
@@ -105,128 +67,55 @@ std::unique_ptr<TEvBlobStorage::TEvGetResult> TEvBlobStorage::TEvGet::MakeErrorR
105
67
return res;
106
68
}
107
69
108
- void TEvBlobStorage::TEvBlock::ToSpan (NWilson::TSpan& span) const {
109
- span
110
- .Attribute (" TabletId" , ::ToString (TabletId))
111
- .Attribute (" Generation" , Generation);
112
- }
113
-
114
70
std::unique_ptr<TEvBlobStorage::TEvBlockResult> TEvBlobStorage::TEvBlock::MakeErrorResponse (
115
71
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId /* groupId*/ ) {
116
72
auto res = std::make_unique<TEvBlockResult>(status);
117
73
res->ErrorReason = errorReason;
118
74
return res;
119
75
}
120
76
121
- void TEvBlobStorage::TEvPatch::ToSpan (NWilson::TSpan& span) const {
122
- span
123
- .Attribute (" OriginalGroupId" , OriginalGroupId)
124
- .Attribute (" OriginalId" , OriginalId.ToString ())
125
- .Attribute (" PatchedId" , PatchedId.ToString ());
126
- }
127
-
128
77
std::unique_ptr<TEvBlobStorage::TEvPatchResult> TEvBlobStorage::TEvPatch::MakeErrorResponse (
129
78
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId groupId) {
130
79
auto res = std::make_unique<TEvPatchResult>(status, PatchedId, TStorageStatusFlags (), groupId, 0 .0f );
131
80
res->ErrorReason = errorReason;
132
81
return res;
133
82
}
134
83
135
- void TEvBlobStorage::TEvInplacePatch::ToSpan (NWilson::TSpan& /* span*/ ) const {
136
- }
137
-
138
84
std::unique_ptr<TEvBlobStorage::TEvInplacePatchResult> TEvBlobStorage::TEvInplacePatch::MakeErrorResponse (
139
85
NKikimrProto::EReplyStatus status, const TString& errorReason) {
140
86
auto res = std::make_unique<TEvInplacePatchResult>(status, PatchedId, TStorageStatusFlags (), 0 .0f );
141
87
res->ErrorReason = errorReason;
142
88
return res;
143
89
}
144
90
145
- void TEvBlobStorage::TEvDiscover::ToSpan (NWilson::TSpan& span) const {
146
- span
147
- .Attribute (" TabletId" , ::ToString (TabletId))
148
- .Attribute (" ReadBody" , ReadBody);
149
- }
150
-
151
91
std::unique_ptr<TEvBlobStorage::TEvDiscoverResult> TEvBlobStorage::TEvDiscover::MakeErrorResponse (
152
92
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId/* groupId*/ ) {
153
93
auto res = std::make_unique<TEvDiscoverResult>(status, MinGeneration, 0 );
154
94
res->ErrorReason = errorReason;
155
95
return res;
156
96
}
157
97
158
- void TEvBlobStorage::TEvRange::ToSpan (NWilson::TSpan& span) const {
159
- span
160
- .Attribute (" TabletId" , ::ToString (TabletId))
161
- .Attribute (" From" , From.ToString ())
162
- .Attribute (" To" , To.ToString ())
163
- .Attribute (" MustRestoreFirst" , MustRestoreFirst)
164
- .Attribute (" IsIndexOnly" , IsIndexOnly);
165
- }
166
-
167
98
std::unique_ptr<TEvBlobStorage::TEvRangeResult> TEvBlobStorage::TEvRange::MakeErrorResponse (
168
99
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId groupId) {
169
100
auto res = std::make_unique<TEvRangeResult>(status, From, To, groupId);
170
101
res->ErrorReason = errorReason;
171
102
return res;
172
103
}
173
104
174
- void TEvBlobStorage::TEvCollectGarbage::ToSpan (NWilson::TSpan& span) const {
175
- span
176
- .Attribute (" TabletId" , ::ToString (TabletId))
177
- .Attribute (" RecordGeneration" , RecordGeneration)
178
- .Attribute (" PerGenerationCounter" , PerGenerationCounter)
179
- .Attribute (" Channel" , Channel);
180
-
181
- if (Collect) {
182
- span
183
- .Attribute (" CollectGeneration" , CollectGeneration)
184
- .Attribute (" CollectStep" , CollectStep);
185
- }
186
-
187
- if (span.GetTraceId ().GetVerbosity () >= TWilson::DsProxyInternals) {
188
- auto vector = [&](const auto & name, const auto & v) {
189
- if (v) {
190
- NWilson::TArrayValue items;
191
- items.reserve (v->size ());
192
- for (const TLogoBlobID& id : *v) {
193
- items.emplace_back (id.ToString ());
194
- }
195
- span.Attribute (name, std::move (items));
196
- }
197
- };
198
- vector (" Keep" , Keep);
199
- vector (" DoNotKeep" , DoNotKeep);
200
- } else {
201
- if (Keep) {
202
- span.Attribute (" NumKeep" , static_cast <i64 >(Keep->size ()));
203
- }
204
- if (DoNotKeep) {
205
- span.Attribute (" NumDoNotKeep" , static_cast <i64 >(DoNotKeep->size ()));
206
- }
207
- }
208
- }
209
-
210
105
std::unique_ptr<TEvBlobStorage::TEvCollectGarbageResult> TEvBlobStorage::TEvCollectGarbage::MakeErrorResponse (
211
106
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId /* groupId*/ ) {
212
107
auto res = std::make_unique<TEvCollectGarbageResult>(status, TabletId, RecordGeneration, PerGenerationCounter, Channel);
213
108
res->ErrorReason = errorReason;
214
109
return res;
215
110
}
216
111
217
- void TEvBlobStorage::TEvStatus::ToSpan (NWilson::TSpan& /* span*/ ) const
218
- {}
219
-
220
112
std::unique_ptr<TEvBlobStorage::TEvStatusResult> TEvBlobStorage::TEvStatus::MakeErrorResponse (
221
113
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId /* groupId*/ ) {
222
114
auto res = std::make_unique<TEvStatusResult>(status, TStorageStatusFlags ());
223
115
res->ErrorReason = errorReason;
224
116
return res;
225
117
}
226
118
227
- void TEvBlobStorage::TEvAssimilate::ToSpan (NWilson::TSpan& /* span*/ ) const
228
- {}
229
-
230
119
std::unique_ptr<TEvBlobStorage::TEvAssimilateResult> TEvBlobStorage::TEvAssimilate::MakeErrorResponse (
231
120
NKikimrProto::EReplyStatus status, const TString& errorReason, TGroupId/* groupId*/ ) {
232
121
return std::make_unique<TEvBlobStorage::TEvAssimilateResult>(status, errorReason);
0 commit comments