partmgr

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 14 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeToDHM

func TimeToDHM(tmilli int64) (int, int)

Convert a time in milliseconds to day and hour integers

Types

type DBPartition

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

func NewDBPartition

func NewDBPartition(pmgr *PartitionManager, startTime int64, path string) (*DBPartition, error)

Create and initialize a new partition

func NewDBPartitionFromMap added in v0.9.2

func NewDBPartitionFromMap(pmgr *PartitionManager, startTime int64, path string, item v3io.Item) (*DBPartition, error)

Create and initialize a new partition

func (*DBPartition) AggrBuckets

func (p *DBPartition) AggrBuckets() int

func (*DBPartition) AggrType

func (p *DBPartition) AggrType() aggregate.AggrType

func (*DBPartition) ChunkID2Attr

func (p *DBPartition) ChunkID2Attr(col string, id int) string

Return the attribute name of the given chunk

func (*DBPartition) GetAggregationBucketEndTime added in v0.9.17

func (p *DBPartition) GetAggregationBucketEndTime(id int) int64

Return the end time of an aggregation bucket by id

func (*DBPartition) GetAggregationBucketStartTime added in v0.9.17

func (p *DBPartition) GetAggregationBucketStartTime(id int) int64

Return the start time of an aggregation bucket by id

func (*DBPartition) GetChunkMint

func (p *DBPartition) GetChunkMint(t int64) int64

Return the nearest chunk start time for the specified time

func (*DBPartition) GetChunkStartTimeByAttr added in v0.9.17

func (p *DBPartition) GetChunkStartTimeByAttr(attr string) (int64, error)

Get a chunk's start time by it's attribute name

func (*DBPartition) GetEndTime added in v0.0.3

func (p *DBPartition) GetEndTime() int64

func (*DBPartition) GetHashingBuckets added in v0.0.3

func (p *DBPartition) GetHashingBuckets() int

func (*DBPartition) GetMetricPath added in v0.0.3

func (p *DBPartition) GetMetricPath(name string, hash uint64, labelNames []string, isAggr bool) string

Return the full path to the specified metric item

func (*DBPartition) GetPartitionAttributeName added in v0.9.14

func (p *DBPartition) GetPartitionAttributeName() string

Return the name of this partition's attribute name

func (*DBPartition) GetPartitionRange added in v0.0.3

func (p *DBPartition) GetPartitionRange() (int64, int64)

Return the start time (mint) and end time (maxt) for this partition; maxt may be required for a cyclic partition

func (*DBPartition) GetShardingKeys added in v0.0.3

func (p *DBPartition) GetShardingKeys(name string) []string

Return a list of sharding keys matching the given item name

func (*DBPartition) GetStartTime added in v0.0.3

func (p *DBPartition) GetStartTime() int64

func (*DBPartition) GetTablePath added in v0.0.3

func (p *DBPartition) GetTablePath() string

Return the path to this partition's TSDB table

func (*DBPartition) InChunkRange

func (p *DBPartition) InChunkRange(mint, t int64) bool

Check whether the specified time (t) is within the range of the chunk starting at the specified start time (mint)

func (*DBPartition) InRange

func (p *DBPartition) InRange(t int64) bool

Check whether the specified time is within the range of this partition

func (*DBPartition) IsAheadOfChunk

func (p *DBPartition) IsAheadOfChunk(mint, t int64) bool

Check whether the specified time (t) is ahead of the range of the chunk starting at the specified start time (mint)

func (*DBPartition) IsChunkInRangeByAttr added in v0.9.17

func (p *DBPartition) IsChunkInRangeByAttr(attr string, mint, maxt int64) bool

Check if a chunk (by attribute name) is in the given time range.

func (*DBPartition) IsCyclic

func (p *DBPartition) IsCyclic() bool

func (*DBPartition) NextPart

func (p *DBPartition) NextPart(t int64) (*DBPartition, error)

func (*DBPartition) PreAggregates added in v0.8.8

func (p *DBPartition) PreAggregates() []config.PreAggregate

func (*DBPartition) Range2Attrs

func (p *DBPartition) Range2Attrs(col string, mint, maxt int64) ([]string, int64)

Return the attributes that need to be retrieved for the specified time range

func (*DBPartition) Range2Cids

func (p *DBPartition) Range2Cids(mint, maxt int64) []int

Return a list of all the chunk IDs that match the specified time range

func (*DBPartition) RollupTime

func (p *DBPartition) RollupTime() int64

func (*DBPartition) Time2Bucket

func (p *DBPartition) Time2Bucket(t int64) int

Return the aggregation bucket ID for the specified time

func (*DBPartition) TimePerChunk added in v0.0.3

func (p *DBPartition) TimePerChunk() int64

Return the time range covered by a single chunk (the chunk interval)

func (*DBPartition) TimeToChunkID added in v0.9.15

func (p *DBPartition) TimeToChunkID(tmilli int64) (int, error)

Return the ID of the chunk whose range includes the specified time

func (*DBPartition) Times2BucketRange added in v0.9.17

func (p *DBPartition) Times2BucketRange(start, end int64) []int

func (*DBPartition) ToMap added in v0.9.2

func (p *DBPartition) ToMap() map[string]interface{}

type PartitionManager

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

func NewPartitionMngr

func NewPartitionMngr(schemaConfig *config.Schema, cont v3io.Container, v3ioConfig *config.V3ioConfig) (*PartitionManager, error)

Create a new partition manager

func (*PartitionManager) DeletePartitionsFromSchema added in v0.0.10

func (p *PartitionManager) DeletePartitionsFromSchema(partitionsToDelete []*DBPartition) error

func (*PartitionManager) GetConfig

func (p *PartitionManager) GetConfig() *config.Schema

func (*PartitionManager) GetPartitionsPaths added in v0.0.7

func (p *PartitionManager) GetPartitionsPaths() []string

func (*PartitionManager) GetPartitionsTablePath added in v0.9.2

func (p *PartitionManager) GetPartitionsTablePath() string

func (*PartitionManager) GetSchemaFilePath added in v0.9.14

func (p *PartitionManager) GetSchemaFilePath() string

func (*PartitionManager) Init

func (p *PartitionManager) Init() error

func (*PartitionManager) PartsForRange

func (p *PartitionManager) PartsForRange(mint, maxt int64, inclusive bool) []*DBPartition

if inclusive is true than partial partitions (not fully in range) will be retireved as well

func (*PartitionManager) Path added in v0.0.12

func (p *PartitionManager) Path() string

func (*PartitionManager) ReadAndUpdateSchema added in v0.0.8

func (p *PartitionManager) ReadAndUpdateSchema() (err error)

func (*PartitionManager) TimeToPart

func (p *PartitionManager) TimeToPart(t int64) (*DBPartition, error)

Jump to

Keyboard shortcuts

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