C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
temp.h
1#pragma once
2
4
5namespace NYT {
6
8
14{
15public:
23 explicit TTempTable(
24 IClientBasePtr client,
25 const TString& prefix = {},
26 const TYPath& directory = {},
27 const TCreateOptions& options = {});
28
29 TTempTable(const TTempTable&) = delete;
30 TTempTable& operator=(const TTempTable&) = delete;
31
32 TTempTable(TTempTable&&) noexcept;
33 TTempTable& operator=(TTempTable&&); // NOLINT Calls RemoveTable() that may throw.
34
35 ~TTempTable();
36
42 static TTempTable CreateAutoremovingTable(IClientBasePtr client, TYPath path, const TCreateOptions& options);
43
45 TString Name() const &;
46 TString Name() && = delete;
47
49 TString Release();
50
51private:
52 struct TPrivateConstuctorTag
53 { };
54 TTempTable(TPrivateConstuctorTag, IClientBasePtr client, TYPath path, const TCreateOptions& options);
55
56private:
57 IClientBasePtr Client_;
58 TYPath Name_;
59 bool Owns_ = true;
60
61private:
62 void RemoveTable();
63};
64
72TYPath CreateTempTable(const IClientBasePtr& client, const TString& prefix, const TYPath& directory, const TCreateOptions& options);
73
75
76} // namespace NYT
TTempTable(IClientBasePtr client, const TString &prefix={}, const TYPath &directory={}, const TCreateOptions &options={})
Constructor creates temporary table.
TString Release()
Release table and return its path. Table will not be deleted by TTempTable destructor after this call...
static TTempTable CreateAutoremovingTable(IClientBasePtr client, TYPath path, const TCreateOptions &options)
Create table with given path that will be autoremoved in RAII manner.
TString Name() const &
Return full path to the table.
Main namespace of YT client.
Definition abortable_stream.h:7
TYPath CreateTempTable(const IClientBasePtr &client, const TString &prefix, const TYPath &directory, const TCreateOptions &options)
Create empty table with unique name in given directory and return its path.
Options for NYT::ICypressClient::Create.
Definition client_method_options.h:126