Documentation ¶
Index ¶
- Constants
- Variables
- func GetBrokerClusterConfigPath(name string) string
- func GetDatabaseAssignPath(name string) string
- func GetDatabaseConfigPath(name string) string
- func GetDatabaseLimitPath(name string) string
- func GetLiveNodePath(node string) string
- func GetShardAssignPath(name string) string
- func GetStorageLiveNodePath(node string) string
- type ContextKey
Constants ¶
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" // APIPrometheus represents prometheus api version 1 path APIPrometheus = "/prometheus" // APIPrometheusPrefix represent prometheus api prefix APIPrometheusPrefix = "/prometheus/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" )
const ( MasterRole = "Master" RootRole = "Root" BrokerRole = "Broker" StorageRole = "Storage" )
defines the role type of node.
const ( LiveNode = "LiveNode" DatabaseConfig = "DatabaseConfig" BrokerState = "BrokerState" StorageState = "StorageState" ShardAssignment = "ShardAssignment" Master = "Master" StorageConfig = "StorageConfig" )
defines all metadata type.
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. StorageLiveNodesPath = "/storage/live/nodes" // 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.
const ( // ContextKeySQL represents sql key. ContextKeySQL = ContextKey("lin_ql") // CurrentSQL represents the key of current sql context. CurrentSQL = "LinDB_SQL" )
const ( RPCMetaKeyLogicNode = "LogicNode" RPCMetaKeyDatabase = "Database" RPCMetaKeyFamilyState = "FamilyState" RPCMetaReplicaState = "ReplicaState" )
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" )
const LF = "\n"
const (
// LiveNodesPath represents live nodes prefix path for node register.
LiveNodesPath = "/live/nodes"
)
defines common constants will be used in broker and storage.
const StatePathSeparator = "/"
StatePathSeparator represents the separator of state store's path.
Variables ¶
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 many series") ErrTooManyNamespace = errors.New("too many namespace") ErrTooManyMetric = errors.New("too many metric name") 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") )
var LBBytes = []byte(LF)
Functions ¶
func GetBrokerClusterConfigPath ¶ added in v0.2.4
GetBrokerClusterConfigPath returns path which storing config of broker cluster.
func GetDatabaseAssignPath ¶
GetDatabaseAssignPath returns path which storing shard assignment of database
func GetDatabaseConfigPath ¶
GetDatabaseConfigPath returns path which storing config of database
func GetDatabaseLimitPath ¶ added in v0.2.4
GetDatabaseLimitPath returns path which storing limit of database
func GetLiveNodePath ¶
GetLiveNodePath returns live node register path for broker/root.
func GetShardAssignPath ¶ added in v0.4.0
GetShardAssignPath returns path which storing shard assignment of database.
func GetStorageLiveNodePath ¶ added in v0.4.0
GetStorageLiveNodePath returns live node register path for storage.