constants

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIRoot represents api root path.
	APIRoot = "/api"
	// APIVersion1 represents api version 1 path.
	APIVersion1 = "/v1"
	// APIVersion1CliPath represents api version 1 path for client.
	APIVersion1CliPath = "/api/v1"
	// ContentTypeFlat represents flat buffer content type.
	ContentTypeFlat = "application/flatbuffer"
	// ContentTypeProto represents proto buffer content type.
	ContentTypeProto = "application/protobuf"
	// ContentTypeInflux represents influx content type.
	ContentTypeInflux = "application/influx"
)
View Source
const (
	MasterRole  = "Master"
	RootRole    = "Root"
	BrokerRole  = "Broker"
	StorageRole = "Storage"
)

defines the role type of node.

View Source
const (
	LiveNode        = "LiveNode"
	DatabaseConfig  = "DatabaseConfig"
	BrokerState     = "BrokerState"
	StorageState    = "StorageState"
	ShardAssignment = "ShardAssignment"
	Master          = "Master"
	StorageConfig   = "StorageConfig"
)

defines all metadata type.

View Source
const (
	// MasterPath represents master elect path.
	MasterPath = "/master/node"
	// MasterElectedPath represents register path after master finished election.
	MasterElectedPath = "/master/elected"
	// DatabaseConfigPath represents database config path.
	DatabaseConfigPath = "/database/config"
	// DatabaseLimitPath represents database limit path.
	DatabaseLimitPath = "/database/limit"
	// ShardAssignmentPath represents database shard assignment.
	ShardAssignmentPath = "/database/assign"
	// StorageConfigPath represents storage cluster's config.
	StorageConfigPath = "/storage/config"
	// StorageStatePath represents storage cluster's state.
	StorageStatePath = "/storage/state"
	// BrokerConfigPath represents broker cluster's config.
	BrokerConfigPath = "/broker/config"
)

defines broker level constants will be used in broker.

View Source
const (
	// ContextKeySQL represents sql key.
	ContextKeySQL = ContextKey("lin_ql")

	// CurrentSQL represents the key of current sql context.
	CurrentSQL = "LinDB_SQL"
)
View Source
const (
	RPCMetaKeyLogicNode   = "LogicNode"
	RPCMetaKeyDatabase    = "Database"
	RPCMetaKeyFamilyState = "FamilyState"
	RPCMetaReplicaState   = "ReplicaState"
)
View Source
const (
	// MaxSuggestions represents the max number of suggestions count
	MaxSuggestions = 100

	// MetricMaxAheadDuration controls the global max write ahead duration.
	// If current timestamp is 2021-08-19 23:00:00, metric after 2021-08-20 23:00:00 will be dropped.
	MetricMaxAheadDuration    = int64(24 * 60 * 60 * 1000)
	MetricMaxAheadDurationStr = "1d"
	// MetricMaxBehindDuration controls the global max write behind duration.
	// If current timestamp is 2021-08-19 23:00:00, metric before 2021-08-18 23:00:00 will be dropped.
	MetricMaxBehindDuration    = int64(24 * 60 * 60 * 1000)
	MetricMaxBehindDurationStr = "1d"
)
View Source
const LF = "\n"
View Source
const (
	// LiveNodesPath represents live nodes prefix path for node register.
	LiveNodesPath = "/live/nodes"
)

defines common constants will be used in broker and storage.

View Source
const StatePathSeparator = "/"

StatePathSeparator represents the separator of state store's path.

Variables

