meta

package
v0.0.0-...-3811787 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2018 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEnabled is the default state for the meta service to run
	DefaultEnabled = true

	// DefaultHostname is the default hostname if one is not provided.
	DefaultHostname = "localhost"

	// DefaultRaftBindAddress is the default address to bind to.
	DefaultRaftBindAddress = ":8088"

	// DefaultHTTPBindAddress is the default address to bind the API to.
	DefaultHTTPBindAddress = ":8091"

	// DefaultHeartbeatTimeout is the default heartbeat timeout for the store.
	DefaultHeartbeatTimeout = 1000 * time.Millisecond

	// DefaultElectionTimeout is the default election timeout for the store.
	DefaultElectionTimeout = 1000 * time.Millisecond

	// DefaultLeaderLeaseTimeout is the default leader lease for the store.
	DefaultLeaderLeaseTimeout = 500 * time.Millisecond

	// DefaultCommitTimeout is the default commit timeout for the store.
	DefaultCommitTimeout = 50 * time.Millisecond

	// DefaultRaftPromotionEnabled is the default for auto promoting a node to a raft node when needed
	DefaultRaftPromotionEnabled = true

	// DefaultLeaseDuration is the default duration for leases.
	DefaultLeaseDuration = 60 * time.Second

	// DefaultLoggingEnabled determines if log messages are printed for the meta service
	DefaultLoggingEnabled = true
)
View Source
const (
	MuxHeader = 8
)
View Source
const (

	// SaltBytes is the number of bytes used for salts
	SaltBytes = 32
)

Variables

View Source
var (
	// ErrServiceUnavailable is returned when the meta service is unavailable.
	ErrServiceUnavailable = errors.New("meta service unavailable")

	// ErrService is returned when the meta service returns an error.
	ErrService = errors.New("meta service error")
)
View Source
var (
	// ErrStoreOpen is returned when opening an already open store.
	ErrStoreOpen = errors.New("store already open")

	// ErrStoreClosed is returned when closing an already closed store.
	ErrStoreClosed = errors.New("raft store already closed")

	// ErrTooManyPeers is returned when more than 3 peers are used.
	ErrTooManyPeers = errors.New("too many peers; influxdb v0.9.0 is limited to 3 nodes in a cluster")
)
View Source
var (
	// ErrNodeExists is returned when creating an already existing node.
	ErrNodeExists = errors.New("node already exists")

	// ErrNodeNotFound is returned when mutating a node that doesn't exist.
	ErrNodeNotFound = errors.New("node not found")

	// ErrNodesRequired is returned when at least one node is required for an operation.
	// This occurs when creating a shard group.
	ErrNodesRequired = errors.New("at least one node required")

	// ErrNodeIDRequired is returned when using a zero node id.
	ErrNodeIDRequired = errors.New("node id must be greater than 0")

	// ErrNodeUnableToDropFinalNode is returned if the node being dropped is the last
	// node in the cluster
	ErrNodeUnableToDropFinalNode = errors.New("unable to drop the final node in a cluster")
)
View Source
var (
	// ErrDatabaseExists is returned when creating an already existing database.
	ErrDatabaseExists = errors.New("database already exists")

	// ErrDatabaseNotExists is returned when operating on a not existing database.
	ErrDatabaseNotExists = errors.New("database does not exist")

	// ErrDatabaseNameRequired is returned when creating a database without a name.
	ErrDatabaseNameRequired = errors.New("database name required")
)
View Source
var (
	// ErrRetentionPolicyRequired is returned when a retention policy is required
	// by an operation, but a nil policy was passed.
	ErrRetentionPolicyRequired = errors.New("retention policy required")

	// ErrRetentionPolicyExists is returned when creating an already existing policy.
	ErrRetentionPolicyExists = errors.New("retention policy already exists")

	// ErrRetentionPolicyDefault is returned when attempting a prohibited operation
	// on a default retention policy.
	ErrRetentionPolicyDefault = errors.New("retention policy is default")

	// ErrRetentionPolicyNameRequired is returned when creating a policy without a name.
	ErrRetentionPolicyNameRequired = errors.New("retention policy name required")

	// ErrRetentionPolicyNameExists is returned when renaming a policy to
	// the same name as another existing policy.
	ErrRetentionPolicyNameExists = errors.New("retention policy name already exists")

	// ErrRetentionPolicyDurationTooLow is returned when updating a retention
	// policy that has a duration lower than the allowed minimum.
	ErrRetentionPolicyDurationTooLow = errors.New(fmt.Sprintf("retention policy duration must be at least %s",
		meta.MinRetentionPolicyDuration))

	// ErrRetentionPolicyConflict is returned when creating a retention policy conflicts
	// with an existing policy.
	ErrRetentionPolicyConflict = errors.New("retention policy conflicts with an existing policy")

	// ErrReplicationFactorTooLow is returned when the replication factor is not in an
	// acceptable range.
	ErrReplicationFactorTooLow = errors.New("replication factor must be greater than 0")

	// ErrIncompatibleDurations is returned when creating or updating a
	// retention policy that has a duration lower than the current shard
	// duration.
	ErrIncompatibleDurations = errors.New("retention policy duration must be greater than the shard duration")

	// ErrRetentionPolicyNotFound is returned when an expected policy wasn't found.
	ErrRetentionPolicyNotFound = errors.New("retention policy not found")

	// ErrInvalidName is returned when attempting to create a database or retention policy with an invalid name
	ErrInvalidName = errors.New("invalid name")
)
View Source
var (
	// ErrShardGroupExists is returned when creating an already existing shard group.
	ErrShardGroupExists = errors.New("shard group already exists")

	// ErrShardGroupNotFound is returned when mutating a shard group that doesn't exist.
	ErrShardGroupNotFound = errors.New("shard group not found")

	// ErrShardNotReplicated is returned if the node requested to be dropped has
	// the last copy of a shard present and the force keyword was not used
	ErrShardNotReplicated = errors.New("shard not replicated")
)
View Source
var (
	// ErrContinuousQueryExists is returned when creating an already existing continuous query.
	ErrContinuousQueryExists = errors.New("continuous query already exists")

	// ErrContinuousQueryNotFound is returned when removing a continuous query that doesn't exist.
	ErrContinuousQueryNotFound = errors.New("continuous query not found")
)
View Source
var (
	// ErrSubscriptionExists is returned when creating an already existing subscription.
	ErrSubscriptionExists = errors.New("subscription already exists")

	// ErrSubscriptionNotFound is returned when removing a subscription that doesn't exist.
	ErrSubscriptionNotFound = errors.New("subscription not found")
)
View Source
var (
	// ErrUserExists is returned when creating an already existing user.
	ErrUserExists = errors.New("user already exists")

	// ErrUserNotFound is returned when mutating a user that doesn't exist.
	ErrUserNotFound = errors.New("user not found")

	// ErrUsernameRequired is returned when creating a user without a username.
	ErrUsernameRequired = errors.New("username required")

	// ErrAuthenticate is returned when authentication fails.
	ErrAuthenticate = errors.New("authentication failed")
)

