@@ -150,6 +150,7 @@ size_t AdjustLen(std::span<const TConstIoVec> wbuf, std::span<const TOutgoingStr
150
150
}
151
151
152
152
void TInterconnectZcProcessor::DoProcessNotification (NInterconnect::TStreamSocket& socket) {
153
+ #ifdef YDB_MSG_ZEROCOPY_SUPPORTED
153
154
const TProcessErrQueueResult res = DoProcessErrQueue (socket);
154
155
155
156
std::visit (TOverloaded{
@@ -177,6 +178,9 @@ void TInterconnectZcProcessor::DoProcessNotification(NInterconnect::TStreamSocke
177
178
AddErr (" Hidden copy during ZC operation" );
178
179
ZcState = ZC_DISABLED_HIDDEN_COPY;
179
180
}
181
+ #else
182
+ Y_UNUSED (socket);
183
+ #endif
180
184
}
181
185
182
186
void TInterconnectZcProcessor::ApplySocketOption (NInterconnect::TStreamSocket& socket)
@@ -191,6 +195,8 @@ void TInterconnectZcProcessor::ApplySocketOption(NInterconnect::TStreamSocket& s
191
195
ResetState ();
192
196
}
193
197
}
198
+ #else
199
+ Y_UNUSED (socket);
194
200
#endif
195
201
}
196
202
@@ -264,10 +270,6 @@ ssize_t TInterconnectZcProcessor::ProcessSend(std::span<TConstIoVec> wbuf, TStre
264
270
return r;
265
271
}
266
272
267
- TInterconnectZcProcessor::TInterconnectZcProcessor (bool enabled)
268
- : ZcState(enabled ? ZC_OK : ZC_DISABLED)
269
- {}
270
-
271
273
TString TInterconnectZcProcessor::GetCurrentStateName () const {
272
274
switch (ZcState) {
273
275
case ZC_DISABLED:
@@ -293,8 +295,23 @@ TString TInterconnectZcProcessor::ExtractErrText() {
293
295
}
294
296
}
295
297
298
+ void TInterconnectZcProcessor::AddErr (const TString& err) {
299
+ if (LastErr) {
300
+ LastErr.reserve (err.size () + 2 );
301
+ LastErr += " , " ;
302
+ LastErr += err;
303
+ } else {
304
+ LastErr = err;
305
+ }
306
+ }
307
+
296
308
// /////////////////////////////////////////////////////////////////////////////
297
309
310
+ #ifdef YDB_MSG_ZEROCOPY_SUPPORTED
311
+ TInterconnectZcProcessor::TInterconnectZcProcessor (bool enabled)
312
+ : ZcState(enabled ? ZC_OK : ZC_DISABLED)
313
+ {}
314
+
298
315
// Guard part.
299
316
// We must guarantee liveness of buffers used for zc
300
317
// until enqueued zc operation completed by kernel
@@ -399,20 +416,33 @@ class TGuardRunner : public IZcGuard {
399
416
std::list<TEventHolder> Delayed;
400
417
};
401
418
402
- void TInterconnectZcProcessor::AddErr (const TString& err) {
403
- if (LastErr) {
404
- LastErr.reserve (err.size () + 2 );
405
- LastErr += " , " ;
406
- LastErr += err;
407
- } else {
408
- LastErr = err;
409
- }
419
+ std::unique_ptr<IZcGuard> TInterconnectZcProcessor::GetGuard ()
420
+ {
421
+ return std::make_unique<TGuardRunner>(SendAsZc, Confirmed);
410
422
}
411
423
424
+ #else
425
+ TInterconnectZcProcessor::TInterconnectZcProcessor (bool )
426
+ : ZcState(ZC_DISABLED)
427
+ {}
428
+
429
+ class TDummyGuardRunner : public IZcGuard {
430
+ public:
431
+ TDummyGuardRunner (ui64 uncompleted, ui64 confirmed)
432
+ {
433
+ Y_UNUSED (uncompleted);
434
+ Y_UNUSED (confirmed);
435
+ }
436
+
437
+ void ExtractToSafeTermination (std::list<TEventHolder>&) noexcept override {}
438
+ void Terminate (std::unique_ptr<NActors::TEventHolderPool>&&, TIntrusivePtr<NInterconnect::TStreamSocket>, const NActors::TActorContext&) override {}
439
+ };
412
440
413
441
std::unique_ptr<IZcGuard> TInterconnectZcProcessor::GetGuard ()
414
442
{
415
- return std::make_unique<TGuardRunner >(SendAsZc, Confirmed);
443
+ return std::make_unique<TDummyGuardRunner >(SendAsZc, Confirmed);
416
444
}
417
445
446
+ #endif
447
+
418
448
}
0 commit comments