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:

  1. Parse the request into a DAG request, Checksum request or Analyze request.
  2. Retrieve a snapshot from the underlying engine according to the given timestamp.
  3. Build corresponding request handlers from the snapshot and request detail.
  4. Run request handlers once (for unary requests) or multiple times (for streaming requests) on a future thread pool.
  5. 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 kvrpcpb::Context to provide some extra properties.

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