mkql_spiller.h 736 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <library/cpp/threading/future/core/future.h>
  3. #include <yql/essentials/utils/chunked_buffer.h>
  4. namespace NKikimr::NMiniKQL {
  5. struct ISpiller
  6. {
  7. using TPtr = std::shared_ptr<ISpiller>;
  8. virtual ~ISpiller(){}
  9. using TKey = ui64;
  10. virtual NThreading::TFuture<TKey> Put(NYql::TChunkedBuffer&& blob) = 0;
  11. ///\return
  12. /// nullopt for absent keys
  13. /// TFuture
  14. virtual NThreading::TFuture<std::optional<NYql::TChunkedBuffer>> Get(TKey key) = 0;
  15. virtual NThreading::TFuture<void> Delete(TKey) = 0;
  16. ///Get + Delete
  17. ///Stored value may be moved to future
  18. virtual NThreading::TFuture<std::optional<NYql::TChunkedBuffer>> Extract(TKey key) = 0;
  19. };
  20. }//namespace NKikimr::NMiniKQL