Module tikv::coprocessor [−][src]
Handles simple SQL query executors locally.
Most TiDB read queries are processed by Coprocessor instead of KV interface. By doing so, the CPU of TiKV nodes can be utilized for computing and the amount of data to transfer can be reduced (i.e. filtered at TiKV side).
Notice that Coprocessor handles more than simple SQL query executors (DAG request). It also handles analyzing requests and checksum requests.
The entry point of handling all coprocessor requests is Endpoint. Common steps are:
- Parse the request into a DAG request, Checksum request or Analyze request.
- Retrieve a snapshot from the underlying engine according to the given timestamp.
- Build corresponding request handlers from the snapshot and request detail.
- Run request handlers once (for unary requests) or multiple times (for streaming requests) on a future thread pool.
- Return handling result as a response.
Please refer to Endpoint for more details.
Modules
| cache | |
| checksum | |
| dag | |
| endpoint | |
| error | |
| interceptors | |
| metrics | |
| readpool_impl | |
| statistics | |
| tracker |
Structs
| Endpoint | A pool to build and run Coprocessor request handlers. |
| ReqContext | Encapsulate the |
Enums
| Error |
Constants
| REQ_TYPE_ANALYZE | |
| REQ_TYPE_CHECKSUM | |
| REQ_TYPE_DAG |
Traits
| RequestHandler | An interface for all kind of Coprocessor request handlers. |
Functions
| checksum_crc64_xor |
Type Definitions
| HandlerStreamStepResult | |
| RequestHandlerBuilder | |
| Result |