Functions

func DefaultHost

func DefaultHost(hostname, addr string) (string, error)

func ErrInvalidSubscriptionURL

func ErrInvalidSubscriptionURL(url string) error

ErrInvalidSubscriptionURL is returned when the subscription's destination URL is invalid.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is used to execute commands on and read data from a meta service cluster.

func NewClient

func NewClient() *Client

NewClient returns a new *Client.

func (*Client) AcquireLease

func (c *Client) AcquireLease(name string) (l *meta.Lease, err error)

AcquireLease attempts to acquire the specified lease. A lease is a logical concept that can be used by anything that needs to limit execution to a single node. E.g., the CQ service on all nodes may ask for the "ContinuousQuery" lease. Only the node that acquires it will run CQs. NOTE: Leases are not managed through the CP system and are not fully consistent. Any actions taken after acquiring a lease must be idempotent.

func (*Client) AdminUserExists

func (c *Client) AdminUserExists() bool

func (*Client) Authenticate

func (c *Client) Authenticate(username, password string) (meta.User, error)

func (*Client) Close

func (c *Client) Close() error

Close the meta service cluster connection.

func (*Client) ClusterID

func (c *Client) ClusterID() uint64

ClusterID returns the ID of the cluster it's connected to.

func (*Client) CreateContinuousQuery

func (c *Client) CreateContinuousQuery(database, name, query string) error

func (*Client) CreateDataNode

func (c *Client) CreateDataNode(httpAddr, tcpAddr string) (*meta.NodeInfo, error)

CreateDataNode will create a new data node in the metastore

