33#ifndef row0pread_adapter_h
34#define row0pread_adapter_h
Parallel reader execution context.
Definition: row0pread.h:680
Traverse an index in the leaf page block list order and send records to adapter.
Definition: row0pread-adapter.h:43
uint64_t m_batch_size
Number of records to be sent across to the caller in a batch.
Definition: row0pread-adapter.h:150
Parallel_reader_adapter(size_t max_threads, ulint rowlen)
Constructor.
Definition: row0pread-adapter.cc:39
dberr_t process_rows(const Parallel_reader::Ctx *reader_ctx)
Convert the record in InnoDB format to MySQL format and send them.
Definition: row0pread-adapter.cc:172
size_t pending(Thread_ctx *ctx) const
Get the number of rows buffered but not sent.
Definition: row0pread-adapter.h:121
dberr_t end(Parallel_reader::Thread_ctx *reader_thread_ctx)
Each parallel reader thread's end function.
Definition: row0pread-adapter.cc:245
Init_fn m_init_fn
Callback called by each parallel load thread at the beginning of the parallel load for the scan.
Definition: row0pread-adapter.h:139
void set(row_prebuilt_t *prebuilt)
Set up the query processing state cache.
Definition: row0pread-adapter.cc:55
bool is_buffer_full(Thread_ctx *ctx) const
Check if the buffer is full.
Definition: row0pread-adapter.h:128
~Parallel_reader_adapter()=default
Destructor.
handler::Load_init_cbk Init_fn
Definition: row0pread-adapter.h:55
row_prebuilt_t * m_prebuilt
Prebuilt to use for conversion to MySQL row format.
Definition: row0pread-adapter.h:205
Load_fn m_load_fn
Callback called by each parallel load thread when processing of rows is required for the scan.
Definition: row0pread-adapter.h:143
handler::Load_end_cbk End_fn
Definition: row0pread-adapter.h:53
handler::Load_cbk Load_fn
Definition: row0pread-adapter.h:51
dberr_t send_batch(Parallel_reader::Thread_ctx *reader_thread_ctx, size_t partition_id, uint64_t n_recs)
Send a batch of records.
Definition: row0pread-adapter.cc:147
dberr_t init(Parallel_reader::Thread_ctx *reader_thread_ctx, row_prebuilt_t *prebuilt)
Each parallel reader thread's init function.
Definition: row0pread-adapter.cc:113
Parallel_reader m_parallel_reader
Parallel reader to use.
Definition: row0pread-adapter.h:208
static constexpr size_t ADAPTER_SEND_BUFFER_SIZE
Size of the buffer used to store InnoDB records and sent to the adapter.
Definition: row0pread-adapter.h:45
MySQL_row m_mysql_row
Row meta data per scan context.
Definition: row0pread-adapter.h:170
dberr_t run(void **thread_contexts, Init_fn init_fn, Load_fn load_fn, End_fn end_fn)
Run the parallel scan.
Definition: row0pread-adapter.cc:101
void ** m_thread_ctxs
Adapter context for each of the spawned threads.
Definition: row0pread-adapter.h:135
End_fn m_end_fn
Callback called by each parallel load thread when processing of rows has ended for the scan.
Definition: row0pread-adapter.h:147
dberr_t add_scan(trx_t *trx, const Parallel_reader::Config &config, Parallel_reader::F &&f)
Add scan context.
Definition: row0pread-adapter.cc:45
The core idea is to find the left and right paths down the B+Tree.These paths correspond to the scan ...
Definition: row0pread.h:101
std::function< dberr_t(const Ctx *)> F
Callback to process the rows.
Definition: row0pread.h:143
std::function< void(void *cookie)> Load_end_cbk
This callback is called by each parallel load thread when processing of rows has ended for the adapte...
Definition: handler.h:4869
std::function< bool(void *cookie, ulong ncols, ulong row_len, const ulong *col_offsets, const ulong *null_byte_offsets, const ulong *null_bitmasks)> Load_init_cbk
This callback is called by each parallel load thread at the beginning of the parallel load for the ad...
Definition: handler.h:4847
std::function< bool(void *cookie, uint nrows, void *rowdata, uint64_t partition_id)> Load_cbk
This callback is called by each parallel load thread when processing of rows is required for the adap...
Definition: handler.h:4862
dberr_t
Definition: db0err.h:39
TempTable public handler API declaration.
Scan (Scan_ctx) configuration.
Definition: row0pread.h:171
Thread related context information.
Definition: row0pread.h:215
MySQL row meta data.
Definition: row0pread-adapter.h:153
ulong m_max_len
Maximum row length.
Definition: row0pread-adapter.h:166
std::vector< ulong, ut::allocator< ulong > > Column_meta_data
Definition: row0pread-adapter.h:154
Column_meta_data m_null_bit_mask
Column null bit masks.
Definition: row0pread-adapter.h:160
Column_meta_data m_offsets
Column offsets.
Definition: row0pread-adapter.h:157
Column_meta_data m_null_bit_offsets
Column null bit offsets.
Definition: row0pread-adapter.h:163
Callback thread context for each of the spawned threads.
Definition: row0pread-adapter.h:173
size_t m_n_sent
Number of records sent to the adapter.
Definition: row0pread-adapter.h:184
Thread_ctx()
Constructor.
Definition: row0pread-adapter.cc:51
size_t m_n_read
Number of records read.
Definition: row0pread-adapter.h:181
std::vector< byte, ut::allocator< byte > > m_buffer
Buffer to store records to be sent to the adapter.
Definition: row0pread-adapter.h:191
size_t m_partition_id
Partition ID for the records in buffer.
Definition: row0pread-adapter.h:188
~Thread_ctx()=default
Destructor.
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; th...
Definition: row0mysql.h:515
Definition: trx0trx.h:675
unsigned long int ulint
Definition: univ.i:406