aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/minikql/computation/mkql_spiller.h
blob: e0ce2706d8e62a38316c52b097f7c4012c878235 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <library/cpp/threading/future/core/future.h>
#include <yql/essentials/utils/chunked_buffer.h>

namespace NKikimr::NMiniKQL {

struct ISpiller
{
    using TPtr = std::shared_ptr<ISpiller>;
    virtual ~ISpiller(){}
    using TKey = ui64;
    virtual NThreading::TFuture<TKey> Put(NYql::TChunkedBuffer&& blob) = 0;

    ///\return
    ///  nullopt for absent keys
    ///  TFuture
    virtual NThreading::TFuture<std::optional<NYql::TChunkedBuffer>> Get(TKey key) = 0;
    virtual NThreading::TFuture<void> Delete(TKey) = 0;
    ///Get + Delete
    ///Stored value may be moved to future
    virtual NThreading::TFuture<std::optional<NYql::TChunkedBuffer>> Extract(TKey key) = 0;
};

}//namespace NKikimr::NMiniKQL