Documentation ¶
Index ¶
- type ChunkInfo
- type JIterator
- func (jit *JIterator) Close() error
- func (jit *JIterator) CurrentPos() records.IteratorPos
- func (jit *JIterator) Get(ctx context.Context) (records.Record, error)
- func (jit *JIterator) Next(ctx context.Context)
- func (jit *JIterator) Pos() journal.Pos
- func (jit *JIterator) Release()
- func (jit *JIterator) SetBackward(bkwrd bool)
- func (jit *JIterator) SetPos(pos journal.Pos)
- func (jit *JIterator) String() string
- type OnTruncateF
- type PartitionInfo
- type PartitionsInfo
- type Service
- func (s *Service) GetJournals(ctx context.Context, tagsCond *lql.Source, maxLimit int) (map[tag.Line]journal.Journal, error)
- func (s *Service) GetParitionInfo(tags string) (PartitionInfo, error)
- func (s *Service) GetTmIndexRebuilder() TmIndexRebuilder
- func (s *Service) GetTsIndexer() tmindex.TsIndexer
- func (s *Service) GetWriteEvent(ctx context.Context) (WriteEvent, error)
- func (s *Service) Init(ctx context.Context) error
- func (s *Service) Partitions(ctx context.Context, expr *lql.Source, offset, limit int) (*PartitionsInfo, error)
- func (s *Service) Release(jn string)
- func (s *Service) Shutdown()
- func (s *Service) Truncate(ctx context.Context, tp TruncateParams, otf OnTruncateF) error
- func (s *Service) Write(ctx context.Context, tags string, lit model.Iterator, noEvent bool) error
- type TmIndexRebuilder
- type TruncateInfo
- type TruncateParams
- type WriteEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkInfo ¶
type ChunkInfo struct { // Id the chunk id Id chunk.Id // Size contains chunk size in bytes Size int64 // Records contains number of records in the chunk Records uint32 // MinTs contains minimal timestamp value for the chunk records MinTs int64 // MaxTs contains maximal timestamp value for the chunk records MaxTs int64 // Comment any supplemental info Comment string }
ChunkInfo struct desribes a chunk
type JIterator ¶ added in v0.1.0
type JIterator struct {
// contains filtered or unexported fields
}
JIterator struct provides records.Iterator implementation on top of a journal.Journal. The implementation allows to use an position selector solution (chkSelector) which uses time-index itself for smart positioning in the iterator.
func NewJIterator ¶ added in v0.1.0
func NewJIterator(tmRange model.TimeRange, jrnl journal.Journal, tmidx tmindex.TsIndexer, tmRebuilder TmIndexRebuilder) *JIterator
NewJIterator constructs new JIterator instance
func (*JIterator) CurrentPos ¶ added in v0.1.0
func (jit *JIterator) CurrentPos() records.IteratorPos
func (*JIterator) SetBackward ¶ added in v0.1.0
type OnTruncateF ¶
type OnTruncateF func(ti TruncateInfo)
type PartitionInfo ¶
type PartitionInfo struct { // Tags contains the partition tags Tags tag.Set // Size contains the size of the partition Size uint64 // Records contains number of records in the partition Records uint64 //Journal id contains the journal identifier JournalId string // Chunks contains information about the journal chunks Chunks []*ChunkInfo }
Describes a partition info
type PartitionsInfo ¶
type PartitionsInfo struct { // Partitions contains list of partitions for the query (with limit and offset) Partitions []*PartitionInfo // Count contains total number of partitions found Count int // TotalSize contains summarized size of all partitions which match the criteria TotalSize uint64 // TotalRecords contains summarized number of records in all matched partitions TotalRecords uint64 }
PartitionsInfo contains information about partitions for the query
type Service ¶
type Service struct { Pool *bytes.Pool `inject:""` Journals journal.Controller `inject:""` TIndex tindex.Service `inject:""` MainCtx context.Context `inject:"mainCtx"` TsIndexer tmindex.TsIndexer `inject:""` // contains filtered or unexported fields }
Service struct provides functionality and some functions to work with partitions(LogEvent journals)
func NewService ¶
func NewService() *Service
NewService creates new service for controlling partitions
func (*Service) GetJournals ¶
func (s *Service) GetJournals(ctx context.Context, tagsCond *lql.Source, maxLimit int) (map[tag.Line]journal.Journal, error)
GetJournals is part of cursor.JournalsProvider
func (*Service) GetParitionInfo ¶
func (s *Service) GetParitionInfo(tags string) (PartitionInfo, error)
GetParitionInfo returns a partition info using its unique tags combination
func (*Service) GetTmIndexRebuilder ¶ added in v0.1.0
func (s *Service) GetTmIndexRebuilder() TmIndexRebuilder
TmIndexRebuilder returns the time index rebuilder
func (*Service) GetTsIndexer ¶ added in v0.1.0
GetIsIndexer returns TsIndexer object
func (*Service) GetWriteEvent ¶
func (s *Service) GetWriteEvent(ctx context.Context) (WriteEvent, error)
GetWriteEvent reads next write event. It blocks caller until the contex is closed or new event comes
func (*Service) Partitions ¶
func (s *Service) Partitions(ctx context.Context, expr *lql.Source, offset, limit int) (*PartitionsInfo, error)
Partitions function returns list of partitions with tags, that match to tagsCond with the specific offset and limit in the result
func (*Service) Release ¶
Release releases the partition. Journal must not be used after the call. This is part of cursor.JournalsProvider
func (*Service) Truncate ¶
func (s *Service) Truncate(ctx context.Context, tp TruncateParams, otf OnTruncateF) error
Truncate walks over matched journals and truncate the chunks, if needed
type TmIndexRebuilder ¶ added in v0.1.0
type TmIndexRebuilder interface { // RebuildIndex sends request for rebuilding time index. It works asynchronusly // and should not block the go-routine // if force is true the index will be rebuilt even if it is alive RebuildIndex(src string, cid chunk.Id, force bool) }
TmIndexRebuilder allows to send requests for rebuilding corrupted time index data
type TruncateInfo ¶
type TruncateInfo struct { // LatestTs contains timestamp for latest record in the partition LatestTs int64 Tags tag.Set Src string BeforeSize uint64 AfterSize uint64 BeforeRecs uint64 AfterRecs uint64 ChunksDeleted int Deleted bool }
TruncateInfo describes a truncated partition information
type TruncateParams ¶
type TruncateParams struct { DryRun bool // TagsExpr contains the tags condition to select journals to be truncated TagsExpr *lql.Source // MaxSrcSize defines the upper level of a partition size, which will be truncated, if reached MaxSrcSize uint64 // MinSrcSize defines the lower level of a partition size, which will not be cut if the partition will be less // than this parameter after truncation MinSrcSize uint64 // OldestTs defines the oldest record timestamp. Chunks with records less than the parameter are candidates // for truncation OldestTs int64 // Max Global size MaxDBSize uint64 }
TruncateParams allows to provide parameters for Truncate() functions
func (TruncateParams) String ¶
func (tp TruncateParams) String() string