func (*Client) CreateDatabase

func (c *Client) CreateDatabase(name string) (*meta.DatabaseInfo, error)

CreateDatabase creates a database or returns it if it already exists

func (*Client) CreateDatabaseWithRetentionPolicy

func (c *Client) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error)

CreateDatabaseWithRetentionPolicy creates a database with the specified retention policy.

func (*Client) CreateMetaNode

func (c *Client) CreateMetaNode(httpAddr, tcpAddr string) (*meta.NodeInfo, error)

func (*Client) CreateRetentionPolicy

func (c *Client) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec, makeDefault bool) (*meta.RetentionPolicyInfo, error)

CreateRetentionPolicy creates a retention policy on the specified database.

func (*Client) CreateShardGroup

func (c *Client) CreateShardGroup(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error)

CreateShardGroup creates a shard group on a database and policy for a given timestamp.

func (*Client) CreateSubscription

func (c *Client) CreateSubscription(database, rp, name, mode string, destinations []string) error

func (*Client) CreateUser

func (c *Client) CreateUser(name, password string, admin bool) (meta.User, error)

func (*Client) DataNode

func (c *Client) DataNode(id uint64) (*meta.NodeInfo, error)

Node returns a node by id.

func (*Client) DataNodeByHTTPHost

func (c *Client) DataNodeByHTTPHost(httpAddr string) (*meta.NodeInfo, error)

DataNodeByHTTPHost returns the data node with the give http bind address

func (*Client) DataNodeByTCPHost

func (c *Client) DataNodeByTCPHost(tcpAddr string) (*meta.NodeInfo, error)

DataNodeByTCPHost returns the data node with the give http bind address

func (*Client) DataNodes

func (c *Client) DataNodes() ([]meta.NodeInfo, error)

DataNodes returns the data nodes' info.

func (*Client) Database

func (c *Client) Database(name string) *meta.DatabaseInfo

Database returns info for the requested database.

func (*Client) Databases

func (c *Client) Databases() []meta.DatabaseInfo

Databases returns a list of all database infos.

func (*Client) DeleteDataNode

func (c *Client) DeleteDataNode(id uint64) error

DeleteDataNode deletes a data node from the cluster.

func (*Client) DeleteMetaNode

func (c *Client) DeleteMetaNode(id uint64) error

func (*Client) DeleteShardGroup

func (c *Client) DeleteShardGroup(database, policy string, id uint64) error

DeleteShardGroup removes a shard group from a database and retention policy by id.

func (*Client) DropContinuousQuery

func (c *Client) DropContinuousQuery(database, name string) error

func (*Client) DropDatabase

func (c *Client) DropDatabase(name string) error

DropDatabase deletes a database.

func (*Client) DropRetentionPolicy

func (c *Client) DropRetentionPolicy(database, name string) error

DropRetentionPolicy drops a retention policy from a database.

func (*Client) DropShard

func (c *Client) DropShard(id uint64) error

DropShard deletes a shard by ID.

func (*Client) DropSubscription

func (c *Client) DropSubscription(database, rp, name string) error

func (*Client) DropUser

func (c *Client) DropUser(name string) error

func (*Client) IsLeader

func (c *Client) IsLeader() bool

IsLeader - should get rid of this

func (*Client) JoinMetaServer

func (c *Client) JoinMetaServer(httpAddr, tcpAddr string) (*meta.NodeInfo, error)

JoinMetaServer will add the passed in tcpAddr to the raft peers and add a MetaNode to the metastore

func (*Client) MarshalBinary

func (c *Client) MarshalBinary() ([]byte, error)

func (*Client) MetaNodeByAddr

func (c *Client) MetaNodeByAddr(addr string) *meta.NodeInfo

MetaNodeByAddr returns the meta node's info.

func (*Client) MetaNodes

func (c *Client) MetaNodes() ([]meta.NodeInfo, error)

MetaNodes returns the meta nodes' info.

func (*Client) MetaServers

func (c *Client) MetaServers() []string

func (*Client) NodeID

func (c *Client) NodeID() uint64

GetNodeID returns the cluster's node ID.

func (*Client) Open

func (c *Client) Open() error

Open a connection to a meta service cluster.

func (*Client) Ping

func (c *Client) Ping(checkAllMetaServers bool) error

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) PrecreateShardGroups

func (c *Client) PrecreateShardGroups(from, to time.Time) error

