Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultHost(hostname, addr string) (string, error)
- type BaseCallback
- type Client
- func (c *Client) AdminUserExists() bool
- 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) Close() error
- func (c *Client) ClusterID() uint64
- func (c *Client) CompareHashAndPlainPwd(hashed, plaintext string) error
- func (c *Client) CreateDataNode(writeHost, queryHost string) (uint64, uint64, error)
- func (c *Client) CreateDatabase(name string) (*meta2.DatabaseInfo, error)
- func (c *Client) CreateDatabaseWithRetentionPolicy(name string, spec *meta2.RetentionPolicySpec, shardKey *meta2.ShardKeyInfo) (*meta2.DatabaseInfo, error)
- func (c *Client) CreateMeasurement(database string, retentionPolicy string, mst string, ...) (*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) (*meta2.ShardGroupInfo, 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) Data() meta2.Data
- 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) Databases() map[string]*meta2.DatabaseInfo
- 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) error
- func (c *Client) DropDatabase(name string) error
- func (c *Client) DropDownSamplePolicy(database, name string, dropAll bool) error
- func (c *Client) DropRetentionPolicy(database, name string) 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) FieldKeys(database string, ms influxql.Measurements) (map[string]map[string]int32, error)
- func (c *Client) GetAliveShards(database string, sgi *meta2.ShardGroupInfo) []int
- func (c *Client) GetDownSamplePolicies() (*meta2.DownSamplePoliciesInfoWithDbRp, error)
- func (c *Client) GetDstStreamInfos(db, rp string, dstSis *[]*meta2.StreamInfo) bool
- 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) GetShardDurationInfo(index uint64) (*meta2.ShardDurationResponse, 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) GetStreamInfosForStore(currentServer int) map[string]*meta2.StreamInfo
- func (c *Client) GetStreamInfosStore() map[string]*meta2.StreamInfo
- func (c *Client) InitMetaClient(joinPeers []string, tlsEn bool, storageNodeInfo *StorageNodeInfo) (uint64, uint64, error)
- func (c *Client) IsLeader() bool
- func (c *Client) JoinMetaServer(httpAddr, rpcAddr, tcpAddr string) (*meta2.NodeInfo, error)
- func (c *Client) MarkDatabaseDelete(name string) error
- func (c *Client) MarkMeasurementDelete(database, measurement string) error
- func (c *Client) MarkRetentionPolicyDelete(database, name string) error
- func (c *Client) MarshalBinary() ([]byte, 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()
- func (c *Client) Peers() []string
- func (c *Client) Ping(checkAllMetaServers bool) error
- func (c *Client) PruneGroupsCommand(shardGroup bool, id uint64) error
- func (c *Client) PruneShardGroups() error
- func (c *Client) QueryTagKeys(database string, ms influxql.Measurements, cond influxql.Expr) (map[string]map[string]struct{}, 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) RetryGetStreamInfosStore() map[string]*meta2.StreamInfo
- func (c *Client) RetryMstInfosInRp(dbName, rpName string, dataTypes []int64) ([]byte, error)
- func (c *Client) Schema(database string, retentionPolicy string, mst string) (fields map[string]int32, dimensions map[string]struct{}, err error)
- func (c *Client) SendRPCMsg(currentServer int, msg *message.MetaMessage, callback transport.Callback) error
- func (c *Client) SetAdminPrivilege(username string, admin bool) error
- func (c *Client) SetData(data *meta2.Data) error
- func (c *Client) SetDefaultRetentionPolicy(database, name string) error
- func (c *Client) SetMetaServers(a []string)
- 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) 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() models.Rows
- func (c *Client) ShowStreams(database string, showAll bool) (models.Rows, error)
- func (c *Client) ShowSubscriptions() models.Rows
- func (c *Client) Suicide(err error)
- func (c *Client) TagKeys(database string) map[string]set.Set
- func (c *Client) TruncateShardGroups(t time.Time) 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) UpdateUserInfo()
- 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 CreateNodeCallback
- type DBPTCtx
- type ErrRedirect
- type ExecuteAndReportCallback
- type FieldKey
- type FieldKeys
- type GetDownSampleInfoCallback
- type GetMeasurementInfoCallback
- type GetRpMstInfoCallback
- type GetShardInfoCallback
- type GetStreamInfoCallback
- type GetUserInfoCallback
- type JoinCallback
- type LoadCtx
- type MetaClient
- type Node
- type Peers
- type PeersCallback
- type PingCallback
- type Role
- type SnapshotCallback
- type StorageNodeInfo
Constants ¶
const ( // SaltBytes is the number of bytes used for salts. SaltBytes = 32 // ShardGroupDeletedExpiration is the amount of time before a shard group info will be removed from cached // data after it has been marked deleted (2 weeks). ShardGroupDeletedExpiration = -2 * 7 * 24 * time.Hour IndexGroupDeletedExpiration = -2 * 7 * 24 * time.Hour RPCReqTimeout = 10 * time.Second HttpReqTimeout = 10 * time.Second HttpSnapshotTimeout = 4 * time.Second )
const (
ClockFileName = "clock"
)
Variables ¶
var ( ErrNameTooLong = errors.New("database name must have fewer than 64 characters") RetryGetUserInfoTimeout = 5 * time.Second RetryExecTimeout = 60 * time.Second RetryReportTimeout = 60 * time.Second )
var DefaultTypeMapper = influxql.MultiTypeMapper( op.TypeMapper{}, query.MathTypeMapper{}, query.FunctionTypeMapper{}, query.StringFunctionTypeMapper{}, )
var LogicClock uint64
var VerifyNodeEn = true
Functions ¶
func DefaultHost ¶
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 {
ShardDurations map[uint64]*meta2.ShardDurationInfo
ShardTier uint64
// 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) 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) CompareHashAndPlainPwd ¶
compares a hashed password with its possible plaintext equivalent. Returns nil on success, or an error on failure.
func (*Client) CreateDataNode ¶
CreateDataNode will create a new data node in the metastore
func (*Client) CreateDatabase ¶
func (c *Client) CreateDatabase(name string) (*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) (*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 string, retentionPolicy string, mst string, shardKey *meta2.ShardKeyInfo, indexR *meta2.IndexRelation) (*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) (*meta2.ShardGroupInfo, error)
CreateShardGroup creates a shard group on a database and policy for a given timestamp.
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) 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) Databases ¶
func (c *Client) Databases() map[string]*meta2.DatabaseInfo
Databases returns a list of all database infos.
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) DropDatabase ¶
DropDatabase deletes a database.
func (*Client) DropDownSamplePolicy ¶ added in v1.0.0
func (*Client) DropRetentionPolicy ¶
DropRetentionPolicy drops a retention policy from a database.
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) GetAliveShards ¶
func (c *Client) GetAliveShards(database string, sgi *meta2.ShardGroupInfo) []int
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) 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) GetShardDurationInfo ¶
func (c *Client) GetShardDurationInfo(index uint64) (*meta2.ShardDurationResponse, error)
func (*Client) GetShardRangeInfo ¶
func (*Client) GetStreamInfos ¶ added in v1.0.0
func (c *Client) GetStreamInfos() map[string]*meta2.StreamInfo
func (*Client) GetStreamInfosForStore ¶ added in v1.0.0
func (c *Client) GetStreamInfosForStore(currentServer int) map[string]*meta2.StreamInfo
func (*Client) GetStreamInfosStore ¶ added in v1.0.0
func (c *Client) GetStreamInfosStore() map[string]*meta2.StreamInfo
func (*Client) InitMetaClient ¶
func (*Client) JoinMetaServer ¶
JoinMetaServer will add the passed in tcpAddr to the raft peers and add a MetaNode to the metastore
func (*Client) MarkDatabaseDelete ¶
func (*Client) MarkMeasurementDelete ¶
func (*Client) MarkRetentionPolicyDelete ¶
func (*Client) MarshalBinary ¶
MarshalBinary returns a binary representation of the underlying data.
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 (c *Client) OpenAtStore()
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) PruneShardGroups ¶
PruneShardGroups remove deleted shard groups from the data store.
func (*Client) QueryTagKeys ¶
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) RetryGetStreamInfosStore ¶ added in v1.0.0
func (c *Client) RetryGetStreamInfosStore() map[string]*meta2.StreamInfo
func (*Client) RetryMstInfosInRp ¶ added in v1.0.0
func (*Client) SendRPCMsg ¶
func (*Client) SetAdminPrivilege ¶
SetAdminPrivilege sets or unsets admin privilege to the given username.
func (*Client) SetDefaultRetentionPolicy ¶
SetDefaultRetentionPolicy sets a database's default retention policy.
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) 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) TruncateShardGroups ¶
TruncateShardGroups truncates any shard group that could contain timestamps beyond t.
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) UpdateUserInfo ¶ added in v1.0.0
func (c *Client) UpdateUserInfo()
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 CreateNodeCallback ¶
type CreateNodeCallback struct {
BaseCallback
NodeStartInfo *meta.NodeStartInfo
}
func (*CreateNodeCallback) Handle ¶
func (c *CreateNodeCallback) 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 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 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 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 GetUserInfoCallback ¶ added in v1.0.0
type GetUserInfoCallback struct {
BaseCallback
Data []byte
}
func (*GetUserInfoCallback) Handle ¶ added in v1.0.0
func (c *GetUserInfoCallback) Handle(data interface{}) error
type JoinCallback ¶
type JoinCallback struct {
BaseCallback
NodeInfo *meta.NodeInfo
}
func (*JoinCallback) Handle ¶
func (c *JoinCallback) Handle(data interface{}) error
type MetaClient ¶
type MetaClient interface {
CreateMeasurement(database string, retentionPolicy string, mst string, shardKey *meta2.ShardKeyInfo, indexR *meta2.IndexRelation) (*meta2.MeasurementInfo, error)
AlterShardKey(database, retentionPolicy, mst string, shardKey *meta2.ShardKeyInfo) error
CreateDatabase(name string) (*meta2.DatabaseInfo, error)
CreateDatabaseWithRetentionPolicy(name string, spec *meta2.RetentionPolicySpec, shardKey *meta2.ShardKeyInfo) (*meta2.DatabaseInfo, error)
CreateRetentionPolicy(database string, spec *meta2.RetentionPolicySpec, makeDefault bool) (*meta2.RetentionPolicyInfo, error)
CreateSubscription(database, rp, name, mode string, destinations []string) error
CreateUser(name, password string, admin, rwuser bool) (meta2.User, error)
Databases() map[string]*meta2.DatabaseInfo
Database(name string) (*meta2.DatabaseInfo, error)
DataNode(id uint64) (*meta2.DataNode, error)
DataNodes() ([]meta2.DataNode, error)
DeleteDataNode(id uint64) error
DeleteMetaNode(id uint64) error
DropShard(id uint64) error
DropDatabase(name string) error
DropRetentionPolicy(database, name string) error
DropSubscription(database, rp, name string) error
DropUser(name string) error
MetaNodes() ([]meta2.NodeInfo, error)
RetentionPolicy(database, name string) (rpi *meta2.RetentionPolicyInfo, err error)
SetAdminPrivilege(username string, admin bool) error
SetPrivilege(username, database string, p originql.Privilege) 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)
TruncateShardGroups(t time.Time) error
UpdateRetentionPolicy(database, name string, rpu *meta2.RetentionPolicyUpdate, makeDefault bool) error
UpdateUser(name, password string) error
UserPrivilege(username, database string) (*originql.Privilege, error)
UserPrivileges(username string) (map[string]originql.Privilege, error)
Users() []meta2.UserInfo
MarkDatabaseDelete(name string) error
MarkRetentionPolicyDelete(database, name string) error
MarkMeasurementDelete(database, mst string) error
DBPtView(database string) (meta2.DBPtInfos, error)
ShardOwner(shardID uint64) (database, policy string, sgi *meta2.ShardGroupInfo)
Measurement(database string, rpName string, mstName string) (*meta2.MeasurementInfo, error)
Schema(database string, retentionPolicy string, mst string) (fields map[string]int32, dimensions map[string]struct{}, err error)
GetMeasurements(m *influxql.Measurement) ([]*meta2.MeasurementInfo, error)
TagKeys(database string) map[string]set.Set
FieldKeys(database string, ms influxql.Measurements) (map[string]map[string]int32, 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)
ShowShards() models.Rows
ShowShardGroups() models.Rows
ShowSubscriptions() models.Rows
ShowRetentionPolicies(database string) (models.Rows, error)
GetAliveShards(database string, sgi *meta2.ShardGroupInfo) []int
NewDownSamplePolicy(database, name string, info *meta2.DownSamplePolicyInfo) error
DropDownSamplePolicy(database, name string, dropAll bool) error
ShowDownSamplePolicies(database string) (models.Rows, error)
GetMstInfoWithInRp(dbName, rpName string, dataTypes []int64) (*meta2.RpMeasurementsFieldsInfo, error)
AdminUserExists() bool
Authenticate(username, password string) (u meta2.User, e error)
UpdateUserInfo()
UpdateShardDownSampleInfo(Ident *meta2.ShardIdentifier) error
OpenAtStore()
UpdateStreamMstSchema(database string, retentionPolicy string, mst string, stmt *influxql.SelectStatement) error
CreateStreamPolicy(info *meta2.StreamInfo) error
GetStreamInfos() map[string]*meta2.StreamInfo
GetStreamInfosStore() map[string]*meta2.StreamInfo
ShowStreams(database string, showAll bool) (models.Rows, error)
DropStream(name string) error
GetMeasurementInfoStore(database string, rpName string, mstName string) (*meta2.MeasurementInfo, error)
}
MetaClient is an interface for accessing meta data.
type Node ¶
func (*Node) LoadLogicalClock ¶
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 SnapshotCallback ¶
type SnapshotCallback struct {
BaseCallback
Data []byte
}
func (*SnapshotCallback) Handle ¶
func (c *SnapshotCallback) Handle(data interface{}) error