MySQL 8.0.32
Source Code Documentation
Persister Class Referenceabstract

Interface for persistent dynamic table metadata. More...

#include <dict0mem.h>

Inheritance diagram for Persister:
[legend]

Public Member Functions

virtual ~Persister ()=default
 Virtual destructor. More...
 
virtual ulint write (const PersistentTableMetadata &metadata, byte *buffer, ulint size) const =0
 Write the dynamic metadata of a table, we can pre-calculate the size by calling get_write_size() More...
 
virtual ulint get_write_size (const PersistentTableMetadata &metadata) const =0
 Pre-calculate the size of metadata to be written. More...
 
virtual ulint read (PersistentTableMetadata &metadata, const byte *buffer, ulint size, bool *corrupt) const =0
 Read the dynamic metadata from buffer, and store them to metadata object. More...
 
void write_log (table_id_t id, const PersistentTableMetadata &metadata, mtr_t *mtr) const
 Write MLOG_TABLE_DYNAMIC_META for persistent dynamic metadata of table. More...
 

Detailed Description

Interface for persistent dynamic table metadata.

Constructor & Destructor Documentation

◆ ~Persister()

virtual Persister::~Persister ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ get_write_size()

virtual ulint Persister::get_write_size ( const PersistentTableMetadata metadata) const
pure virtual

Pre-calculate the size of metadata to be written.

Parameters
[in]metadatametadata to be written
Returns
the size of metadata

Implemented in CorruptedIndexPersister, and AutoIncPersister.

◆ read()

virtual ulint Persister::read ( PersistentTableMetadata metadata,
const byte buffer,
ulint  size,
bool *  corrupt 
) const
pure virtual

Read the dynamic metadata from buffer, and store them to metadata object.

Parameters
[out]metadatametadata where we store the read data
[in]bufferbuffer to read
[in]sizesize of buffer
[out]corrupttrue if we found something wrong in the buffer except incomplete buffer, otherwise false
Returns
the bytes we read from the buffer if the buffer data is complete and we get everything, 0 if the buffer is incompleted

Implemented in CorruptedIndexPersister, and AutoIncPersister.

◆ write()

virtual ulint Persister::write ( const PersistentTableMetadata metadata,
byte buffer,
ulint  size 
) const
pure virtual

Write the dynamic metadata of a table, we can pre-calculate the size by calling get_write_size()

Parameters
[in]metadatapersistent data
[out]bufferwrite buffer
[in]sizesize of write buffer, should be at least get_write_size()
Returns
the length of bytes written

Implemented in CorruptedIndexPersister, and AutoIncPersister.

◆ write_log()

void Persister::write_log ( table_id_t  id,
const PersistentTableMetadata metadata,
mtr_t mtr 
) const

Write MLOG_TABLE_DYNAMIC_META for persistent dynamic metadata of table.

Parameters
[in]idTable id
[in]metadataMetadata used to write the log
[in,out]mtrMini-transaction

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