PrecreateShardGroups creates shard groups whose endtime is before the 'to' time passed in, but is yet to expire before 'from'. This is to avoid the need for these shards to be created when data for the corresponding time range arrives. Shard creation involves Raft consensus, and precreation avoids taking the hit at write-time.

func (*Client) PruneShardGroups

func (c *Client) PruneShardGroups() error

PruneShardGroups remove deleted shard groups from the data store.

func (*Client) RetentionPolicy

func (c *Client) RetentionPolicy(database, name string) (rpi *meta.RetentionPolicyInfo, err error)

RetentionPolicy returns the requested retention policy info.

func (*Client) SetAdminPrivilege

func (c *Client) SetAdminPrivilege(username string, admin bool) error

func (*Client) SetData

func (c *Client) SetData(data *Data) error

func (*Client) SetMetaServers

func (c *Client) SetMetaServers(a []string)

SetMetaServers updates the meta servers on the cluster.

func (*Client) SetPrivilege

func (c *Client) SetPrivilege(username, database string, p influxql.Privilege) error

func (*Client) SetTLS

func (c *Client) SetTLS(v bool)

SetTLS sets whether the cluster 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 []meta.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) ShardIDs

func (c *Client) ShardIDs() []uint64

ShardIDs returns a list of all shard ids.

func (*Client) ShardIDsByNode

func (c *Client) ShardIDsByNode(nodeId uint64) []uint64

func (*Client) ShardInfo

func (c *Client) ShardInfo(shardID uint64) meta.ShardInfo

func (*Client) ShardIsReadable

func (c *Client) ShardIsReadable(shardID, nodeID uint64) bool

func (*Client) ShardOwner

func (c *Client) ShardOwner(shardID uint64) (database, policy string, sgi *meta.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 []meta.ShardInfo, err error)

ShardsByTimeRange returns a slice of shards that may contain data in the time range.

func (*Client) UpdateRetentionPolicy

func (c *Client) UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error

UpdateRetentionPolicy updates a retention policy.

func (*Client) UpdateUser

func (c *Client) UpdateUser(name, password string) error

func (*Client) User

func (c *Client) User(name string) (meta.User, error)

func (*Client) UserCount

func (c *Client) UserCount() int

func (*Client) UserPrivilege

func (c *Client) UserPrivilege(username, database string) (*influxql.Privilege, error)

func (*Client) UserPrivileges

func (c *Client) UserPrivileges(username string) (map[string]influxql.Privilege, error)

func (*Client) Users

func (c *Client) Users() []meta.UserInfo

func (*Client) WaitForDataChanged

func (c *Client) WaitForDataChanged() chan struct{}

WaitForDataChanged will return a channel that will get closed when the metastore data has changed

func (*Client) WithLogger

func (c *Client) WithLogger(log zap.Logger)

WithLogger sets the logger for the client.

type Config

type Config struct {
	Enabled bool   `toml:"enabled"`
	Dir     string `toml:"dir"`

	// RemoteHostname is the hostname portion to use when registering meta node
	// addresses.  This hostname must be resolvable from other nodes.
	RemoteHostname string `toml:"-"`

	// this is deprecated. Should use the address from run/config.go
	RaftBindAddress string `toml:"raft-bind-address"`

	// HTTPBindAddress is the bind address for the metaservice HTTP API
	HTTPBindAddress  string `toml:"http-bind-address"`
	HTTPSEnabled     bool   `toml:"https-enabled"`
	HTTPSCertificate string `toml:"https-certificate"`

	// JoinPeers if specified gives other metastore servers to join this server to the cluster
	JoinPeers            []string      `toml:"-"`
	RetentionAutoCreate  bool          `toml:"retention-autocreate"`
	ElectionTimeout      toml.Duration `toml:"election-timeout"`
	HeartbeatTimeout     toml.Duration `toml:"heartbeat-timeout"`
	LeaderLeaseTimeout   toml.Duration `toml:"leader-lease-timeout"`
	CommitTimeout        toml.Duration `toml:"commit-timeout"`
	ClusterTracing       bool          `toml:"cluster-tracing"`
	RaftPromotionEnabled bool          `toml:"raft-promotion-enabled"`
	LoggingEnabled       bool          `toml:"logging-enabled"`
	PprofEnabled         bool          `toml:"pprof-enabled"`

	LeaseDuration toml.Duration `toml:"lease-duration"`
}

