OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser::DumpTableStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::DumpTableStmt:
+ Collaboration diagram for Parser::DumpTableStmt:

Public Member Functions

 DumpTableStmt (std::string *tab, std::string *path, std::list< NameValueAssign * > *options)
 DumpTableStmt (const rapidjson::Value &payload)
void execute (const Catalog_Namespace::SessionInfo &session, bool read_only_mode) override
- Public Member Functions inherited from Parser::DumpRestoreTableStmtBase
 DumpRestoreTableStmtBase (std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
 DumpRestoreTableStmtBase (const rapidjson::Value &payload, const bool is_restore)
CompressionType defaultCompression (bool is_restore)
CompressionType validateCompression (const std::string &compression, const bool is_restore)
std::string tarCompressionStr (CompressionType compression, const bool is_restore)
const std::string * getTable () const
const std::string * getPath () const
const CompressionType getCompression () const
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
- Public Member Functions inherited from Parser::Node
virtual ~Node ()

Additional Inherited Members

- Public Types inherited from Parser::DumpRestoreTableStmtBase
enum  CompressionType { CompressionType::kGZIP, CompressionType::kLZ4, CompressionType::kNONE }
- Protected Attributes inherited from Parser::DumpRestoreTableStmtBase
std::unique_ptr< std::string > table_
std::unique_ptr< std::string > path_
CompressionType compression_

Detailed Description

Definition at line 1489 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::DumpTableStmt::DumpTableStmt ( std::string *  tab,
std::string *  path,
std::list< NameValueAssign * > *  options 

Definition at line 1491 of file ParserNode.h.

1492  : DumpRestoreTableStmtBase(tab, path, options, false) {}
DumpRestoreTableStmtBase(std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
Definition: ParserNode.h:1426
Parser::DumpTableStmt::DumpTableStmt ( const rapidjson::Value &  payload)

Definition at line 6792 of file ParserNode.cpp.

6793  : DumpRestoreTableStmtBase(payload, false) {}
DumpRestoreTableStmtBase(std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
Definition: ParserNode.h:1426

Member Function Documentation

void Parser::DumpTableStmt::execute ( const Catalog_Namespace::SessionInfo session,
bool  read_only_mode 

Implements Parser::DDLStmt.

Definition at line 6795 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::checkDBAccessPrivileges(), Parser::DumpRestoreTableStmtBase::compression_, AccessPrivileges::CREATE_TABLE, TableArchiver::dumpTable(), legacylockmgr::ExecutorOuterLock, Catalog_Namespace::SessionInfo::getCatalog(), legacylockmgr::LockMgr< MutexType, KeyType >::getMutex(), lockmgr::TableLockMgrImpl< TableSchemaLockMgr >::getReadLockForTable(), Parser::DumpRestoreTableStmtBase::path_, AccessPrivileges::SELECT_FROM_TABLE, Parser::DumpRestoreTableStmtBase::table_, TableDBObjectType, and Parser::DumpRestoreTableStmtBase::tarCompressionStr().

Referenced by heavydb.cursor.Cursor::executemany().

6796  {
6797  // valid in read_only_mode
6798  const auto execute_read_lock =
6803  auto& catalog = session.getCatalog();
6804  // Prevent modification of the table schema during a dump operation, while allowing
6805  // concurrent inserts.
6806  auto table_read_lock =
6809  // check access privileges
6812  *table_)) {
6813  throw std::runtime_error("Table " + *table_ +
6814  " will not be dumped. User has no select privileges.");
6815  }
6818  throw std::runtime_error("Table " + *table_ +
6819  " will not be dumped. User has no create privileges.");
6820  }
6821  const TableDescriptor* td = catalog.getMetadataForTable(*table_);
6822  TableArchiver table_archiver(&catalog);
6823  table_archiver.dumpTable(td, *path_, tarCompressionStr(compression_, false));
6824 }
static std::shared_ptr< WrapperType< MutexType > > getMutex(const LockType lockType, const KeyType &key)
std::string tarCompressionStr(CompressionType compression, const bool is_restore)
static const AccessPrivileges SELECT_FROM_TABLE
Definition: DBObject.h:160
std::shared_lock< T > shared_lock
std::unique_ptr< std::string > table_
Definition: ParserNode.h:1484
static const AccessPrivileges CREATE_TABLE
Definition: DBObject.h:158
std::unique_ptr< std::string > path_
Definition: ParserNode.h:1485
Catalog & getCatalog() const
Definition: SessionInfo.h:65
static ReadLock getReadLockForTable(Catalog_Namespace::Catalog &cat, const std::string &table_name)
Definition: LockMgrImpl.h:243
bool checkDBAccessPrivileges(const DBObjectType &permissionType, const AccessPrivileges &privs, const std::string &objectName="") const
Definition: SessionInfo.cpp:24

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: