Documentation ¶
Index ¶
- Constants
- func ExtractTableAndPartitionName(str string) (table, partition string)
- func WriteData(w http.ResponseWriter, data any)
- func WriteError(w http.ResponseWriter, err error)
- type ClusterUpgradeHandler
- type ClusterUpgradeInfo
- type RegionMeta
- type SimpleServerInfo
- type TikvHandlerTool
- func (t *TikvHandlerTool) GetHandle(tb table.PhysicalTable, params map[string]string, values url.Values) (kv.Handle, error)
- func (t *TikvHandlerTool) GetMvccByIdxValue(idx table.Index, values url.Values, idxCols []*model.ColumnInfo, ...) ([]*helper.MvccKV, error)
- func (*TikvHandlerTool) GetPartition(tableVal table.Table, partitionName string) (table.PhysicalTable, error)
- func (t *TikvHandlerTool) GetRegionIDByKey(encodedKey []byte) (uint64, error)
- func (t *TikvHandlerTool) GetRegionsMeta(regionIDs []uint64) ([]RegionMeta, error)
- func (t *TikvHandlerTool) GetTable(dbName, tableName string) (table.PhysicalTable, error)
- func (t *TikvHandlerTool) GetTableID(dbName, tableName string) (int64, error)
- func (t *TikvHandlerTool) HandleMvccGetByHex(params map[string]string) (*mvccKV, error)
- func (t *TikvHandlerTool) Schema() (infoschema.InfoSchema, error)
Constants ¶
const ( DBName = "db" HexKey = "hexKey" IndexName = "index" Handle = "handle" RegionID = "regionID" StartTS = "startTS" TableName = "table" TableID = "tableID" ColumnID = "colID" ColumnTp = "colTp" ColumnFlag = "colFlag" ColumnLen = "colLen" RowBin = "rowBin" Snapshot = "snapshot" FileName = "filename" DumpPartitionStats = "dumpPartitionStats" Begin = "begin" End = "end" )
const ( Type = "type" IsDump = "isDump" // For extract plan task handler IsSkipStats = "isSkipStats" IsHistoryView = "isHistoryView" )
For extract task handler
const ( TableIDQuery = "table_id" Limit = "limit" JobID = "start_job_id" Operation = "op" Seconds = "seconds" )
For query string
const ( HeaderContentType = "Content-Type" ContentTypeJSON = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func ExtractTableAndPartitionName ¶
ExtractTableAndPartitionName extracts table name and partition name from this "table(partition)":
func WriteError ¶
func WriteError(w http.ResponseWriter, err error)
WriteError writes error to response.
Types ¶
type ClusterUpgradeHandler ¶
type ClusterUpgradeHandler struct {
// contains filtered or unexported fields
}
ClusterUpgradeHandler is the handler for upgrading cluster.
func NewClusterUpgradeHandler ¶
func NewClusterUpgradeHandler(store kv.Storage) *ClusterUpgradeHandler
NewClusterUpgradeHandler creates a new ClusterUpgradeHandler.
func (ClusterUpgradeHandler) FinishUpgrade ¶
func (h ClusterUpgradeHandler) FinishUpgrade() (hasDone bool, err error)
FinishUpgrade is used to finish the upgrade.
func (ClusterUpgradeHandler) ServeHTTP ¶
func (h ClusterUpgradeHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP handles request of ddl server info.
func (ClusterUpgradeHandler) StartUpgrade ¶
func (h ClusterUpgradeHandler) StartUpgrade() (hasDone bool, err error)
StartUpgrade is used to start the upgrade.
type ClusterUpgradeInfo ¶
type ClusterUpgradeInfo struct { ServersNum int `json:"servers_num,omitempty"` OwnerID string `json:"owner_id"` UpgradedPercent int `json:"upgraded_percent"` IsAllUpgraded bool `json:"is_all_server_version_consistent,omitempty"` AllServersDiffInfos []SimpleServerInfo `json:"all_servers_diff_info,omitempty"` }
ClusterUpgradeInfo is used to report cluster upgrade info when do http request.
type RegionMeta ¶
type RegionMeta struct { ID uint64 `json:"region_id"` Leader *metapb.Peer `json:"leader"` Peers []*metapb.Peer `json:"peers"` RegionEpoch *metapb.RegionEpoch `json:"region_epoch"` }
RegionMeta contains a region's peer detail
type SimpleServerInfo ¶
type SimpleServerInfo struct { infosync.ServerVersionInfo ID string `json:"ddl_id"` IP string `json:"ip"` Port uint `json:"listening_port"` JSONServerID uint64 `json:"server_id"` }
SimpleServerInfo is some simple information such as version and address.
type TikvHandlerTool ¶
TikvHandlerTool is a tool to handle TiKV data.
func NewTikvHandlerTool ¶
func NewTikvHandlerTool(store helper.Storage) *TikvHandlerTool
NewTikvHandlerTool creates a new TikvHandlerTool.
func (*TikvHandlerTool) GetHandle ¶
func (t *TikvHandlerTool) GetHandle(tb table.PhysicalTable, params map[string]string, values url.Values) (kv.Handle, error)
GetHandle gets the handle of the record.
func (*TikvHandlerTool) GetMvccByIdxValue ¶
func (t *TikvHandlerTool) GetMvccByIdxValue(idx table.Index, values url.Values, idxCols []*model.ColumnInfo, handle kv.Handle) ([]*helper.MvccKV, error)
GetMvccByIdxValue gets the mvcc by the index value.
func (*TikvHandlerTool) GetPartition ¶
func (*TikvHandlerTool) GetPartition(tableVal table.Table, partitionName string) (table.PhysicalTable, error)
GetPartition gets the partition by the table and partition name.
func (*TikvHandlerTool) GetRegionIDByKey ¶
func (t *TikvHandlerTool) GetRegionIDByKey(encodedKey []byte) (uint64, error)
GetRegionIDByKey gets the region id by the key.
func (*TikvHandlerTool) GetRegionsMeta ¶
func (t *TikvHandlerTool) GetRegionsMeta(regionIDs []uint64) ([]RegionMeta, error)
GetRegionsMeta gets regions meta by regionIDs
func (*TikvHandlerTool) GetTable ¶
func (t *TikvHandlerTool) GetTable(dbName, tableName string) (table.PhysicalTable, error)
GetTable gets the table by the database name and table name.
func (*TikvHandlerTool) GetTableID ¶
func (t *TikvHandlerTool) GetTableID(dbName, tableName string) (int64, error)
GetTableID gets the table ID by the database name and table name.
func (*TikvHandlerTool) HandleMvccGetByHex ¶
func (t *TikvHandlerTool) HandleMvccGetByHex(params map[string]string) (*mvccKV, error)
HandleMvccGetByHex handles the request of getting mvcc by hex encoded key.
func (*TikvHandlerTool) Schema ¶
func (t *TikvHandlerTool) Schema() (infoschema.InfoSchema, error)
Schema gets the schema.