Config represents the meta configuration.

func NewConfig

func NewConfig() *Config

NewConfig builds a new configuration with default values.

func (*Config) Validate

func (c *Config) Validate() error

type Data

type Data struct {
	Data meta.Data

	MetaNodes []meta.NodeInfo
	DataNodes []meta.NodeInfo

	ShardStatus map[uint64]map[uint64]ShardStatus
	MaxNodeID   uint64
}

func (Data) AdminUserExists

func (data Data) AdminUserExists() bool

AdminUserExists returns true if an admin user exists.

func (*Data) Clone

func (data *Data) Clone() *Data

Clone returns a copy of data with a new version.

func (*Data) CloneDataNodes

func (data *Data) CloneDataNodes() []meta.NodeInfo

CloneUsers returns a copy of the user infos.

func (*Data) CloneDatabases

func (data *Data) CloneDatabases() []meta.DatabaseInfo

CloneDatabases returns a copy of the DatabaseInfo.

func (*Data) CloneMetaNodes

func (data *Data) CloneMetaNodes() []meta.NodeInfo

CloneUsers returns a copy of the user infos.

func (*Data) CloneUsers

func (data *Data) CloneUsers() []meta.UserInfo

CloneUsers returns a copy of the user infos.

func (*Data) CreateContinuousQuery

func (data *Data) CreateContinuousQuery(database, name, query string) error

CreateContinuousQuery adds a named continuous query to a database.

func (*Data) CreateDataNode

func (data *Data) CreateDataNode(host, tcpHost string) error

CreateDataNode adds a node to the metadata.

func (*Data) CreateDatabase

func (data *Data) CreateDatabase(name string) error

CreateDatabase creates a new database. It returns an error if name is blank or if a database with the same name already exists.

func (*Data) CreateMetaNode

func (data *Data) CreateMetaNode(httpAddr, tcpAddr string) error

CreateMetaNode will add a new meta node to the metastore

func (*Data) CreateRetentionPolicy

func (data *Data) CreateRetentionPolicy(database string, rpi *meta.RetentionPolicyInfo, makeDefault bool) error

CreateRetentionPolicy creates a new retention policy on a database. It returns an error if name is blank or if the database does not exist.

func (*Data) CreateShardGroup

func (data *Data) CreateShardGroup(database, policy string, timestamp time.Time) error

CreateShardGroup creates a shard group on a database and policy for a given timestamp.

func (*Data) CreateSubscription

func (data *Data) CreateSubscription(database, rp, name, mode string, destinations []string) error

CreateSubscription adds a named subscription to a database and retention policy.

func (*Data) CreateUser

func (data *Data) CreateUser(name, hash string, admin bool) error

CreateUser creates a new user.

func (*Data) DataNode

func (data *Data) DataNode(id uint64) *meta.NodeInfo

DataNode returns a node by id.

func (*Data) Database

func (data *Data) Database(name string) *meta.DatabaseInfo

Database returns a DatabaseInfo by the database name.

func (*Data) DeleteDataNode

func (data *Data) DeleteDataNode(id uint64) error

DeleteDataNode removes a node from the Meta store.

If necessary, DeleteDataNode reassigns ownership of any shards that would otherwise become orphaned by the removal of the node from the cluster.

func (*Data) DeleteMetaNode

func (data *Data) DeleteMetaNode(id uint64) error

DeleteMetaNode will remove the meta node from the store

func (*Data) DeleteShardGroup

func (data *Data) DeleteShardGroup(database, policy string, id uint64) error

DeleteShardGroup removes a shard group from a database and retention policy by id.

func (*Data) DropContinuousQuery

func (data *Data) DropContinuousQuery(database, name string) error

DropContinuousQuery removes a continuous query.

func (*Data) DropDatabase

func (data *Data) DropDatabase(name string) error

DropDatabase removes a database by name. It does not return an error if the database cannot be found.

func (*Data) DropRetentionPolicy

func (data *Data) DropRetentionPolicy(database, name string) error

DropRetentionPolicy removes a retention policy from a database by name.

func (*Data) DropShard

func (data *Data) DropShard(id uint64)

DropShard removes a shard by ID.

DropShard won't return an error if the shard can't be found, which allows the command to be re-run in the case that the meta store succeeds but a data node fails.

func (*Data) DropSubscription

