Documentation ¶
Overview ¶
Package core contains the implementation of Tatris core features
Index ¶
- Constants
- func BuildDocuments(index *Index, docs []protocol.Document) error
- func CheckDocument(index *Index, doc protocol.Document) error
- func MergeSegmentReader(config *indexlib.Config, segments ...*Segment) (indexlib.Reader, error)
- type Index
- func (index *Index) AddProperties(addProperties map[string]*protocol.Property)
- func (index *Index) Destroy() error
- func (index *Index) GetName() string
- func (index *Index) GetReadersByTime(start, end int64) (indexlib.Reader, error)
- func (index *Index) GetSegmentsByTime(start, end int64) []*Segment
- func (index *Index) GetShard(idx int) *Shard
- func (index *Index) GetShardByRouting() *Shard
- func (index *Index) GetShardNum() int
- func (index *Index) GetShards() []*Shard
- type Segment
- func (segment *Segment) Destroy()
- func (segment *Segment) GetName() string
- func (segment *Segment) GetReader() (indexlib.Reader, error)
- func (segment *Segment) GetWriter() (indexlib.Writer, error)
- func (segment *Segment) IsMature() bool
- func (segment *Segment) MatchTime(start, end int64) bool
- func (segment *Segment) OnMature()
- func (segment *Segment) Readonly() bool
- func (segment *Segment) Status() uint8
- func (segment *Segment) UpdateStat(min, max time.Time, docs int64)
- type SegmentStat
- type Shard
- func (shard *Shard) CheckSegments()
- func (shard *Shard) Destroy() error
- func (shard *Shard) ForceAddSegment()
- func (shard *Shard) GetLatestSegment() *Segment
- func (shard *Shard) GetLatestSegmentID() int
- func (shard *Shard) GetName() string
- func (shard *Shard) GetSegment(idx int) *Segment
- func (shard *Shard) GetSegmentNum() int
- func (shard *Shard) GetSegments() []*Segment
- func (shard *Shard) UpdateStat(min, max time.Time, docs int64, wals uint64)
- type ShardStat
- type Stat
Constants ¶
View Source
const ( // SegmentStatusWritable means segment is the latest segment of shard and is writable. // GetReaders returns a reader from the underlying writer, which can be used to search data near // real-time. SegmentStatusWritable uint8 = iota // SegmentStatusReadonly means segment is readonly. So the writer is always nil, and GetWriter // returns an error. // GetReader uses ReaderCache to ensure opening same only once. SegmentStatusReadonly )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Index ¶
type Index struct { *protocol.Index Shards []*Shard `json:"shards"` // contains filtered or unexported fields }
func (*Index) AddProperties ¶
func (*Index) GetReadersByTime ¶
func (*Index) GetSegmentsByTime ¶
func (*Index) GetShardByRouting ¶
GetShardByRouting TODO: build the real route, temporarily think that there is always only 1 shard
func (*Index) GetShardNum ¶
type Segment ¶
type Segment struct { Shard *Shard `json:"-"` SegmentID int Stat SegmentStat SegmentStatus uint8 // contains filtered or unexported fields }
func (*Segment) GetReader ¶
GetReader returns a reader snapshot of current segment. So docs wrote this func returns are invisible to returned reader. Returned reader must be closed after use.
type SegmentStat ¶
type Shard ¶
type Shard struct { Index *Index `json:"-"` ShardID int Segments []*Segment Stat ShardStat Wal log.WalLog `json:"-"` // contains filtered or unexported fields }
Shard is a logical split of the index
func (*Shard) CheckSegments ¶
func (shard *Shard) CheckSegments()
func (*Shard) ForceAddSegment ¶
func (shard *Shard) ForceAddSegment()
ForceAddSegment forces adding a segment to current shard
func (*Shard) GetLatestSegment ¶
func (*Shard) GetLatestSegmentID ¶
func (*Shard) GetSegment ¶
func (*Shard) GetSegmentNum ¶
func (*Shard) GetSegments ¶
Directories ¶
Path | Synopsis |
---|---|
Package config maintains global control parameters for Tatris
|
Package config maintains global control parameters for Tatris |
Package wal organizes the entire Write-Ahead-Log program of Tatris
|
Package wal organizes the entire Write-Ahead-Log program of Tatris |
log
Package log defines the abstract public trait of WAL behavior
|
Package log defines the abstract public trait of WAL behavior |
tidwall
Package tidwall encapsulates the WAL solution implemented by tidwall/wal
|
Package tidwall encapsulates the WAL solution implemented by tidwall/wal |
Click to show internal directories.
Click to hide internal directories.