Skip to content

Commit a1750c6

Browse files
authored
dead code elimination (TInFlightGuard) (#14866)
1 parent 499b85e commit a1750c6

File tree

1 file changed

+0
-29
lines changed
  • ydb/core/tx/columnshard/engines/reader/actor

1 file changed

+0
-29
lines changed

ydb/core/tx/columnshard/engines/reader/actor/actor.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,9 @@
77
#include <yql/essentials/core/issue/yql_issue.h>
88

99
namespace NKikimr::NOlap::NReader {
10-
constexpr i64 DEFAULT_READ_AHEAD_BYTES = (i64)2 * 1024 * 1024 * 1024;
1110
constexpr TDuration SCAN_HARD_TIMEOUT = TDuration::Minutes(10);
1211
constexpr TDuration SCAN_HARD_TIMEOUT_GAP = TDuration::Seconds(5);
1312

14-
namespace {
15-
class TInFlightGuard: NNonCopyable::TNonCopyable {
16-
private:
17-
static inline TAtomicCounter InFlightGlobal = 0;
18-
i64 InFlightGuarded = 0;
19-
20-
public:
21-
~TInFlightGuard() {
22-
Return(InFlightGuarded);
23-
}
24-
25-
bool CanTake() {
26-
return InFlightGlobal.Val() < DEFAULT_READ_AHEAD_BYTES || !InFlightGuarded;
27-
}
28-
29-
void Take(const ui64 bytes) {
30-
InFlightGlobal.Add(bytes);
31-
InFlightGuarded += bytes;
32-
}
33-
34-
void Return(const ui64 bytes) {
35-
Y_ABORT_UNLESS(InFlightGlobal.Sub(bytes) >= 0);
36-
InFlightGuarded -= bytes;
37-
Y_ABORT_UNLESS(InFlightGuarded >= 0);
38-
}
39-
};
40-
41-
} // namespace
4213

4314
void TColumnShardScan::PassAway() {
4415
Send(ResourceSubscribeActorId, new TEvents::TEvPoisonPill);

0 commit comments

Comments
 (0)