|
Ripples 1.0
High Performant Software Architecture For Transaction Processing
|
#include <query.h>
Data Fields | |
| size_t | buf_size |
| char * | a_buf |
| size_t | a_buf_len |
| char * | b_buf |
| size_t | b_buf_len |
| char * | buf |
| size_t | buf_len |
Stucture describes a query log object.
Queries are logged into a buffer. There are two buffers, one is active, while the other one (inactive buffer) is having its data written to disk. This enables us to have no blocking operations (such as writing to disk) in the vectorloop.
Query logging thread uses channels to notify vectorloop thread when it should swap log buffers. Once VL thread swaps buffers, it sends a message back to query logging thread indicating so, which in turn signals the query logging thread that it should log data from VL inactive buffer to disk. Once data is written to disk the process repeats.
Each vectorloop thread has its own set of query log buffers.
Size of each buffer is set by configuration setting query_log_buffer_size.
| char* query_log_s::a_buf |
Buffer A
| size_t query_log_s::a_buf_len |
Length of data in buffer A.
| char* query_log_s::b_buf |
Buffer B
| size_t query_log_s::b_buf_len |
Length of data in buffer B.
| char* query_log_s::buf |
Pointer to active buffer.
| size_t query_log_s::buf_len |
Length of data in active buffer.
| size_t query_log_s::buf_size |
Size (capacity) of buffers.