Module raftstore::coprocessor::region_info_accessor[][src]

Structs

MockRegionInfoProvider
RegionCollector

RegionCollector is the place where we hold all region information we collected, and the underlying runner of RegionInfoAccessor. It listens on events sent by the RegionEventListener and keeps information of all regions. Role of each region are also tracked.

RegionEventListener

RegionEventListener implements observer traits. It simply send the events that we are interested in through the scheduler.

RegionInfo
RegionInfoAccessor

RegionInfoAccessor keeps all region information separately from raftstore itself.

Enums

RaftStoreEvent

RegionInfoAccessor is used to collect all regions’ information on this TiKV into a collection so that other parts of TiKV can get region information from it. It registers a observer to raftstore, which is named RegionEventListener. When the events that we are interested in happen (such as creating and deleting regions), RegionEventListener simply sends the events through a channel. In the mean time, RegionCollector keeps fetching messages from the channel, and mutates the collection according to the messages. When an accessor method of RegionInfoAccessor is called, it also simply sends a message to RegionCollector, and the result will be sent back through as soon as it’s finished. In fact, the channel mentioned above is actually a util::worker::Worker.

RegionInfoQuery

RegionInfoAccessor has its own thread. Queries and updates are done by sending commands to the thread.

Constants

METRICS_FLUSH_INTERVAL

Traits

RegionInfoProvider

Functions

register_region_event_listener

Creates an RegionEventListener and register it to given coprocessor host.

Type Definitions

Callback
RegionRangesMap
RegionsMap
SeekRegionCallback