C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
NYT::TTempTable Class Reference

RAII class for working with temporary tables. Constructor of this class creates temporary table and destructor removes it. More...

#include <temp.h>

Public Member Functions

 TTempTable (IClientBasePtr client, const TString &prefix={}, const TYPath &directory={}, const TCreateOptions &options={})
 Constructor creates temporary table.
 TTempTable (const TTempTable &)=delete
TTempTable & operator= (const TTempTable &)=delete
 TTempTable (TTempTable &&) noexcept
TTempTable & operator= (TTempTable &&)
TString Name () const &
 Return full path to the table.
TString Name () &&=delete
TString Release ()
 Release table and return its path. Table will not be deleted by TTempTable destructor after this call.

Static Public Member Functions

static TTempTable CreateAutoremovingTable (IClientBasePtr client, TYPath path, const TCreateOptions &options)
 Create table with given path that will be autoremoved in RAII manner.

Detailed Description

RAII class for working with temporary tables. Constructor of this class creates temporary table and destructor removes it.

CAVEAT: when using with transactions destructor of TTempTable should be called before commiting transaction.

Constructor & Destructor Documentation

◆ TTempTable()

NYT::TTempTable::TTempTable ( IClientBasePtr client,
const TString & prefix = {},
const TYPath & directory = {},
const TCreateOptions & options = {} )
explicit

Constructor creates temporary table.

Parameters
client– YT client or transaction object.
prefix– table name prefix
directory– path to directory where temporary table will be created.
options– options to be passed for table creation (might be useful if we want to set table attributes)

Member Function Documentation

◆ CreateAutoremovingTable()

TTempTable NYT::TTempTable::CreateAutoremovingTable ( IClientBasePtr client,
TYPath path,
const TCreateOptions & options )
static

Create table with given path that will be autoremoved in RAII manner.

In contrast to TTempTable constructor this function uses provided path to table and don't modify it in any manner. It's user responsibility to provide unique path.


The documentation for this class was generated from the following file:
  • yt/cpp/mapreduce/interface/temp.h