meta

package
v0.0.0-...-592d533 Latest Latest
Warning

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

Go to latest
Published: May 5, 2017 License: MIT Imports: 35 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 (
	// DefaultRetentionPolicyReplicaN is the default value of RetentionPolicyInfo.ReplicaN.
	DefaultRetentionPolicyReplicaN = 1

	// DefaultRetentionPolicyDuration is the default value of RetentionPolicyInfo.Duration.
	DefaultRetentionPolicyDuration = time.Duration(0)

	// DefaultRetentionPolicyName is the default name for auto generated retention policies.
	DefaultRetentionPolicyName = "autogen"

	// MinRetentionPolicyDuration represents the minimum duration for a policy.
	MinRetentionPolicyDuration = time.Hour
)
View Source
const (
	// MuxHeader is header that used in tcp pakcage that help tcp distinguish
	// different service.
	MuxHeader = 8
)

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")
)
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 (
	// 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 = fmt.Errorf("retention policy duration must be at least %v",
		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")
)
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)

DefaultHost return defaultHost

Types

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

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

func NewClient

func NewClient(config *Config) *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) AddShardOwner

func (c *Client) AddShardOwner(id, nodeid uint64) error

AddShardOwner adds shardOwner.

func (*Client) CheckMetaServers

func (c *Client) CheckMetaServers() error

CheckMetaServers checks meta nodes status.

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

func (c *Client) CommitPendingShardOwner(id, nodeid uint64) error

CommitPendingShardOwner commits pending shardOwner.

func (*Client) CreateContinuousQuery

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

CreateContinuousQuery creates continue query in cluster.

func (*Client) CreateDataNode

func (c *Client) CreateDataNode(httpAddr, tcpAddr string) (*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) (*NodeInfo, error)

CreateMetaNode creates meta node.

func (*Client) CreateRetentionPolicy

func (c *Client) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec) (*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

CreateSubscription creats subscription in cluster.

func (*Client) Data

func (c *Client) Data() *Data

Data returns a reference of data.

func (*Client) DataNode

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

DataNode returns a node by id.

func (*Client) DataNodeByHTTPHost

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

DataNodeByHTTPHost returns the data node with the give http bind address

func (*Client) DataNodeByTCPHost

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

DataNodeByTCPHost returns the data node with the give http bind address

func (*Client) DataNodes

func (c *Client) DataNodes() (NodeInfos, error)

DataNodes returns the data nodes' info.

func (*Client) Database

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

Database returns info for the requested database.

func (*Client) Databases

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

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

DeleteMetaNode deletes meta node from meta store according to nodeID.

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

DropContinuousQuery drops continue query in cluster.

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

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

DropSubscription drops subscription in cluster.

func (*Client) JoinMetaServer

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

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

func (*Client) Leave

func (c *Client) Leave() error

Leave send leave command into cluster

func (*Client) Logger

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

Logger return a reference of logger.

func (*Client) MarshalBinary

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

MarshalBinary marshals data into a bianry form.

func (*Client) MetaNodeByAddr

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

MetaNodeByAddr returns the meta node's info.

func (*Client) MetaNodes

func (c *Client) MetaNodes() (NodeInfos, error)

MetaNodes returns the meta nodes' info.

func (*Client) MetaServers

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

MetaServers returns all meta node info in cluster.

func (*Client) NodeID

func (c *Client) NodeID() uint64

NodeID returns the client's node ID.

func (*Client) Open

func (c *Client) Open() error

Open a connection to a meta service cluster.

func (*Client) Path

func (c *Client) Path() string

Path retusn meta data's path.

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

func (c *Client) RemovePendingShardOwner(id, nodeid uint64) error

RemovePendingShardOwner removes a pending shardOwner according to shardID and nodeID.

func (*Client) RemoveShardOwner

func (c *Client) RemoveShardOwner(id, nodeid uint64) error

RemoveShardOwner removes shardOwner according to shardID and nodeID.

func (*Client) RetentionPolicy

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

RetentionPolicy returns the requested retention policy info.

func (*Client) SetData

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

SetData sets data.

func (*Client) SetDefaultRetentionPolicy

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

SetDefaultRetentionPolicy sets a database's default retention policy.

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(httpClient *http.Client)

SetHTTPClient sets httpClient.

func (*Client) SetLogger

func (c *Client) SetLogger(l *log.Logger)

SetLogger sets logger.

func (*Client) SetMetaServers

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

SetMetaServers updates the meta servers on the client.

func (*Client) SetPath

func (c *Client) SetPath(path string)

SetPath will set path as new path in this meta node

func (*Client) SetTLS

func (c *Client) SetTLS(v bool)

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 meta.ShardGroupInfos, 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) ShardOwner

func (c *Client) ShardOwner(shardID uint64) (database, policy string, si *meta.ShardInfo)

ShardOwner returns the owning shard group info for a specific shard.

func (*Client) ShardPendingOwners

func (c *Client) ShardPendingOwners() uint64arr

ShardPendingOwners returns an array of all pending ShardOwners.

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

func (c *Client) TLS() bool

TLS return true if tls mode is enabled.

func (*Client) UpdateDataNode

func (c *Client) UpdateDataNode(id uint64, host, tcpHost string) error

UpdateDataNode updates data node info according nodeID.

func (*Client) UpdateRetentionPolicy

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

UpdateRetentionPolicy updates a retention policy.

func (*Client) WaitForDataChanged

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

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

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
	BindAddress string `toml:"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 NewDemoConfig

func NewDemoConfig() *Config

NewDemoConfig creates a new default config.

func (*Config) ApplyEnvOverrides

func (c *Config) ApplyEnvOverrides() error

ApplyEnvOverrides apply the environment configuration on top of the config.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates a config.

type Data

type Data struct {
	// This is coupled with influxdb's implementation, but the structure is pretty
	// stable, hence we can use it.
	*meta.Data
	MetaNodes NodeInfos
	DataNodes NodeInfos
	MaxNodeID uint64
	ClusterID uint64
}

Data represents the top level collection of all metadata.

func (*Data) AddPendingShardOwner

func (data *Data) AddPendingShardOwner(id uint64)

AddPendingShardOwner adds a pending shardOwner according to nodeID.

func (*Data) AddShardOwner

func (data *Data) AddShardOwner(shardID, nodeID uint64) error

AddShardOwner will update a shards labelled by shardID in this node if such shards ownby this newly adding node

func (*Data) Clone

func (data *Data) Clone() *Data

Clone returns a copy of data with a new version.

func (*Data) CreateDataNode

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

CreateDataNode adds a node to the metadata.

func (*Data) CreateMetaNode

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

CreateMetaNode creats a meta node info according to host and tcpHost. NodeID are automaitically generated by program itself.

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

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

DataNode returns a node by id.

func (*Data) DeleteDataNode

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

DeleteDataNode removes a node from the Meta store.

If necessary, DeleteDataNode reassigns ownerhip 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 remove a meta node info from metastore according to nodeID. Data resides in that node will be also removed. It is buggy for now. Improvement is scheduled in future. TODO.

func (*Data) ImportData

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

ImportData imports a binary form data as metastore data. Return error if such binary form is invalid.

func (*Data) MarshalBinary

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

MarshalBinary marshals data into a binary form.

func (*Data) MetaNode

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

MetaNode return meta node info according to nodeID

func (*Data) PruneShard

func (data *Data) PruneShard(si *meta.ShardInfo, nodeID uint64) ([]meta.ShardOwner, error)

PruneShard prunes shard according to nodeID.

func (*Data) RemovePendingShardOwner

func (data *Data) RemovePendingShardOwner(id uint64)

RemovePendingShardOwner removes a pending shardOwner according to nodeID.

func (*Data) RemoveShardOwner

func (data *Data) RemoveShardOwner(shardID, nodeID uint64) error

RemoveShardOwner will remove all shards in this node if such shard owned by this node

func (*Data) SetMetaNode

func (data *Data) SetMetaNode(nodeID uint64, host, tcpHost string) error

SetMetaNode adds a meta node with a pre-specified nodeID.

func (*Data) ShardLocation

func (data *Data) ShardLocation(shardID uint64) (*meta.ShardInfo, error)

ShardLocation return NodeInfos which is the o of the Shard

func (*Data) TruncateShardsGrops

func (data *Data) TruncateShardsGrops(sg *meta.ShardGroupInfo) error

TruncateShardsGrops truncates shardsGroup according to shardsGroupID

func (*Data) UnmarshalBinary

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

UnmarshalBinary decodes the object from a binary format.

func (*Data) UpdateDataNode

func (data *Data) UpdateDataNode(nodeID uint64, host, tcpHost string) error

UpdateDataNode updates a data node info according to is nodeID.

func (*Data) UpdateShard

func (data *Data) UpdateShard(shardID uint64, newOwners []meta.ShardOwner) error

UpdateShard will update ShardOwner of a Shard according to ShardID

type Lease

type Lease struct {
	Name       string    `json:"name"`
	Expiration time.Time `json:"expiration"`
	Owner      uint64    `json:"owner"`
}

Lease is a lease distributed over cluster.

type Leases

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

Leases is a wrapper for many leases.

func NewLeases

func NewLeases(d time.Duration) *Leases

NewLeases creates new leases.

func (*Leases) Acquire

func (leases *Leases) Acquire(name string, nodeID uint64) (*Lease, error)

Acquire acquires lease according to lease name and nodeID.

type NodeInfo

type NodeInfo struct {
	ID                 uint64
	Host               string
	TCPHost            string
	PendingShardOwners uint64arr
}

NodeInfo represents information about a single node in the cluster.

type NodeInfos

type NodeInfos []NodeInfo

NodeInfos is a slice of NodeInfo used for sorting

func (NodeInfos) Len

func (n NodeInfos) Len() int

func (NodeInfos) Less

func (n NodeInfos) Less(i, j int) bool

func (NodeInfos) Swap

func (n NodeInfos) Swap(i, j int)

type Peers

type Peers []string

Peers represents meta node's peer host addres

func (Peers) Append

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

Append appends a/many peers.

func (Peers) Contains

func (peers Peers) Contains(peer string) bool

Contains return true if peer is in Peers.

func (Peers) Unique

func (peers Peers) Unique() Peers

Unique remove duplicated elements in peers and return a new Peers.

type Service

type Service struct {
	RaftListener net.Listener

	Logger zap.Logger

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

Service provides cluster service.

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

func (s *Service) RemoteHTTPAddr(addr string) string

RemoteHTTPAddr returns a remote httpAddr according to a addr.

func (*Service) RemoteRaftAddr

func (s *Service) RemoteRaftAddr() string

RemoteRaftAddr returns a remote raft httpAddr.

func (*Service) ResetStore

func (s *Service) ResetStore(st *store)

ResetStore resets store.

func (*Service) SetVersion

func (s *Service) SetVersion(version string)

SetVersion sets version.

func (*Service) Version

func (s *Service) Version() string

Version return current handler's version.

func (*Service) WithLogger

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

WithLogger sets the internal logger to the logger passed in

type ShardOwners

type ShardOwners []meta.ShardOwner

ShardOwners is an array ot ShardOwner.

func (ShardOwners) Len

func (so ShardOwners) Len() int

func (ShardOwners) Less

func (so ShardOwners) Less(i, j int) bool

func (ShardOwners) Swap

func (so ShardOwners) Swap(i, j int)

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