View Source
var (
	// ErrNotFound represents the data not found.
	ErrNotFound = errors.New("not found")
	// ErrTimeout represents exceed timeout.
	ErrTimeout = errors.New("exceed timeout")

	ErrTagValueFilterResultNotFound = fmt.Errorf("tag value fitler result %w", ErrNotFound)

	ErrDatabaseNotFound     = fmt.Errorf("database %w", ErrNotFound)
	ErrShardNotFound        = fmt.Errorf("shard %w", ErrNotFound)
	ErrReplicaNotFound      = fmt.Errorf("replica %w", ErrNotFound)
	ErrTargetNodesNotFound  = fmt.Errorf("target nodes %w", ErrNotFound)
	ErrReceiveNodesNotFound = fmt.Errorf("receive nodes %w", ErrNotFound)
	ErrMetricIDNotFound     = fmt.Errorf("metric %w", ErrNotFound)
	ErrTagKeyIDNotFound     = fmt.Errorf("tag key %w", ErrNotFound)
	ErrTagKeyMetaNotFound   = fmt.Errorf("tag key %w", ErrNotFound)
	ErrTagValueSeqNotFound  = fmt.Errorf("tagValueSeq %w", ErrNotFound)
	ErrTagValueIDNotFound   = fmt.Errorf("tag value %w", ErrNotFound)
	ErrFieldNotFound        = fmt.Errorf("field %w", ErrNotFound)
	ErrSeriesIDNotFound     = fmt.Errorf("seriesID %w", ErrNotFound)
	ErrDataFamilyNotFound   = fmt.Errorf("data family %w", ErrNotFound)
	ErrUnknownNodeChoose    = errors.New("unknown node choose")

	// ErrDataFileCorruption represents data in tsdb's file is corrupted
	ErrDataFileCorruption = errors.New("data corruption")

	ErrInfluxLineTooLong = errors.New("influx line is too long")

	ErrBadEnrichTagQueryFormat = errors.New("enrich_tag has the wrong format")
	// ErrNoLiveReplica represents no live replica node for current shard.
	ErrNoLiveReplica = errors.New("no live replica for shard")
	// ErrNoLiveNode represents no live node for current cluster.
	ErrNoLiveNode = errors.New("no live node for cluster")
	// ErrNameEmpty represents name is empty.
	ErrNameEmpty = errors.New("name cannot be empty")
	// ErrNoStorageCluster represents storage cluster not exist.
	ErrNoStorageCluster = errors.New("storage cluster not exist")
	// ErrStatefulNodeExist represents stateful node already register.
	ErrStatefulNodeExist = errors.New("stateful node already register")
	// ErrDatabaseNameRequired represents database not input.
	ErrDatabaseNameRequired = errors.New("database name cannot be empty")
	// ErrStorageNameRequired represents storage name not input.
	ErrStorageNameRequired = errors.New("storage name cannot be empty")
	// ErrEmptySelectList represents empty select list.
	ErrEmptySelectList = errors.New("select item list is empty")

	// ErrPartitionClosed represents paritition is already closed.
	ErrPartitionClosed = errors.New("partition is closed")

	ErrDatabaseNotExist       = errors.New("database not exist")
	ErrNoAvailableStorageNode = errors.New("no available storage node for server")

	// ErrTooManySeries represents the series be limited.
	ErrTooManySeries     = errors.New("too manay series")
	ErrTooManyMetadata   = errors.New("too manay namespace or metric")
	ErrNamespaceTooLong  = errors.New("namespace is too long")
	ErrMetricNameTooLong = errors.New("metric name is too long")
	ErrFieldNameTooLong  = errors.New("field name is too long")
	ErrTagKeyTooLong     = errors.New("tag key is too long")
	ErrTagValueTooLong   = errors.New("tag value is too long")
	// ErrTooManyTagKeys is the error returned by tsdb when
	// writes exceed the max limit of tag keys.
	ErrTooManyTagKeys = errors.New("too many tag keys")

	// ErrTooManyFields is the error returned by tsdb when
	// writes exceed the max limit of fields.
	ErrTooManyFields = errors.New("too many fields")
	// ErrTooManySeriesFound is the error returned max series limit of data query.
	ErrTooManySeriesFound = errors.New("found too many series")
)
View Source
var LBBytes = []byte(LF)

Functions

func GetBrokerClusterConfigPath added in v0.2.4

func GetBrokerClusterConfigPath(name string) string

GetBrokerClusterConfigPath returns path which storing config of broker cluster.

func GetDatabaseAssignPath

func GetDatabaseAssignPath(name string) string

GetDatabaseAssignPath returns path which storing shard assignment of database

func GetDatabaseConfigPath

func GetDatabaseConfigPath(name string) string

GetDatabaseConfigPath returns path which storing config of database

func GetDatabaseLimitPath added in v0.2.4

func GetDatabaseLimitPath(name string) string

GetDatabaseLimitPath returns path which storing limit of database

func GetLiveNodePath

func GetLiveNodePath(node string) string

GetLiveNodePath returns live node register path.

func GetStorageClusterConfigPath

func GetStorageClusterConfigPath(name string) string

GetStorageClusterConfigPath returns path which storing config of storage cluster

func GetStorageStatePath

func GetStorageStatePath(name string) string

Types

type ContextKey

type ContextKey string

ContextKey represents key type for context.

Jump to

Keyboard shortcuts

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