Documentation
¶
Index ¶
- Constants
- Variables
- type BaseCallback
- type Client
- func (c *Client) AdminUserExists() bool
- func (c *Client) AliveReadNodes() ([]meta2.DataNode, error)
- func (c *Client) AlterShardKey(database, retentionPolicy, mst string, shardKey *meta2.ShardKeyInfo) error
- func (c *Client) Authenticate(username, password string) (u meta2.User, e error)
- func (c *Client) BatchUpdateContinuousQueryStat(cqStats map[string]int64) error
- func (c *Client) Close() error
- func (c *Client) ClusterID() uint64
- func (c *Client) CompareHashAndPlainPwd(hashed, plaintext string) error
- func (c *Client) CreateContinuousQuery(database, name, query string) error
- func (c *Client) CreateDataNode(writeHost, queryHost, role, az string) (uint64, uint64, uint64, error)
- func (c *Client) CreateDatabase(name string, enableTagArray bool, replicaN uint32, options *obs.ObsOptions) (*meta2.DatabaseInfo, error)
- func (c *Client) CreateDatabaseWithRetentionPolicy(name string, spec *meta2.RetentionPolicySpec, shardKey *meta2.ShardKeyInfo, ...) (*meta2.DatabaseInfo, error)
- func (c *Client) CreateMeasurement(database, retentionPolicy, mst string, shardKey *meta2.ShardKeyInfo, ...) (*meta2.MeasurementInfo, error)
- func (c *Client) CreateMetaNode(httpAddr, tcpAddr string) (*meta2.NodeInfo, error)
- func (c *Client) CreateRetentionPolicy(database string, spec *meta2.RetentionPolicySpec, makeDefault bool) (*meta2.RetentionPolicyInfo, error)
- func (c *Client) CreateShardGroup(database, policy string, timestamp time.Time, version uint32, ...) (*meta2.ShardGroupInfo, error)
- func (c *Client) CreateSqlNode(httpHost string, gossipHost string) (uint64, uint64, uint64, error)
- func (c *Client) CreateStreamMeasurement(info *meta2.StreamInfo, src, dest *influxql.Measurement, ...) error
- func (c *Client) CreateStreamPolicy(info *meta2.StreamInfo) error
- func (c *Client) CreateSubscription(database, rp, name, mode string, destinations []string) error
- func (c *Client) CreateUser(name, password string, admin, rwuser bool) (meta2.User, error)
- func (c *Client) DBPtView(database string) (meta2.DBPtInfos, error)
- func (c *Client) DBRepGroups(database string) []meta2.ReplicaGroup
- func (c *Client) DataNode(id uint64) (*meta2.DataNode, error)
- func (c *Client) DataNodeByHTTPHost(httpAddr string) (*meta2.DataNode, error)
- func (c *Client) DataNodeByTCPHost(tcpAddr string) (*meta2.DataNode, error)
- func (c *Client) DataNodes() ([]meta2.DataNode, error)
- func (c *Client) Database(name string) (*meta2.DatabaseInfo, error)
- func (c *Client) DatabaseOption(name string) (*obs.ObsOptions, error)
- func (c *Client) Databases() map[string]*meta2.DatabaseInfo
- func (c *Client) DelayDeleteShardGroup(database, policy string, id uint64, deletedAt time.Time, deleteType int32) error
- func (c *Client) DeleteDataNode(id uint64) error
- func (c *Client) DeleteIndexGroup(database, policy string, id uint64) error
- func (c *Client) DeleteMetaNode(id uint64) error
- func (c *Client) DeleteShardGroup(database, policy string, id uint64, deleteType int32) error
- func (c *Client) DropContinuousQuery(name string, database string) error
- func (c *Client) DropDownSamplePolicy(database, name string, dropAll bool) error
- func (c *Client) DropShard(id uint64) error
- func (c *Client) DropStream(name string) error
- func (c *Client) DropSubscription(database, rp, name string) error
- func (c *Client) DropUser(name string) error
- func (c *Client) EnableUseSnapshotV2(RetentionAutoCreate bool, ExpandShardsEnable bool)
- func (c *Client) FieldKeys(database string, ms influxql.Measurements) (map[string]map[string]int32, error)
- func (c *Client) GetAliveShards(database string, sgi *meta2.ShardGroupInfo, isRead bool) []int
- func (c *Client) GetAllMst(dbName string) []string
- func (c *Client) GetCqLease(host string) ([]string, error)
- func (c *Client) GetDownSamplePolicies() (*meta2.DownSamplePoliciesInfoWithDbRp, error)
- func (c *Client) GetDstStreamInfos(db, rp string, dstSis *[]*meta2.StreamInfo) bool
- func (c *Client) GetExpiredIndexes() []meta2.ExpiredIndexInfos
- func (c *Client) GetExpiredShards() ([]meta2.ExpiredShardInfos, []meta2.ExpiredShardInfos)
- func (c *Client) GetIndexDurationInfo(index uint64) (*meta2.IndexDurationResponse, error)
- func (c *Client) GetMaxCQChangeID() uint64
- func (c *Client) GetMaxSubscriptionID() uint64
- func (c *Client) GetMeasurementID(database string, rpName string, mstName string) (uint64, error)
- func (c *Client) GetMeasurementInfoStore(dbName string, rpName string, mstName string) (*meta2.MeasurementInfo, error)
- func (c *Client) GetMeasurements(m *influxql.Measurement) ([]*meta2.MeasurementInfo, error)
- func (c *Client) GetMstInfoWithInRp(dbName, rpName string, dataTypes []int64) (*meta2.RpMeasurementsFieldsInfo, error)
- func (c *Client) GetNodePT(database string) []uint32
- func (c *Client) GetNodePtsMap(database string) (map[uint64][]uint32, error)
- func (c *Client) GetReplicaInfo(db string, pt uint32) *message.ReplicaInfo
- func (c *Client) GetReplicaInfoManager() *ReplicaInfoManager
- func (c *Client) GetReplicaN(database string) (int, error)
- func (c *Client) GetSgEndTime(database string, rp string, timestamp time.Time, engineType config.EngineType) (int64, error)
- func (c *Client) GetShardDurationInfo(index uint64) (*meta2.ShardDurationResponse, error)
- func (c *Client) GetShardGroupByTimeRange(repoName, streamName string, min, max time.Time) ([]*meta2.ShardGroupInfo, error)
- func (c *Client) GetShardInfoByTime(database, retentionPolicy string, t time.Time, ptIdx int, nodeId uint64, ...) (*meta2.ShardInfo, error)
- func (c *Client) GetShardRangeInfo(db string, rp string, shardID uint64) (*meta2.ShardTimeRangeInfo, error)
- func (c *Client) GetStreamInfos() map[string]*meta2.StreamInfo
- func (c *Client) InitMetaClient(joinPeers []string, tlsEn bool, storageNodeInfo *StorageNodeInfo, ...) (uint64, uint64, uint64, error)
- func (c *Client) InsertFiles(fileInfos []meta2.FileInfo) error
- func (c *Client) IsLeader() bool
- func (c *Client) IsMasterPt(ptId uint32, database string) bool
- func (c *Client) IsSQLiteEnabled() bool
- func (c *Client) JoinMetaServer(httpAddr, rpcAddr, tcpAddr string) (*meta2.NodeInfo, error)
- func (c *Client) LocalExec(index uint64, typ proto2.Command_Type, desc *proto.ExtensionDesc, ...) error
- func (c *Client) MarkDatabaseDelete(name string) error
- func (c *Client) MarkMeasurementDelete(database, policy, measurement string) error
- func (c *Client) MarkRetentionPolicyDelete(database, name string) error
- func (c *Client) MatchMeasurements(database string, ms influxql.Measurements) (map[string]*meta2.MeasurementInfo, error)
- func (c *Client) Measurement(database string, rpName string, mstName string) (*meta2.MeasurementInfo, error)
- func (c *Client) Measurements(database string, ms influxql.Measurements) ([]string, error)
- func (c *Client) MetaNodeByAddr(addr string) *meta2.NodeInfo
- func (c *Client) MetaNodes() ([]meta2.NodeInfo, error)
- func (c *Client) MetaServers() []string
- func (c *Client) NewDownSamplePolicy(database, name string, info *meta2.DownSamplePolicyInfo) error
- func (c *Client) NodeID() uint64
- func (c *Client) Open() error
- func (c *Client) OpenAtStore() error
- func (c *Client) Peers() []string
- func (c *Client) Ping(checkAllMetaServers bool) error
- func (c *Client) PruneGroupsCommand(shardGroup bool, id uint64) error
- func (c *Client) QueryTagKeys(database string, ms influxql.Measurements, cond influxql.Expr) (map[string]map[string]struct{}, error)
- func (c *Client) RaftEnabledForDB(name string) (RepConfWriteType, error)
- func (c *Client) ReportShardLoads(dbPTStats []*proto2.DBPtStatus) error
- func (c *Client) RetentionPolicy(database, name string) (rpi *meta2.RetentionPolicyInfo, err error)
- func (c *Client) RetryDownSampleInfo() ([]byte, error)
- func (c *Client) RetryGetMeasurementInfoStore(database string, rpName string, mstName string) ([]byte, error)
- func (c *Client) RetryGetShardAuxInfo(cmd *proto2.Command) ([]byte, error)
- func (c *Client) RetryMeasurement(database string, rpName string, mstName string) (*meta2.MeasurementInfo, error)
- func (c *Client) RetryMstInfosInRp(dbName, rpName string, dataTypes []int64) ([]byte, error)
- func (c *Client) RetryRegisterQueryIDOffset(host string) (uint64, error)
- func (c *Client) RetryShowCluster(cmd *proto2.Command) ([]byte, error)
- func (c *Client) RevertRetentionPolicyDelete(database, name string) error
- func (c *Client) Schema(database string, retentionPolicy string, mst string) (fields map[string]int32, dimensions map[string]struct{}, err error)
- func (c *Client) SendBackupToMeta(mod string, param map[string]string, host string) (map[string]string, error)
- func (c *Client) SendSql2MetaHeartbeat(host string) error
- func (c *Client) SendSysCtrlToMeta(mod string, param map[string]string) (map[string]string, error)
- func (c *Client) SetAdminPrivilege(username string, admin bool) error
- func (c *Client) SetCacheData(cacheData *meta2.Data)
- func (c *Client) SetDefaultRetentionPolicy(database, name string) error
- func (c *Client) SetExpandShardsEnable(en bool)
- func (c *Client) SetHashAlgo(optHashAlgo string)
- func (c *Client) SetMetaServers(a []string)
- func (c *Client) SetNode(newNodeID uint64, newClock uint64)
- func (c *Client) SetPrivilege(username, database string, p originql.Privilege) error
- func (c *Client) SetTLS(v bool)
- func (c *Client) SetTier(tier string) error
- func (c *Client) ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta2.ShardGroupInfo, err error)
- func (c *Client) ShardIDs() []uint64
- func (c *Client) ShardOwner(shardID uint64) (database, policy string, sgi *meta2.ShardGroupInfo)
- func (c *Client) ShardsByTimeRange(sources influxql.Sources, tmin, tmax time.Time) (a []meta2.ShardInfo, err error)
- func (c *Client) ShowCluster(nodeType string, ID uint64) (models.Rows, error)
- func (c *Client) ShowClusterWithCondition(nodeType string, ID uint64) (models.Rows, error)
- func (c *Client) ShowContinuousQueries() (models.Rows, error)
- func (c *Client) ShowDownSamplePolicies(database string) (models.Rows, error)
- func (c *Client) ShowRetentionPolicies(database string) (models.Rows, error)
- func (c *Client) ShowShardGroups() models.Rows
- func (c *Client) ShowShards(db string, rp string, mst string) models.Rows
- func (c *Client) ShowStreams(database string, showAll bool) (models.Rows, error)
- func (c *Client) ShowSubscriptions() models.Rows
- func (c *Client) SimpleCreateMeasurement(db, rp, mst string, engineType config.EngineType) (*meta2.MeasurementInfo, error)
- func (c *Client) SqlNodes() ([]meta2.DataNode, error)
- func (c *Client) Suicide(err error)
- func (c *Client) TagArrayEnabled(db string) bool
- func (c *Client) TagKeys(database string) map[string]set.Set[string]
- func (c *Client) ThermalShards(dbName string, start, end time.Duration) map[uint64]struct{}
- func (c *Client) UpdateIndexInfoTier(indexID uint64, tier uint64, dbName, rpName string) error
- func (c *Client) UpdateMeasurement(db, rp, mst string, options *meta2.Options) error
- func (c *Client) UpdateRetentionPolicy(database, name string, rpu *meta2.RetentionPolicyUpdate, makeDefault bool) error
- func (c *Client) UpdateSchema(database string, retentionPolicy string, mst string, ...) error
- func (c *Client) UpdateShardDownSampleInfo(Ident *meta2.ShardIdentifier) error
- func (c *Client) UpdateShardInfoTier(shardID uint64, tier uint64, dbName, rpName string) error
- func (c *Client) UpdateStreamMstSchema(database string, retentionPolicy string, mst string, ...) error
- func (c *Client) UpdateUser(name, password string) error
- func (c *Client) User(name string) (meta2.User, error)
- func (c *Client) UserCount() int
- func (c *Client) UserPrivilege(username, database string) (*originql.Privilege, error)
- func (c *Client) UserPrivileges(username string) (map[string]originql.Privilege, error)
- func (c *Client) Users() []meta2.UserInfo
- func (c *Client) WaitForDataChanged() chan struct{}
- type ContinuousQueryManager
- type CreateNodeCallback
- type CreateSqlNodeCallback
- type DBPTCtx
- type DatabaseManager
- type DownSampleManager
- type ErrRedirect
- type ExecuteAndReportCallback
- type FieldKey
- type FieldKeys
- type GetCqLeaseCallback
- type GetDownSampleInfoCallback
- type GetMeasurementInfoCallback
- type GetMeasurementsInfoCallback
- type GetRpMstInfoCallback
- type GetShardInfoCallback
- type GetStreamInfoCallback
- type JoinCallback
- type LoadCtx
- type MeasurementManager
- type MetaClient
- type MetadataManager
- type Node
- type NodeManager
- type Peers
- type PeersCallback
- type PingCallback
- type RPCMessageSender
- type RegisterQueryIDOffsetCallback
- type RepConfWriteType
- type RepManager
- type ReplicaInfoManager
- type Role
- type SendRPCMessage
- type SendSysCtrlToMetaCallback
- type ShardManager
- type ShowClusterCallback
- type SnapshotCallback
- type SnapshotV2Callback
- type Sql2MetaHeartbeatCallback
- type SqlNodeInfo
- type StorageNodeInfo
- type StreamManager
- type SubscriptionManager
- type SystemManager
- type UserManager
- type VerifyDataNodeStatusCallback
Constants ¶
const ( // SaltBytes is the number of bytes used for salts. SaltBytes = 32 RetentionDelayedTime = 24 * time.Hour // for logkeeper service RPCReqTimeout = 10 * time.Second HttpSnapshotTimeout = 4 * time.Second )
const (
ClockFileName = "clock"
)
Variables ¶
var ( ErrNameTooLong = fmt.Errorf("database name must have fewer than %d characters", maxDbOrRpName) RetryExecTimeout = 60 * time.Second RetryReportTimeout = 60 * time.Second HttpReqTimeout = 10 * time.Second )
var DefaultTypeMapper = influxql.MultiTypeMapper( op.TypeMapper{}, query.MathTypeMapper{}, query.FunctionTypeMapper{}, query.StringFunctionTypeMapper{}, query.LabelFunctionTypeMapper{}, query.PromTimeFunctionTypeMapper{}, )
var LogicClock uint64
var VerifyNodeEn = true
Functions ¶
This section is empty.
Types ¶
type BaseCallback ¶
type BaseCallback struct {
}
func (*BaseCallback) GetCodec ¶
func (c *BaseCallback) GetCodec() transport.Codec
func (*BaseCallback) Trans2MetaMsg ¶
func (c *BaseCallback) Trans2MetaMsg(data interface{}) (*message.MetaMessage, error)
type Client ¶
type Client struct {
Clock uint64
ShardDurations map[uint64]*meta2.ShardDurationInfo
DBBriefInfos map[string]*meta2.DatabaseBriefInfo
ShardTier uint64
UseSnapshotV2 bool
RetentionAutoCreate bool
// send RPC message interface.
SendRPCMessage
// contains filtered or unexported fields
}
Client is used to execute commands on and read data from a meta service cluster.
var DefaultMetaClient *Client
func (*Client) AdminUserExists ¶
AdminUserExists returns true if any user has admin privilege.
func (*Client) AliveReadNodes ¶ added in v1.2.0
func (*Client) AlterShardKey ¶
func (c *Client) AlterShardKey(database, retentionPolicy, mst string, shardKey *meta2.ShardKeyInfo) error
func (*Client) Authenticate ¶
Authenticate returns a UserInfo if the username and password match an existing entry.
func (*Client) BatchUpdateContinuousQueryStat ¶ added in v1.1.0
BatchUpdateContinuousQueryStat reports all continuous queries state
func (*Client) CompareHashAndPlainPwd ¶
compares a hashed password with its possible plaintext equivalent. Returns nil on success, or an error on failure.
func (*Client) CreateContinuousQuery ¶ added in v1.1.0
func (*Client) CreateDataNode ¶
func (c *Client) CreateDataNode(writeHost, queryHost, role, az string) (uint64, uint64, uint64, error)
CreateDataNode will create a new data node in the metastore
func (*Client) CreateDatabase ¶
func (c *Client) CreateDatabase(name string, enableTagArray bool, replicaN uint32, options *obs.ObsOptions) (*meta2.DatabaseInfo, error)
CreateDatabase creates a database or returns it if it already exists.
func (*Client) CreateDatabaseWithRetentionPolicy ¶
func (c *Client) CreateDatabaseWithRetentionPolicy(name string, spec *meta2.RetentionPolicySpec, shardKey *meta2.ShardKeyInfo, enableTagArray bool, replicaN uint32) (*meta2.DatabaseInfo, error)
CreateDatabaseWithRetentionPolicy creates a database with the specified retention policy.
When creating a database with a retention policy, the retention policy will always be set to default. Therefore if the caller provides a retention policy that already exists on the database, but that retention policy is not the default one, an error will be returned.
This call is only idempotent when the caller provides the exact same retention policy, and that retention policy is already the default for the database.
func (*Client) CreateMeasurement ¶
func (c *Client) CreateMeasurement(database, retentionPolicy, mst string, shardKey *meta2.ShardKeyInfo, NumOfShards int32, indexR *influxql.IndexRelation, engineType config.EngineType, colStoreInfo *meta2.ColStoreInfo, schemaInfo []*proto2.FieldSchema, options *meta2.Options) (*meta2.MeasurementInfo, error)
func (*Client) CreateMetaNode ¶
func (*Client) CreateRetentionPolicy ¶
func (c *Client) CreateRetentionPolicy(database string, spec *meta2.RetentionPolicySpec, makeDefault bool) (*meta2.RetentionPolicyInfo, error)
CreateRetentionPolicy creates a retention policy on the specified database.
func (*Client) CreateShardGroup ¶
func (c *Client) CreateShardGroup(database, policy string, timestamp time.Time, version uint32, engineType config.EngineType) (*meta2.ShardGroupInfo, error)
CreateShardGroup creates a shard group on a database and policy for a given timestamp.
func (*Client) CreateSqlNode ¶ added in v1.3.0
func (*Client) CreateStreamMeasurement ¶ added in v1.3.0
func (c *Client) CreateStreamMeasurement(info *meta2.StreamInfo, src, dest *influxql.Measurement, stmt *influxql.SelectStatement) error
func (*Client) CreateStreamPolicy ¶ added in v1.0.0
func (c *Client) CreateStreamPolicy(info *meta2.StreamInfo) error
func (*Client) CreateSubscription ¶
CreateSubscription creates a subscription against the given database and retention policy.
func (*Client) CreateUser ¶
CreateUser adds a user with the given name and password and admin status.
func (*Client) DBRepGroups ¶ added in v1.1.0
func (c *Client) DBRepGroups(database string) []meta2.ReplicaGroup
func (*Client) DataNodeByHTTPHost ¶
DataNodeByHTTPHost returns the data node with the give http bind address
func (*Client) DataNodeByTCPHost ¶
DataNodeByTCPHost returns the data node with the give http bind address
func (*Client) Database ¶
func (c *Client) Database(name string) (*meta2.DatabaseInfo, error)
Database returns info for the requested database.
func (*Client) DatabaseOption ¶ added in v1.3.0
func (c *Client) DatabaseOption(name string) (*obs.ObsOptions, error)
returns obs options info for the requested database.
func (*Client) Databases ¶
func (c *Client) Databases() map[string]*meta2.DatabaseInfo
Databases returns a list of all database infos.
func (*Client) DelayDeleteShardGroup ¶ added in v1.3.0
func (c *Client) DelayDeleteShardGroup(database, policy string, id uint64, deletedAt time.Time, deleteType int32) error
When delay-deleted, the deletedAt time cannot be updated with the raft playback, so deletedAt is specified by the client.
func (*Client) DeleteDataNode ¶
DeleteDataNode deletes a data node from the cluster.
func (*Client) DeleteIndexGroup ¶
func (*Client) DeleteMetaNode ¶
func (*Client) DeleteShardGroup ¶
DeleteShardGroup removes a shard group from a database and retention policy by id.
func (*Client) DropContinuousQuery ¶ added in v1.1.0
func (*Client) DropDownSamplePolicy ¶ added in v1.0.0
func (*Client) DropStream ¶ added in v1.0.0
func (*Client) DropSubscription ¶
DropSubscription removes the named subscription from the given database and retention policy.
func (*Client) EnableUseSnapshotV2 ¶ added in v1.3.0
func (*Client) GetAliveShards ¶
used for map shards in select and write progress. write progress shard for all shards in shared-storage and replication policy.
func (*Client) GetCqLease ¶ added in v1.1.0
func (*Client) GetDownSamplePolicies ¶ added in v1.0.0
func (c *Client) GetDownSamplePolicies() (*meta2.DownSamplePoliciesInfoWithDbRp, error)
func (*Client) GetDstStreamInfos ¶ added in v1.0.0
func (c *Client) GetDstStreamInfos(db, rp string, dstSis *[]*meta2.StreamInfo) bool
GetDstStreamInfos get the stream info whose db and rip of the data are the same as the db and rp of the source table of the stream Note: make sure dstSis is initialized
func (*Client) GetExpiredIndexes ¶ added in v1.3.0
func (c *Client) GetExpiredIndexes() []meta2.ExpiredIndexInfos
func (*Client) GetExpiredShards ¶ added in v1.3.0
func (c *Client) GetExpiredShards() ([]meta2.ExpiredShardInfos, []meta2.ExpiredShardInfos)
func (*Client) GetIndexDurationInfo ¶ added in v1.4.0
func (c *Client) GetIndexDurationInfo(index uint64) (*meta2.IndexDurationResponse, error)
func (*Client) GetMaxCQChangeID ¶ added in v1.1.0
func (*Client) GetMaxSubscriptionID ¶ added in v1.1.0
func (*Client) GetMeasurementID ¶ added in v1.3.0
func (*Client) GetMeasurementInfoStore ¶ added in v1.0.0
func (*Client) GetMeasurements ¶
func (c *Client) GetMeasurements(m *influxql.Measurement) ([]*meta2.MeasurementInfo, error)
func (*Client) GetMstInfoWithInRp ¶ added in v1.0.0
func (*Client) GetNodePtsMap ¶ added in v1.1.0
func (*Client) GetReplicaInfo ¶ added in v1.1.0
func (c *Client) GetReplicaInfo(db string, pt uint32) *message.ReplicaInfo
func (*Client) GetReplicaInfoManager ¶ added in v1.1.0
func (c *Client) GetReplicaInfoManager() *ReplicaInfoManager
func (*Client) GetReplicaN ¶ added in v1.1.0
func (*Client) GetSgEndTime ¶ added in v1.3.0
func (*Client) GetShardDurationInfo ¶
func (c *Client) GetShardDurationInfo(index uint64) (*meta2.ShardDurationResponse, error)
func (*Client) GetShardGroupByTimeRange ¶ added in v1.2.0
func (*Client) GetShardInfoByTime ¶ added in v1.1.0
func (*Client) GetShardRangeInfo ¶
func (*Client) GetStreamInfos ¶ added in v1.0.0
func (c *Client) GetStreamInfos() map[string]*meta2.StreamInfo
func (*Client) InitMetaClient ¶
func (*Client) InsertFiles ¶ added in v1.3.0
func (*Client) IsMasterPt ¶ added in v1.3.0
func (*Client) IsSQLiteEnabled ¶ added in v1.3.0
func (*Client) JoinMetaServer ¶
JoinMetaServer will add the passed in tcpAddr to the raft peers and add a MetaNode to the metastore
func (*Client) LocalExec ¶ added in v1.3.0
func (c *Client) LocalExec(index uint64, typ proto2.Command_Type, desc *proto.ExtensionDesc, value interface{}) error
func (*Client) MarkDatabaseDelete ¶
func (*Client) MarkMeasurementDelete ¶
func (*Client) MarkRetentionPolicyDelete ¶
func (*Client) MatchMeasurements ¶
func (c *Client) MatchMeasurements(database string, ms influxql.Measurements) (map[string]*meta2.MeasurementInfo, error)
func (*Client) Measurement ¶
func (*Client) Measurements ¶
func (*Client) MetaNodeByAddr ¶
MetaNodeByAddr returns the meta node's info.
func (*Client) MetaServers ¶
func (*Client) NewDownSamplePolicy ¶ added in v1.0.0
func (c *Client) NewDownSamplePolicy(database, name string, info *meta2.DownSamplePolicyInfo) error
func (*Client) OpenAtStore ¶ added in v1.0.0
func (*Client) Ping ¶
Ping will hit the ping endpoint for the metaservice and return nil if it returns 200. If checkAllMetaServers is set to true, it will hit the ping endpoint and tell it to verify the health of all metaservers in the cluster
func (*Client) PruneGroupsCommand ¶
PyStore send command to PyMeta. NO need to waitForIndex.
func (*Client) QueryTagKeys ¶
func (*Client) RaftEnabledForDB ¶ added in v1.3.0
func (c *Client) RaftEnabledForDB(name string) (RepConfWriteType, error)
func (*Client) ReportShardLoads ¶
func (c *Client) ReportShardLoads(dbPTStats []*proto2.DBPtStatus) error
func (*Client) RetentionPolicy ¶
func (c *Client) RetentionPolicy(database, name string) (rpi *meta2.RetentionPolicyInfo, err error)
RetentionPolicy returns the requested retention policy info.
func (*Client) RetryDownSampleInfo ¶ added in v1.0.0
func (*Client) RetryGetMeasurementInfoStore ¶ added in v1.0.0
func (*Client) RetryGetShardAuxInfo ¶
func (*Client) RetryMeasurement ¶ added in v1.3.0
func (*Client) RetryMstInfosInRp ¶ added in v1.0.0
func (*Client) RetryRegisterQueryIDOffset ¶ added in v1.1.0
RetryRegisterQueryIDOffset send a register rpc to ts-meta,request a query id offset
func (*Client) RetryShowCluster ¶ added in v1.3.0
func (*Client) RevertRetentionPolicyDelete ¶ added in v1.3.0
func (*Client) SendBackupToMeta ¶ added in v1.3.0
func (*Client) SendSql2MetaHeartbeat ¶ added in v1.1.0
func (*Client) SendSysCtrlToMeta ¶ added in v1.2.0
func (*Client) SetAdminPrivilege ¶
SetAdminPrivilege sets or unsets admin privilege to the given username.
func (*Client) SetCacheData ¶ added in v1.2.0
this function is used for UT testing
func (*Client) SetDefaultRetentionPolicy ¶
SetDefaultRetentionPolicy sets a database's default retention policy.
func (*Client) SetExpandShardsEnable ¶ added in v1.3.0
func (*Client) SetHashAlgo ¶ added in v1.1.0
func (*Client) SetMetaServers ¶
SetMetaServers updates the meta servers on the client.
func (*Client) SetPrivilege ¶
SetPrivilege sets a privilege for the given user on the given database.
func (*Client) SetTLS ¶
SetTLS sets whether the client should use TLS when connecting. This function is not safe for concurrent use.
func (*Client) ShardGroupsByTimeRange ¶
func (c *Client) ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta2.ShardGroupInfo, err error)
ShardGroupsByTimeRange returns a list of all shard groups on a database and policy that may contain data for the specified time range. Shard groups are sorted by start time.
func (*Client) ShardOwner ¶
func (c *Client) ShardOwner(shardID uint64) (database, policy string, sgi *meta2.ShardGroupInfo)
ShardOwner returns the owning shard group info for a specific shard.
func (*Client) ShardsByTimeRange ¶
func (c *Client) ShardsByTimeRange(sources influxql.Sources, tmin, tmax time.Time) (a []meta2.ShardInfo, err error)
ShardsByTimeRange returns a slice of shards that may contain data in the time range.
func (*Client) ShowCluster ¶ added in v1.2.0
func (*Client) ShowClusterWithCondition ¶ added in v1.2.0
func (*Client) ShowContinuousQueries ¶ added in v1.1.0
func (*Client) ShowDownSamplePolicies ¶ added in v1.0.0
func (*Client) ShowRetentionPolicies ¶
func (*Client) ShowShardGroups ¶
func (*Client) ShowShards ¶
func (*Client) ShowStreams ¶ added in v1.0.0
func (*Client) ShowSubscriptions ¶
func (*Client) SimpleCreateMeasurement ¶ added in v1.4.1
func (c *Client) SimpleCreateMeasurement(db, rp, mst string, engineType config.EngineType) (*meta2.MeasurementInfo, error)
func (*Client) TagArrayEnabled ¶ added in v1.1.0
func (*Client) ThermalShards ¶ added in v1.1.0
func (*Client) UpdateIndexInfoTier ¶ added in v1.4.1
func (*Client) UpdateMeasurement ¶ added in v1.2.0
func (*Client) UpdateRetentionPolicy ¶
func (c *Client) UpdateRetentionPolicy(database, name string, rpu *meta2.RetentionPolicyUpdate, makeDefault bool) error
UpdateRetentionPolicy updates a retention policy.
func (*Client) UpdateSchema ¶
func (*Client) UpdateShardDownSampleInfo ¶ added in v1.0.0
func (c *Client) UpdateShardDownSampleInfo(Ident *meta2.ShardIdentifier) error
func (*Client) UpdateShardInfoTier ¶
func (*Client) UpdateStreamMstSchema ¶ added in v1.0.0
func (*Client) UpdateUser ¶
UpdateUser updates the password of an existing user.
func (*Client) UserPrivilege ¶
UserPrivilege returns the privilege for the given user on the given database.
func (*Client) UserPrivileges ¶
UserPrivileges returns the privileges for a user mapped by database name.
func (*Client) WaitForDataChanged ¶
func (c *Client) WaitForDataChanged() chan struct{}
WaitForDataChanged returns a channel that will get a stuct{} when the metastore data has changed.
type ContinuousQueryManager ¶ added in v1.4.1
type CreateNodeCallback ¶
type CreateNodeCallback struct {
BaseCallback
NodeStartInfo *meta.NodeStartInfo
}
func (*CreateNodeCallback) Handle ¶
func (c *CreateNodeCallback) Handle(data interface{}) error
type CreateSqlNodeCallback ¶ added in v1.3.0
type CreateSqlNodeCallback struct {
BaseCallback
NodeStartInfo *meta.NodeStartInfo
}
func (*CreateSqlNodeCallback) Handle ¶ added in v1.3.0
func (c *CreateSqlNodeCallback) Handle(data interface{}) error
type DBPTCtx ¶
type DBPTCtx struct {
DBPTStat *proto2.DBPtStatus
RpStatusPool sync.Pool
}
func (*DBPTCtx) GetDBPTStat ¶
func (r *DBPTCtx) GetDBPTStat() *proto2.DBPtStatus
func (*DBPTCtx) GetRpStat ¶
func (r *DBPTCtx) GetRpStat() []*proto2.RpShardStatus
type DatabaseManager ¶ added in v1.4.1
type DatabaseManager interface {
CreateDatabase(name string, enableTagArray bool, replicaN uint32, options *obs.ObsOptions) (*meta2.DatabaseInfo, error)
CreateDatabaseWithRetentionPolicy(name string, spec *meta2.RetentionPolicySpec, shardKey *meta2.ShardKeyInfo, enableTagArray bool, replicaN uint32) (*meta2.DatabaseInfo, error)
MarkDatabaseDelete(name string) error
CreateRetentionPolicy(database string, spec *meta2.RetentionPolicySpec, makeDefault bool) (*meta2.RetentionPolicyInfo, error)
MarkRetentionPolicyDelete(database, name string) error
UpdateRetentionPolicy(database, name string, rpu *meta2.RetentionPolicyUpdate, makeDefault bool) error
}
type DownSampleManager ¶ added in v1.4.1
type ErrRedirect ¶
type ErrRedirect struct {
Host string
}
func (ErrRedirect) Error ¶
func (e ErrRedirect) Error() string
type ExecuteAndReportCallback ¶
type ExecuteAndReportCallback struct {
BaseCallback
Typ uint8
Index uint64
ErrCommand *errCommand
}
Execute & Report
func (*ExecuteAndReportCallback) Handle ¶
func (c *ExecuteAndReportCallback) Handle(data interface{}) error
type GetCqLeaseCallback ¶ added in v1.1.0
type GetCqLeaseCallback struct {
BaseCallback
CQNames []string
}
func (*GetCqLeaseCallback) Handle ¶ added in v1.1.0
func (c *GetCqLeaseCallback) Handle(data interface{}) error
type GetDownSampleInfoCallback ¶ added in v1.0.0
type GetDownSampleInfoCallback struct {
BaseCallback
Data []byte
}
func (*GetDownSampleInfoCallback) Handle ¶ added in v1.0.0
func (c *GetDownSampleInfoCallback) Handle(data interface{}) error
type GetMeasurementInfoCallback ¶ added in v1.0.0
type GetMeasurementInfoCallback struct {
BaseCallback
Data []byte
}
func (*GetMeasurementInfoCallback) Handle ¶ added in v1.0.0
func (c *GetMeasurementInfoCallback) Handle(data interface{}) error
type GetMeasurementsInfoCallback ¶ added in v1.1.0
type GetMeasurementsInfoCallback struct {
BaseCallback
Data []byte
}
func (*GetMeasurementsInfoCallback) Handle ¶ added in v1.1.0
func (c *GetMeasurementsInfoCallback) Handle(data interface{}) error
type GetRpMstInfoCallback ¶ added in v1.0.0
type GetRpMstInfoCallback struct {
BaseCallback
Data []byte
}
func (*GetRpMstInfoCallback) Handle ¶ added in v1.0.0
func (c *GetRpMstInfoCallback) Handle(data interface{}) error
type GetShardInfoCallback ¶
type GetShardInfoCallback struct {
BaseCallback
Data []byte
}
func (*GetShardInfoCallback) Handle ¶
func (c *GetShardInfoCallback) Handle(data interface{}) error
type GetStreamInfoCallback ¶ added in v1.0.0
type GetStreamInfoCallback struct {
BaseCallback
Data []byte
}
func (*GetStreamInfoCallback) Handle ¶ added in v1.0.0
func (c *GetStreamInfoCallback) Handle(data interface{}) error
type JoinCallback ¶
type JoinCallback struct {
BaseCallback
NodeInfo *meta.NodeInfo
}
func (*JoinCallback) Handle ¶
func (c *JoinCallback) Handle(data interface{}) error
type MeasurementManager ¶ added in v1.4.1
type MeasurementManager interface {
CreateMeasurement(database, retentionPolicy, mst string, shardKey *meta2.ShardKeyInfo, numOfShards int32, indexR *influxql.IndexRelation, engineType config.EngineType,
colStoreInfo *meta2.ColStoreInfo, schemaInfo []*proto2.FieldSchema, options *meta2.Options) (*meta2.MeasurementInfo, error)
AlterShardKey(database, retentionPolicy, mst string, shardKey *meta2.ShardKeyInfo) error
MarkMeasurementDelete(database, policy, measurement string) error
GetMeasurementID(database string, rpName string, mstName string) (uint64, error)
QueryTagKeys(database string, ms influxql.Measurements, cond influxql.Expr) (map[string]map[string]struct{}, error)
MatchMeasurements(database string, ms influxql.Measurements) (map[string]*meta2.MeasurementInfo, error)
Measurements(database string, ms influxql.Measurements) ([]string, error)
}
type MetaClient ¶
type MetaClient interface {
MetadataManager
DatabaseManager
NodeManager
ShardManager
UserManager
SystemManager
SubscriptionManager
ContinuousQueryManager
DownSampleManager
RepManager
MeasurementManager
StreamManager
OpenAtStore() error
RetryRegisterQueryIDOffset(host string) (uint64, error)
}
MetaClient is an interface for accessing meta data.
type MetadataManager ¶ added in v1.4.1
type MetadataManager interface {
GetMstInfoWithInRp(dbName, rpName string, dataTypes []int64) (*meta2.RpMeasurementsFieldsInfo, error)
GetAllMst(dbName string) []string
DatabaseOption(name string) (*obs.ObsOptions, error)
DBPtView(database string) (meta2.DBPtInfos, error)
GetNodePtsMap(database string) (map[uint64][]uint32, error)
Databases() map[string]*meta2.DatabaseInfo
Database(name string) (*meta2.DatabaseInfo, error)
RetentionPolicy(database, name string) (*meta2.RetentionPolicyInfo, error)
Measurement(database string, rpName string, mstName string) (*meta2.MeasurementInfo, error)
GetMeasurements(m *influxql.Measurement) ([]*meta2.MeasurementInfo, error)
TagKeys(database string) map[string]set.Set[string]
FieldKeys(database string, ms influxql.Measurements) (map[string]map[string]int32, error)
Schema(database string, retentionPolicy string, mst string) (fields map[string]int32, dimensions map[string]struct{}, err error)
ShowShards(database string, rp string, mst string) models.Rows
ShowRetentionPolicies(database string) (models.Rows, error)
}
type Node ¶
func (*Node) LoadLogicalClock ¶
type NodeManager ¶ added in v1.4.1
type NodeManager interface {
ShowCluster(nodeType string, ID uint64) (models.Rows, error)
ShowClusterWithCondition(nodeType string, ID uint64) (models.Rows, error)
CreateDataNode(writeHost, queryHost, role, az string) (uint64, uint64, uint64, error)
DeleteDataNode(id uint64) error
DataNode(id uint64) (*meta2.DataNode, error)
DataNodes() ([]meta2.DataNode, error)
AliveReadNodes() ([]meta2.DataNode, error)
DeleteMetaNode(id uint64) error
MetaNodes() ([]meta2.NodeInfo, error)
}
type PeersCallback ¶
type PeersCallback struct {
BaseCallback
Peers []string
}
func (*PeersCallback) Handle ¶
func (c *PeersCallback) Handle(data interface{}) error
type PingCallback ¶
type PingCallback struct {
BaseCallback
Leader []byte
}
func (*PingCallback) Handle ¶
func (c *PingCallback) Handle(data interface{}) error
type RPCMessageSender ¶ added in v1.1.0
type RPCMessageSender struct{}
func (*RPCMessageSender) SendRPCMsg ¶ added in v1.1.0
func (s *RPCMessageSender) SendRPCMsg(currentServer int, msg *message.MetaMessage, callback transport.Callback) error
type RegisterQueryIDOffsetCallback ¶ added in v1.1.0
type RegisterQueryIDOffsetCallback struct {
BaseCallback
Offset uint64
}
func (*RegisterQueryIDOffsetCallback) Handle ¶ added in v1.1.0
func (c *RegisterQueryIDOffsetCallback) Handle(data interface{}) error
type RepConfWriteType ¶ added in v1.3.0
type RepConfWriteType uint32
const ( NOREPDB RepConfWriteType = iota RAFTFORREPDB UNKOWN )
type RepManager ¶ added in v1.4.1
type ReplicaInfoManager ¶ added in v1.1.0
type ReplicaInfoManager struct {
// contains filtered or unexported fields
}
func NewReplicaInfoManager ¶ added in v1.1.0
func NewReplicaInfoManager() *ReplicaInfoManager
func (*ReplicaInfoManager) Get ¶ added in v1.1.0
func (m *ReplicaInfoManager) Get(db string, pt uint32) *message.ReplicaInfo
type SendRPCMessage ¶ added in v1.1.0
type SendSysCtrlToMetaCallback ¶ added in v1.2.0
type SendSysCtrlToMetaCallback struct {
BaseCallback
}
func (*SendSysCtrlToMetaCallback) Handle ¶ added in v1.2.0
func (c *SendSysCtrlToMetaCallback) Handle(data interface{}) error
type ShardManager ¶ added in v1.4.1
type ShardManager interface {
ShowShardGroups() models.Rows
ShardOwner(shardID uint64) (database, policy string, sgi *meta2.ShardGroupInfo)
GetAliveShards(database string, sgi *meta2.ShardGroupInfo, isRead bool) []int
DropShard(id uint64) error
UpdateShardInfoTier(shardID uint64, tier uint64, dbName, rpName string) error
UpdateShardDownSampleInfo(Ident *meta2.ShardIdentifier) error
ShardsByTimeRange(sources influxql.Sources, tmin, tmax time.Time) (a []meta2.ShardInfo, err error)
ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta2.ShardGroupInfo, err error)
}
type ShowClusterCallback ¶ added in v1.3.0
type ShowClusterCallback struct {
BaseCallback
Data []byte
}
func (*ShowClusterCallback) Handle ¶ added in v1.3.0
func (c *ShowClusterCallback) Handle(data interface{}) error
type SnapshotCallback ¶
type SnapshotCallback struct {
BaseCallback
Data []byte
}
func (*SnapshotCallback) Handle ¶
func (c *SnapshotCallback) Handle(data interface{}) error
type SnapshotV2Callback ¶ added in v1.3.0
type SnapshotV2Callback struct {
BaseCallback
Data []byte
}
func (*SnapshotV2Callback) Handle ¶ added in v1.3.0
func (c *SnapshotV2Callback) Handle(data interface{}) error
type Sql2MetaHeartbeatCallback ¶ added in v1.1.0
type Sql2MetaHeartbeatCallback struct {
BaseCallback
}
func (*Sql2MetaHeartbeatCallback) Handle ¶ added in v1.1.0
func (c *Sql2MetaHeartbeatCallback) Handle(data interface{}) error
type SqlNodeInfo ¶ added in v1.3.0
type StorageNodeInfo ¶
type StreamManager ¶ added in v1.4.1
type StreamManager interface {
CreateStreamPolicy(info *meta2.StreamInfo) error
CreateStreamMeasurement(info *meta2.StreamInfo, src, dest *influxql.Measurement, stmt *influxql.SelectStatement) error
UpdateStreamMstSchema(database string, retentionPolicy string, mst string, stmt *influxql.SelectStatement) error
GetStreamInfos() map[string]*meta2.StreamInfo
ShowStreams(database string, showAll bool) (models.Rows, error)
DropStream(name string) error
}
type SubscriptionManager ¶ added in v1.4.1
type SystemManager ¶ added in v1.4.1
type UserManager ¶ added in v1.4.1
type UserManager interface {
CreateUser(name, password string, admin, rwuser bool) (meta2.User, error)
DropUser(name string) error
SetAdminPrivilege(username string, admin bool) error
SetPrivilege(username, database string, p originql.Privilege) error
UpdateUser(name, password string) error
UserPrivilege(username, database string) (*originql.Privilege, error)
UserPrivileges(username string) (map[string]originql.Privilege, error)
Users() []meta2.UserInfo
Authenticate(username, password string) (u meta2.User, e error)
AdminUserExists() bool
}
type VerifyDataNodeStatusCallback ¶ added in v1.1.1
type VerifyDataNodeStatusCallback struct {
BaseCallback
}
func (*VerifyDataNodeStatusCallback) Handle ¶ added in v1.1.1
func (c *VerifyDataNodeStatusCallback) Handle(data interface{}) error