/** Data structure that contains the information about shared tablespaces.
Currently this can be the system tablespace or a temporary table tablespace */ class Tablespace {
/** Data file information - each Datafile can be accessed globally */
files_t m_files; /** Data file iterator */ typedef files_t::iterator iterator; /** Data file iterator */ typedef files_t::const_iterator const_iterator;
/** Set the space id of the tablespace
@param[in] space_id tablespace ID to set */ void set_space_id(uint32_t space_id)
{
ut_ad(m_space_id == UINT32_MAX);
m_space_id = space_id;
}
/** Get the space id of the tablespace
@return m_space_id space id of the tablespace */
uint32_t space_id() const { return m_space_id; }
/** Set the tablespace flags
@param[in] fsp_flags tablespace flags */ void set_flags(uint32_t fsp_flags)
{
ut_ad(fil_space_t::is_valid_flags(fsp_flags, false));
m_flags = fsp_flags;
}
/** Get the tablespace flags
@return m_flags tablespace flags */
uint32_t flags() const { return m_flags; }
/** Get the tablespace encryption mode
@return m_mode tablespace encryption mode */
fil_encryption_t encryption_mode() const { return m_mode; }
/** Get the tablespace encryption key_id
@return m_key_id tablespace encryption key_id */
uint32_t key_id() const { return m_key_id; }
/** Set Ignore Read Only Status for tablespace.
@param[in] read_only_status read only status indicator */ void set_ignore_read_only(bool read_only_status)
{
m_ignore_read_only = read_only_status;
}
/** Free the memory allocated by the Tablespace object */ void shutdown();
/** @return the sum of the file sizes of each Datafile */
uint32_t get_sum_of_sizes() const
{
uint32_t sum = 0;
for (const_iterator it = begin(); it != end(); ++it) {
sum += it->m_size;
}
return(sum);
}
/** Open or Create the data files if they do not exist. @param[in]is_tempwhetherthisisatemporarytablespace
@return DB_SUCCESS or error code */
dberr_t open_or_create(bool is_temp)
MY_ATTRIBUTE((warn_unused_result));
/** Delete all the data files. */ void delete_files();
/** Check if two tablespaces have common data file names. @param[in]other_spaceTablespacetocheckagainstthis.
@return true if they have the same data filenames and paths */ bool intersection(const Tablespace* other_space);
/** Use the ADD DATAFILE path to create a Datafile object and add ittothefrontofm_files.Parsethedatafilepathintoapath andabasenamewithextension'ibd'.Thisdatafile_pathprovided maybeanabsoluteorrelativepath,butitmustendwiththe extension.ibdandhaveabasenameofatleast1byte.
Settablespacem_pathmemberandaddaDatafilewiththefilename.
@param[in] datafile_path full path of the tablespace file. */
dberr_t add_datafile( constchar* datafile_path);
/* Return a pointer to the first Datafile for this Tablespace
@return pointer to the first Datafile for this Tablespace*/
Datafile* first_datafile()
{
ut_a(!m_files.empty()); return(&m_files.front());
} private: /** @param[in]filenameNametolookupinthedatafiles.
@return true if the filename exists in the data files */ bool find(constchar* filename) const;
/** Note that the data file was found.
@param[in] file data file object */ void file_found(Datafile& file);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.