MySQL 9.0.0
Source Code Documentation
|
#include <handler.h>
Public Member Functions | |
virtual int | file_cbk (Ha_clone_file from_file, uint len)=0 |
Callback providing data from current position of a file descriptor of specific length. More... | |
virtual int | buffer_cbk (uchar *from_buffer, uint len)=0 |
Callback providing data in buffer of specific length. More... | |
virtual int | apply_file_cbk (Ha_clone_file to_file)=0 |
Callback providing a file descriptor to write data starting from current position. More... | |
virtual int | apply_buffer_cbk (uchar *&to_buffer, uint &len)=0 |
Callback to get data in buffer. More... | |
virtual | ~Ha_clone_cbk ()=default |
virtual destructor. More... | |
void | set_hton (handlerton *hton) |
Set current storage engine handlerton. More... | |
handlerton * | get_hton () |
Get current storage engine handlerton. More... | |
void | set_client_buffer_size (uint size) |
Set caller's transfer buffer size. More... | |
uint | get_client_buffer_size () |
Get caller's transfer buffer size. More... | |
void | set_loc_index (uint idx) |
Set current SE index. More... | |
uint | get_loc_index () |
Get current SE index. More... | |
void | set_data_desc (const uchar *desc, uint len) |
Set data descriptor. More... | |
const uchar * | get_data_desc (uint *lenp) |
Get data descriptor. More... | |
const char * | get_source_name () |
Get SE source file name. More... | |
void | set_source_name (const char *name) |
Set SE source file name. More... | |
const char * | get_dest_name () |
Get SE destination file name. More... | |
void | set_dest_name (const char *name) |
Set SE destination file name. More... | |
void | clear_flags () |
Clear all flags set by SE. More... | |
void | set_ack () |
Mark that ACK is needed for the data transfer before returning from callback. More... | |
bool | is_ack_needed () const |
Check if ACK is needed for the data transfer. More... | |
void | set_os_buffer_cache () |
Mark that the file descriptor is opened for read/write with OS buffer cache. More... | |
bool | is_os_buffer_cache () const |
Check if the file descriptor is opened for read/write with OS buffer cache. More... | |
void | set_zero_copy () |
Mark that the file can be transferred with zero copy. More... | |
bool | is_zero_copy () const |
Check if zero copy optimization is suggested. More... | |
void | set_secure () |
Mark that data needs secure transfer. More... | |
bool | is_secure () const |
Check if data needs secure transfer. More... | |
void | mark_state_change (uint64_t estimate) |
Set state information and notify state change. More... | |
bool | is_state_change (uint64_t &estimate) |
Check if SE notified state change. More... | |
Protected Member Functions | |
Ha_clone_cbk () | |
Constructor to initialize members. More... | |
Private Attributes | |
handlerton * | m_hton |
Handlerton for the SE. More... | |
uint | m_loc_idx |
SE index in caller's locator array. More... | |
uint | m_client_buff_size |
Caller's transfer buffer size. More... | |
const uchar * | m_data_desc |
SE's Serialized data descriptor. More... | |
uint | m_desc_len |
SE's Serialized descriptor length. More... | |
const char * | m_src_name |
Current source file name. More... | |
const char * | m_dest_name |
Current destination file name. More... | |
uint64_t | m_state_estimate |
Estimated bytes to be transferred. More... | |
int | m_flag |
Flag storing data related options. More... | |
const int | HA_CLONE_ACK = 0x01 |
Acknowledgement is needed for the data transfer. More... | |
const int | HA_CLONE_FILE_CACHE = 0x02 |
Data file is opened for read/write with OS buffer cache. More... | |
const int | HA_CLONE_ZERO_COPY = 0x04 |
Data file can be transferred with zero copy. More... | |
const int | HA_CLONE_SECURE = 0x08 |
Data needs to be transferred securely over SSL connection. More... | |
const int | HA_CLONE_STATE_CHANGE = 0x10 |
State change notification by SE. More... | |
|
inlineprotected |
Constructor to initialize members.
|
virtualdefault |
virtual destructor.
|
pure virtual |
Callback to get data in buffer.
[out] | to_buffer | data buffer |
[out] | len | data length |
|
pure virtual |
Callback providing a file descriptor to write data starting from current position.
[in] | to_file | destination file to write data |
|
pure virtual |
Callback providing data in buffer of specific length.
[in] | from_buffer | source buffer to read from |
[in] | len | data length |
|
inline |
Clear all flags set by SE.
|
pure virtual |
Callback providing data from current position of a file descriptor of specific length.
[in] | from_file | source file to read from |
[in] | len | data length |
|
inline |
Get caller's transfer buffer size.
|
inline |
Get data descriptor.
SE specific descriptor for the data transferred by the callbacks.
[out] | lenp | length of the descriptor byte stream |
|
inline |
Get SE destination file name.
Used for debug printing and error message.
|
inline |
Get current storage engine handlerton.
|
inline |
Get current SE index.
|
inline |
Get SE source file name.
Used for debug printing and error message.
|
inline |
Check if ACK is needed for the data transfer.
|
inline |
Check if the file descriptor is opened for read/write with OS buffer cache.
Currently clone avoids using zero copy (sendfile on linux), if SE is using O_DIRECT. This improves data copy performance.
|
inline |
Check if data needs secure transfer.
|
inline |
Check if SE notified state change.
|
inline |
Check if zero copy optimization is suggested.
|
inline |
Set state information and notify state change.
[in] | estimate | estimated bytes for current state. |
|
inline |
Mark that ACK is needed for the data transfer before returning from callback.
Set by SE.
|
inline |
Set caller's transfer buffer size.
SE can adjust the data chunk size based on this parameter.
[in] | size | buffer size in bytes |
|
inline |
Set data descriptor.
SE specific descriptor for the data transferred by the callbacks.
[in] | desc | serialized data descriptor |
[in] | len | length of the descriptor byte stream |
|
inline |
Set SE destination file name.
[in] | name | null terminated string for destination file name |
|
inline |
Set current storage engine handlerton.
[in] | hton | SE handlerton |
|
inline |
Set current SE index.
[in] | idx | SE index in locator array |
|
inline |
Mark that the file descriptor is opened for read/write with OS buffer cache.
For O_DIRECT, the flag is not set.
|
inline |
Mark that data needs secure transfer.
|
inline |
Set SE source file name.
[in] | name | null terminated string for source file name |
|
inline |
Mark that the file can be transferred with zero copy.
|
private |
Acknowledgement is needed for the data transfer.
|
private |
Data file is opened for read/write with OS buffer cache.
|
private |
Data needs to be transferred securely over SSL connection.
|
private |
State change notification by SE.
|
private |
Data file can be transferred with zero copy.
|
private |
Caller's transfer buffer size.
|
private |
SE's Serialized data descriptor.
|
private |
SE's Serialized descriptor length.
|
private |
Current destination file name.
|
private |
Flag storing data related options.
|
private |
Handlerton for the SE.
|
private |
SE index in caller's locator array.
|
private |
Current source file name.
|
private |
Estimated bytes to be transferred.