Documentation ¶
Overview ¶
Package ctl provides influxd-ctl service
Index ¶
- Constants
- type CommonResp
- type Config
- type CopyShardRequest
- type CopyShardResponse
- type CopyShardStatusResponse
- type CopyShardTask
- type DataNode
- type KillCopyShardRequest
- type KillCopyShardResponse
- type RemoveDataNodeRequest
- type RemoveDataNodeResponse
- type RemoveShardRequest
- type RemoveShardResponse
- type RequestType
- type ResponseType
- type Service
- type ShardCopier
- type ShardCopyManager
- type ShardCopyTask
- type ShowDataNodesResponse
- type TruncateShardRequest
- type TruncateShardResponse
Constants ¶
View Source
const ( // RequestTruncateShard represents a request for truncating shard. RequestTruncateShard RequestType = 1 RequestCopyShard = 2 RequestCopyShardStatus = 3 RequestKillCopyShard = 4 RequestRemoveShard = 5 RequestRemoveDataNode = 6 RequestShowDataNodes = 7 )
View Source
const ( ResponseTruncateShard ResponseType = 1 ResponseCopyShard = 2 ResponseCopyShardStatus = 3 ResponseKillCopyShard = 4 ResponseRemoveShard = 5 ResponseRemoveDataNode = 6 ResponseShowDataNodes = 7 )
View Source
const (
// MuxHeader is the header byte used for the TCP muxer.
MuxHeader = 4
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonResp ¶
type Config ¶
type CopyShardRequest ¶
type CopyShardResponse ¶
type CopyShardResponse struct {
CommonResp
}
type CopyShardStatusResponse ¶
type CopyShardStatusResponse struct { CommonResp Tasks []CopyShardTask `json:"tasks"` }
type CopyShardTask ¶
type KillCopyShardRequest ¶
type KillCopyShardResponse ¶
type KillCopyShardResponse struct {
CommonResp
}
type RemoveDataNodeRequest ¶
type RemoveDataNodeRequest struct {
DataNodeAddr string `json:"data_node_addr"`
}
type RemoveDataNodeResponse ¶
type RemoveDataNodeResponse struct {
CommonResp
}
type RemoveShardRequest ¶
type RemoveShardResponse ¶
type RemoveShardResponse struct {
CommonResp
}
type ResponseType ¶
type ResponseType byte
type Service ¶
type Service struct { Node *influxdb.Node MetaClient interface { TruncateShardGroups(t time.Time) error DeleteDataNode(id uint64) error DataNodeByTCPHost(addr string) (*meta.NodeInfo, error) RemoveShardOwner(shardID, nodeID uint64) error DataNodes() ([]meta.NodeInfo, error) } TSDBStore interface { DeleteShard(id uint64) error } Listener net.Listener Logger *zap.Logger ShardCopier interface { CopyShard(sourceAddr string, shardId uint64) error Query() []CopyShardTask Kill(shardId uint64, source, destination string) } // contains filtered or unexported fields }
func (*Service) WithLogger ¶
WithLogger sets the logger on the service.
type ShardCopier ¶
type ShardCopier struct { Node *influxdb.Node Logger *zap.Logger Manager interface { Add(task *ShardCopyTask) error Remove(id uint64) Tasks() []*ShardCopyTask Kill(id uint64, source, dest string) } MetaClient interface { ShardOwner(shardID uint64) (database, policy string, sgi *meta.ShardGroupInfo) AddShardOwner(shardID, nodeID uint64) error } TSDBStore interface { Path() string ShardRelativePath(id uint64) (string, error) CreateShard(database, retentionPolicy string, shardID uint64, enabled bool) error Shard(id uint64) *tsdb.Shard } }
func (*ShardCopier) CopyShard ¶
func (s *ShardCopier) CopyShard(sourceAddr string, shardId uint64) error
func (*ShardCopier) Kill ¶
func (s *ShardCopier) Kill(shardId uint64, source, destination string)
func (*ShardCopier) Query ¶
func (s *ShardCopier) Query() []CopyShardTask
func (*ShardCopier) WithLogger ¶
func (s *ShardCopier) WithLogger(log *zap.Logger)
type ShardCopyManager ¶
type ShardCopyManager struct {
// contains filtered or unexported fields
}
func NewCopyManager ¶
func NewCopyManager(max int) *ShardCopyManager
func (*ShardCopyManager) Add ¶
func (c *ShardCopyManager) Add(task *ShardCopyTask) error
func (*ShardCopyManager) Kill ¶
func (c *ShardCopyManager) Kill(id uint64, source, dest string)
func (*ShardCopyManager) Remove ¶
func (c *ShardCopyManager) Remove(id uint64)
func (*ShardCopyManager) Tasks ¶
func (c *ShardCopyManager) Tasks() []*ShardCopyTask
type ShardCopyTask ¶
type ShardCopyTask struct {
// contains filtered or unexported fields
}
type ShowDataNodesResponse ¶
type ShowDataNodesResponse struct { CommonResp DataNodes []DataNode `json:"data_nodes"` }
type TruncateShardRequest ¶
type TruncateShardRequest struct {
DelaySec int64 `json:"delay_sec"`
}
type TruncateShardResponse ¶
type TruncateShardResponse struct {
CommonResp
}
Click to show internal directories.
Click to hide internal directories.