123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #pragma once
- #include <library/cpp/yt/cpu_clock/clock.h>
- #include <library/cpp/yt/misc/enum.h>
- #include <util/system/types.h>
- #include <util/generic/size_literals.h>
- #include <util/datetime/base.h>
- namespace NYT {
- ////////////////////////////////////////////////////////////////////////////////
- DEFINE_ENUM(EStockpileStrategy,
- ((FixedBreaks) (0))
- ((FlooredLoad) (1))
- ((ProgressiveBackoff) (2))
- );
- ////////////////////////////////////////////////////////////////////////////////
- struct TStockpileOptions
- {
- static constexpr i64 DefaultBufferSize = 4_GBs;
- i64 BufferSize = DefaultBufferSize;
- static constexpr int DefaultThreadCount = 4;
- int ThreadCount = DefaultThreadCount;
- static constexpr EStockpileStrategy DefaultStrategy = EStockpileStrategy::FixedBreaks;
- EStockpileStrategy Strategy = DefaultStrategy;
- static constexpr TDuration DefaultPeriod = TDuration::MilliSeconds(10);
- TDuration Period = DefaultPeriod;
- };
- ////////////////////////////////////////////////////////////////////////////////
- void RunStockpileThread(TStockpileOptions options, std::atomic<bool>* shouldProceed);
- void RunDetachedStockpileThreads(TStockpileOptions options);
- ////////////////////////////////////////////////////////////////////////////////
- } // namespace NYT
|