transaction_pinger.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <yt/cpp/mapreduce/common/fwd.h>
  3. #include <yt/cpp/mapreduce/http/requests.h>
  4. #include <util/generic/ptr.h>
  5. #include <util/system/thread.h>
  6. namespace NYT {
  7. ////////////////////////////////////////////////////////////////////////////////
  8. class TPingableTransaction;
  9. ////////////////////////////////////////////////////////////////////////////////
  10. // Each registered transaction must be removed from pinger
  11. // (using RemoveTransaction) before it is destroyed
  12. class ITransactionPinger
  13. : public TThrRefBase
  14. {
  15. public:
  16. virtual ~ITransactionPinger() = default;
  17. virtual ITransactionPingerPtr GetChildTxPinger() = 0;
  18. virtual void RegisterTransaction(const TPingableTransaction& pingableTx) = 0;
  19. virtual bool HasTransaction(const TPingableTransaction& pingableTx) = 0;
  20. virtual void RemoveTransaction(const TPingableTransaction& pingableTx) = 0;
  21. };
  22. ITransactionPingerPtr CreateTransactionPinger(const TConfigPtr& config);
  23. ////////////////////////////////////////////////////////////////////////////////
  24. } // namespace NYT