Documentation ¶
Overview ¶
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func GenerateInternalID(unit IntervalUnit, suffix int) uint16
- func GlobalSeriesID(scope Entry) common.SeriesID
- func Hash(entry []byte) []byte
- func HashEntity(entity Entity) []byte
- func SeriesID(entity Entity) common.SeriesID
- func WalkDir(root, prefix string, walkFn WalkFn) error
- type BlockID
- type BlockState
- type Condition
- type Database
- type DatabaseOpts
- type EncodingMethod
- type Entity
- type Entry
- type GlobalItemID
- type IndexDatabase
- type IndexSeekBuilder
- type IndexWriter
- type IndexWriterBuilder
- type IntervalRule
- type IntervalUnit
- type Item
- type Iterator
- type Path
- type ScopedShard
- type Seeker
- type SeekerBuilder
- type Series
- type SeriesDatabase
- type SeriesList
- type SeriesSpan
- type Shard
- type ShardState
- type Supplier
- type WalkFn
- type Writer
- type WriterBuilder
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptySeriesSpan = errors.New("there is no data in such time range") ErrItemIDMalformed = errors.New("serialized item id is malformed") ErrBlockAbsent = errors.New("block is absent") )
var ( ErrInvalidShardID = errors.New("invalid shard id") ErrOpenDatabase = errors.New("fails to open the database") )
var AnyEntry = Entry(nil)
var ErrDuplicatedFamily = errors.New("duplicated family")
var ErrEndOfSegment = errors.New("reached the end of the segment")
var ErrNoTime = errors.New("no time specified")
var ErrNoVal = errors.New("no value specified")
var ErrUnsupportedIndexRule = errors.New("the index rule is not supported")
Functions ¶
func GenerateInternalID ¶
func GenerateInternalID(unit IntervalUnit, suffix int) uint16
func GlobalSeriesID ¶
func HashEntity ¶
Types ¶
type Condition ¶
type Condition map[string][]index.ConditionValue
type Database ¶
func OpenDatabase ¶
func OpenDatabase(ctx context.Context, opts DatabaseOpts) (Database, error)
type DatabaseOpts ¶
type DatabaseOpts struct { Location string ShardNum uint32 EncodingMethod EncodingMethod SegmentSize IntervalRule BlockSize IntervalRule }
type EncodingMethod ¶
type EncodingMethod struct { EncoderPool encoding.SeriesEncoderPool DecoderPool encoding.SeriesDecoderPool }
type GlobalItemID ¶
type GlobalItemID struct { ShardID common.ShardID SeriesID common.SeriesID ID common.ItemID // contains filtered or unexported fields }
func (*GlobalItemID) Marshal ¶
func (i *GlobalItemID) Marshal() []byte
func (*GlobalItemID) UnMarshal ¶
func (i *GlobalItemID) UnMarshal(data []byte) error
type IndexDatabase ¶
type IndexDatabase interface { WriterBuilder() IndexWriterBuilder Seek(field index.Field) ([]GlobalItemID, error) }
type IndexSeekBuilder ¶
type IndexSeekBuilder interface { }
type IndexWriter ¶
type IndexWriterBuilder ¶
type IndexWriterBuilder interface { Scope(scope Entry) IndexWriterBuilder Time(ts time.Time) IndexWriterBuilder GlobalItemID(itemID GlobalItemID) IndexWriterBuilder Build() (IndexWriter, error) }
type IntervalRule ¶
type IntervalRule struct { Unit IntervalUnit Num int }
func (IntervalRule) EstimatedDuration ¶
func (ir IntervalRule) EstimatedDuration() time.Duration
type IntervalUnit ¶
type IntervalUnit int
const ( HOUR IntervalUnit = iota DAY )
func (IntervalUnit) String ¶
func (iu IntervalUnit) String() string
type ScopedShard ¶
type ScopedShard struct {
// contains filtered or unexported fields
}
func (*ScopedShard) Close ¶
func (sd *ScopedShard) Close() error
func (*ScopedShard) ID ¶
func (sd *ScopedShard) ID() common.ShardID
func (*ScopedShard) Index ¶
func (sd *ScopedShard) Index() IndexDatabase
func (*ScopedShard) Series ¶
func (sd *ScopedShard) Series() SeriesDatabase
func (*ScopedShard) State ¶
func (sd *ScopedShard) State() ShardState
type SeekerBuilder ¶
type SeekerBuilder interface { Filter(indexRule *databasev1.IndexRule, condition Condition) SeekerBuilder OrderByIndex(indexRule *databasev1.IndexRule, order modelv1.Sort) SeekerBuilder OrderByTime(order modelv1.Sort) SeekerBuilder Build() (Seeker, error) }
type SeriesDatabase ¶
type SeriesList ¶
type SeriesList []Series
func (SeriesList) Len ¶
func (a SeriesList) Len() int
func (SeriesList) Less ¶
func (a SeriesList) Less(i, j int) bool
func (SeriesList) Swap ¶
func (a SeriesList) Swap(i, j int)
type SeriesSpan ¶
type SeriesSpan interface { io.Closer WriterBuilder() WriterBuilder SeekerBuilder() SeekerBuilder }
type Shard ¶
type Shard interface { io.Closer ID() common.ShardID Series() SeriesDatabase Index() IndexDatabase State() ShardState }
func NewScopedShard ¶
type ShardState ¶
type ShardState struct { Blocks []BlockState OpenBlocks []BlockID }
type Writer ¶
type Writer interface { IndexWriter Write() (GlobalItemID, error) ItemID() GlobalItemID String() string }
type WriterBuilder ¶
type WriterBuilder interface { Family(name []byte, val []byte) WriterBuilder Time(ts time.Time) WriterBuilder Val(val []byte) WriterBuilder Build() (Writer, error) }