func (data *Data) DropSubscription(database, rp, name string) error

DropSubscription removes a subscription.

func (*Data) DropUser

func (data *Data) DropUser(name string) error

DropUser removes an existing user by name.

func (*Data) MarshalBinary

func (data *Data) MarshalBinary() ([]byte, error)

MarshalBinary encodes the metadata to a binary format.

func (*Data) MetaNode

func (data *Data) MetaNode(id uint64) *meta.NodeInfo

MetaNode returns a node by id.

func (*Data) RetentionPolicy

func (data *Data) RetentionPolicy(database, name string) (*meta.RetentionPolicyInfo, error)

RetentionPolicy returns a retention policy for a database by name.

func (*Data) SetAdminPrivilege

func (data *Data) SetAdminPrivilege(name string, admin bool) error

SetAdminPrivilege sets the admin privilege for a user.

func (*Data) SetMetaNode

func (data *Data) SetMetaNode(httpAddr, tcpAddr string) error

SetMetaNode will update the information for the single meta node or create a new metanode. If there are more than 1 meta nodes already, an error will be returned

func (*Data) SetPrivilege

func (data *Data) SetPrivilege(name, database string, p influxql.Privilege) error

SetPrivilege sets a privilege for a user on a database.

func (*Data) ShardGroupByTimestamp

func (data *Data) ShardGroupByTimestamp(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error)

ShardGroupByTimestamp returns the shard group on a database and policy for a given timestamp.

func (*Data) ShardGroups

func (data *Data) ShardGroups(database, policy string) ([]meta.ShardGroupInfo, error)

ShardGroups returns a list of all shard groups on a database and retention policy.

func (*Data) ShardGroupsByTimeRange

func (data *Data) ShardGroupsByTimeRange(database, policy string, tmin, tmax time.Time) ([]meta.ShardGroupInfo, 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 (*Data) UnmarshalBinary

func (data *Data) UnmarshalBinary(buf []byte) error

UnmarshalBinary decodes the object from a binary format.

func (*Data) UpdateRetentionPolicy

func (data *Data) UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error

UpdateRetentionPolicy updates an existing retention policy.

func (*Data) UpdateShard

func (data *Data) UpdateShard(id uint64, newOwners []uint64)

func (*Data) UpdateUser

func (data *Data) UpdateUser(name, hash string) error

UpdateUser updates the password hash of an existing user.

func (*Data) User

func (data *Data) User(username string) meta.User

User returns a user by username.

func (*Data) UserPrivilege

func (data *Data) UserPrivilege(name, database string) (*influxql.Privilege, error)

UserPrivilege gets the privilege for a user on a database.

func (*Data) UserPrivileges

func (data *Data) UserPrivileges(name string) (map[string]influxql.Privilege, error)

UserPrivileges gets the privileges for a user.

type Peers

type Peers []string

func (Peers) Append

func (peers Peers) Append(p ...string) Peers

func (Peers) Contains

func (peers Peers) Contains(peer string) bool

func (Peers) Unique

func (peers Peers) Unique() Peers

type Service

type Service struct {
	RaftListener net.Listener

	Version string

	Logger zap.Logger

	Node *influxdb.Node
	// contains filtered or unexported fields
}

func NewService

func NewService(c *Config) *Service

NewService returns a new instance of Service.

func (*Service) Close

func (s *Service) Close() error

Close closes the underlying listener.

func (*Service) Err

func (s *Service) Err() <-chan error

Err returns a channel for fatal errors that occur on the listener.

func (*Service) HTTPAddr

func (s *Service) HTTPAddr() string

HTTPAddr returns the bind address for the HTTP API

func (*Service) Open

func (s *Service) Open() error

Open starts the service

func (*Service) RaftAddr

func (s *Service) RaftAddr() string

RaftAddr returns the bind address for the Raft TCP listener

func (*Service) WithLogger

func (s *Service) WithLogger(log zap.Logger)

type ShardRestoreTask

type ShardRestoreTask struct {
	Database        string
	RetentionPolicy string
	ShardID         uint64
	CurrentOwners   []meta.ShardOwner
	NewOwners       []meta.ShardOwner
	NewOwnerAddress map[uint64]string
}

type ShardStatus

type ShardStatus int32
const (
	ShardWrite ShardStatus = 1 + iota
	ShardRead
	ShardWriteRead
)

Directories

Path Synopsis
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL