Documentation
¶
Index ¶
- Constants
- Variables
- func NewScorch(storeName string, config map[string]interface{}, ...) (index.Index, error)
- type Event
- type EventKind
- type IndexSnapshot
- func (i *IndexSnapshot) AddRef()
- func (i *IndexSnapshot) DecRef() (err error)
- func (i *IndexSnapshot) DocCount() (uint64, error)
- func (i *IndexSnapshot) DocIDReaderAll() (index.DocIDReader, error)
- func (i *IndexSnapshot) DocIDReaderOnly(ids []string) (index.DocIDReader, error)
- func (i *IndexSnapshot) Document(id string) (rv *document.Document, err error)
- func (i *IndexSnapshot) DocumentVisitFieldTerms(id index.IndexInternalID, fields []string, ...) error
- func (i *IndexSnapshot) ExternalID(id index.IndexInternalID) (string, error)
- func (i *IndexSnapshot) FieldDict(field string) (index.FieldDict, error)
- func (i *IndexSnapshot) FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error)
- func (i *IndexSnapshot) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
- func (i *IndexSnapshot) Fields() ([]string, error)
- func (i *IndexSnapshot) GetInternal(key []byte) ([]byte, error)
- func (i *IndexSnapshot) Internal() map[string][]byte
- func (i *IndexSnapshot) InternalID(id string) (rv index.IndexInternalID, err error)
- func (i *IndexSnapshot) Segments() []*SegmentSnapshot
- func (i *IndexSnapshot) TermFieldReader(term []byte, field string, includeFreq, includeNorm, includeTermVectors bool) (index.TermFieldReader, error)
- type IndexSnapshotDocIDReader
- type IndexSnapshotFieldDict
- func (i *IndexSnapshotFieldDict) Close() error
- func (i *IndexSnapshotFieldDict) Len() int
- func (i *IndexSnapshotFieldDict) Less(a, b int) bool
- func (i *IndexSnapshotFieldDict) Next() (*index.DictEntry, error)
- func (i *IndexSnapshotFieldDict) Pop() interface{}
- func (i *IndexSnapshotFieldDict) Push(x interface{})
- func (i *IndexSnapshotFieldDict) Swap(a, b int)
- type IndexSnapshotTermFieldReader
- func (i *IndexSnapshotTermFieldReader) Advance(ID index.IndexInternalID, preAlloced *index.TermFieldDoc) (*index.TermFieldDoc, error)
- func (i *IndexSnapshotTermFieldReader) Close() error
- func (i *IndexSnapshotTermFieldReader) Count() uint64
- func (i *IndexSnapshotTermFieldReader) Next(preAlloced *index.TermFieldDoc) (*index.TermFieldDoc, error)
- type Reader
- func (r *Reader) Close() error
- func (r *Reader) DocCount() (uint64, error)
- func (r *Reader) DocIDReaderAll() (index.DocIDReader, error)
- func (r *Reader) DocIDReaderOnly(ids []string) (index.DocIDReader, error)
- func (r *Reader) Document(id string) (*document.Document, error)
- func (r *Reader) DocumentVisitFieldTerms(id index.IndexInternalID, fields []string, ...) error
- func (r *Reader) DumpAll() chan interface{}
- func (r *Reader) DumpDoc(id string) chan interface{}
- func (r *Reader) DumpFields() chan interface{}
- func (r *Reader) ExternalID(id index.IndexInternalID) (string, error)
- func (r *Reader) FieldDict(field string) (index.FieldDict, error)
- func (r *Reader) FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error)
- func (r *Reader) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
- func (r *Reader) Fields() ([]string, error)
- func (r *Reader) GetInternal(key []byte) ([]byte, error)
- func (r *Reader) InternalID(id string) (index.IndexInternalID, error)
- func (r *Reader) TermFieldReader(term []byte, field string, includeFreq, includeNorm, includeTermVectors bool) (index.TermFieldReader, error)
- type RollbackPoint
- type Scorch
- func (s *Scorch) AddEligibleForRemoval(epoch uint64)
- func (s *Scorch) Advanced() (store.KVStore, error)
- func (s *Scorch) Analyze(d *document.Document) *index.AnalysisResult
- func (s *Scorch) Batch(batch *index.Batch) (err error)
- func (s *Scorch) Close() (err error)
- func (s *Scorch) Delete(id string) error
- func (s *Scorch) DeleteInternal(key []byte) error
- func (s *Scorch) LoadSnapshot(epoch uint64) (rv *IndexSnapshot, err error)
- func (s *Scorch) MemoryUsed() uint64
- func (s *Scorch) Open() error
- func (s *Scorch) Reader() (index.IndexReader, error)
- func (s *Scorch) Rollback(to *RollbackPoint) error
- func (s *Scorch) RollbackPoints() ([]*RollbackPoint, error)
- func (s *Scorch) RootBoltSnapshotEpochs() ([]uint64, error)
- func (s *Scorch) SetInternal(key, val []byte) error
- func (s *Scorch) Stats() json.Marshaler
- func (s *Scorch) StatsMap() map[string]interface{}
- func (s *Scorch) Update(doc *document.Document) error
- type SegmentDictionarySnapshot
- func (s *SegmentDictionarySnapshot) Iterator() segment.DictionaryIterator
- func (s *SegmentDictionarySnapshot) PostingsList(term string, except *roaring.Bitmap) (segment.PostingsList, error)
- func (s *SegmentDictionarySnapshot) PrefixIterator(prefix string) segment.DictionaryIterator
- func (s *SegmentDictionarySnapshot) RangeIterator(start, end string) segment.DictionaryIterator
- type SegmentSnapshot
- func (s *SegmentSnapshot) Close() error
- func (s *SegmentSnapshot) Count() uint64
- func (s *SegmentSnapshot) Deleted() *roaring.Bitmap
- func (s *SegmentSnapshot) Dictionary(field string) (segment.TermDictionary, error)
- func (s *SegmentSnapshot) DocNumbers(docIDs []string) (*roaring.Bitmap, error)
- func (s *SegmentSnapshot) DocNumbersLive() *roaring.Bitmap
- func (s *SegmentSnapshot) Fields() []string
- func (s *SegmentSnapshot) FullSize() int64
- func (s *SegmentSnapshot) Id() uint64
- func (s SegmentSnapshot) LiveSize() int64
- func (s *SegmentSnapshot) Segment() segment.Segment
- func (s *SegmentSnapshot) VisitDocument(num uint64, visitor segment.DocumentFieldValueVisitor) error
- type Stats
Constants ¶
const Name = "scorch"
const Version uint8 = 1
Variables ¶
var DefaultChunkFactor uint32 = 1024
var DefaultMinSegmentsForInMemoryMerge = 2
DefaultMinSegmentsForInMemoryMerge represents the default number of in-memory zap segments that persistSnapshotMaybeMerge() needs to see in an IndexSnapshot before it decides to merge and persist those segments
var EventKindBatchIntroduction = EventKind(6)
EventKindBatchIntroduction is fired when Batch() completes.
var EventKindBatchIntroductionStart = EventKind(5)
EventKindBatchIntroductionStart is fired when Batch() is invoked which introduces a new segment.
var EventKindClose = EventKind(2)
EventKindClose is fired when a scorch index has been fully closed.
var EventKindCloseStart = EventKind(1)
EventKindCloseStart is fired when a Scorch.Close() has begun.
var EventKindMergerProgress = EventKind(3)
EventKindMergerProgress is fired when the merger has completed a round of merge processing.
var EventKindPersisterProgress = EventKind(4)
EventKindPersisterProgress is fired when the persister has completed a round of persistence processing.
var NumSnapshotsToKeep = 1
NumSnapshotsToKeep represents how many recent, old snapshots to keep around per Scorch instance. Useful for apps that require rollback'ability.
var RegistryAsyncErrorCallbacks = map[string]func(error){}
RegistryAsyncErrorCallbacks should be treated as read-only after process init()'ialization.
var RegistryEventCallbacks = map[string]func(Event){}
RegistryEventCallbacks should be treated as read-only after process init()'ialization.
var TermSeparator byte = 0xff
var TermSeparatorSplitSlice = []byte{TermSeparator}
Functions ¶
Types ¶
type IndexSnapshot ¶
type IndexSnapshot struct {
// contains filtered or unexported fields
}
func (*IndexSnapshot) AddRef ¶
func (i *IndexSnapshot) AddRef()
func (*IndexSnapshot) DecRef ¶
func (i *IndexSnapshot) DecRef() (err error)
func (*IndexSnapshot) DocCount ¶
func (i *IndexSnapshot) DocCount() (uint64, error)
func (*IndexSnapshot) DocIDReaderAll ¶
func (i *IndexSnapshot) DocIDReaderAll() (index.DocIDReader, error)
func (*IndexSnapshot) DocIDReaderOnly ¶
func (i *IndexSnapshot) DocIDReaderOnly(ids []string) (index.DocIDReader, error)
func (*IndexSnapshot) Document ¶
func (i *IndexSnapshot) Document(id string) (rv *document.Document, err error)
func (*IndexSnapshot) DocumentVisitFieldTerms ¶
func (i *IndexSnapshot) DocumentVisitFieldTerms(id index.IndexInternalID, fields []string, visitor index.DocumentFieldTermVisitor) error
func (*IndexSnapshot) ExternalID ¶
func (i *IndexSnapshot) ExternalID(id index.IndexInternalID) (string, error)
func (*IndexSnapshot) FieldDict ¶
func (i *IndexSnapshot) FieldDict(field string) (index.FieldDict, error)
func (*IndexSnapshot) FieldDictPrefix ¶
func (*IndexSnapshot) FieldDictRange ¶
func (*IndexSnapshot) Fields ¶
func (i *IndexSnapshot) Fields() ([]string, error)
func (*IndexSnapshot) GetInternal ¶
func (i *IndexSnapshot) GetInternal(key []byte) ([]byte, error)
func (*IndexSnapshot) Internal ¶
func (i *IndexSnapshot) Internal() map[string][]byte
func (*IndexSnapshot) InternalID ¶
func (i *IndexSnapshot) InternalID(id string) (rv index.IndexInternalID, err error)
func (*IndexSnapshot) Segments ¶
func (i *IndexSnapshot) Segments() []*SegmentSnapshot
func (*IndexSnapshot) TermFieldReader ¶
func (i *IndexSnapshot) TermFieldReader(term []byte, field string, includeFreq, includeNorm, includeTermVectors bool) (index.TermFieldReader, error)
type IndexSnapshotDocIDReader ¶
type IndexSnapshotDocIDReader struct {
// contains filtered or unexported fields
}
func (*IndexSnapshotDocIDReader) Advance ¶
func (i *IndexSnapshotDocIDReader) Advance(ID index.IndexInternalID) (index.IndexInternalID, error)
func (*IndexSnapshotDocIDReader) Close ¶
func (i *IndexSnapshotDocIDReader) Close() error
func (*IndexSnapshotDocIDReader) Next ¶
func (i *IndexSnapshotDocIDReader) Next() (index.IndexInternalID, error)
type IndexSnapshotFieldDict ¶
type IndexSnapshotFieldDict struct {
// contains filtered or unexported fields
}
func (*IndexSnapshotFieldDict) Close ¶
func (i *IndexSnapshotFieldDict) Close() error
func (*IndexSnapshotFieldDict) Len ¶
func (i *IndexSnapshotFieldDict) Len() int
func (*IndexSnapshotFieldDict) Less ¶
func (i *IndexSnapshotFieldDict) Less(a, b int) bool
func (*IndexSnapshotFieldDict) Next ¶
func (i *IndexSnapshotFieldDict) Next() (*index.DictEntry, error)
func (*IndexSnapshotFieldDict) Pop ¶
func (i *IndexSnapshotFieldDict) Pop() interface{}
func (*IndexSnapshotFieldDict) Push ¶
func (i *IndexSnapshotFieldDict) Push(x interface{})
func (*IndexSnapshotFieldDict) Swap ¶
func (i *IndexSnapshotFieldDict) Swap(a, b int)
type IndexSnapshotTermFieldReader ¶
type IndexSnapshotTermFieldReader struct {
// contains filtered or unexported fields
}
func (*IndexSnapshotTermFieldReader) Advance ¶
func (i *IndexSnapshotTermFieldReader) Advance(ID index.IndexInternalID, preAlloced *index.TermFieldDoc) (*index.TermFieldDoc, error)
func (*IndexSnapshotTermFieldReader) Close ¶
func (i *IndexSnapshotTermFieldReader) Close() error
func (*IndexSnapshotTermFieldReader) Count ¶
func (i *IndexSnapshotTermFieldReader) Count() uint64
func (*IndexSnapshotTermFieldReader) Next ¶
func (i *IndexSnapshotTermFieldReader) Next(preAlloced *index.TermFieldDoc) (*index.TermFieldDoc, error)
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) DocIDReaderAll ¶
func (r *Reader) DocIDReaderAll() (index.DocIDReader, error)
DocIDReader returns an iterator over all doc ids The caller must close returned instance to release associated resources.
func (*Reader) DocIDReaderOnly ¶
func (r *Reader) DocIDReaderOnly(ids []string) (index.DocIDReader, error)
func (*Reader) DocumentVisitFieldTerms ¶
func (r *Reader) DocumentVisitFieldTerms(id index.IndexInternalID, fields []string, visitor index.DocumentFieldTermVisitor) error
func (*Reader) DumpFields ¶
func (r *Reader) DumpFields() chan interface{}
func (*Reader) ExternalID ¶
func (r *Reader) ExternalID(id index.IndexInternalID) (string, error)
func (*Reader) FieldDictPrefix ¶
func (*Reader) FieldDictRange ¶
func (r *Reader) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
FieldDictRange is currently defined to include the start and end terms
func (*Reader) InternalID ¶
func (r *Reader) InternalID(id string) (index.IndexInternalID, error)
func (*Reader) TermFieldReader ¶
type RollbackPoint ¶
type RollbackPoint struct {
// contains filtered or unexported fields
}
func (*RollbackPoint) GetInternal ¶
func (r *RollbackPoint) GetInternal(key []byte) []byte
type Scorch ¶
type Scorch struct {
// contains filtered or unexported fields
}
func (*Scorch) AddEligibleForRemoval ¶
func (*Scorch) DeleteInternal ¶
func (*Scorch) LoadSnapshot ¶
func (s *Scorch) LoadSnapshot(epoch uint64) (rv *IndexSnapshot, err error)
LoadSnapshot loads the segment with the specified epoch NOTE: this is currently ONLY intended to be used by the command-line tool
func (*Scorch) MemoryUsed ¶
func (*Scorch) Reader ¶
func (s *Scorch) Reader() (index.IndexReader, error)
Reader returns a low-level accessor on the index data. Close it to release associated resources.
func (*Scorch) Rollback ¶
func (s *Scorch) Rollback(to *RollbackPoint) error
Rollback atomically and durably (if unsafeBatch is unset) brings the store back to the point in time as represented by the RollbackPoint. Rollback() should only be passed a RollbackPoint that came from the same store using the RollbackPoints() API.
func (*Scorch) RollbackPoints ¶
func (s *Scorch) RollbackPoints() ([]*RollbackPoint, error)
RollbackPoints returns an array of rollback points available for the application to rollback to, with more recent rollback points (higher epochs) coming first.
func (*Scorch) RootBoltSnapshotEpochs ¶
func (*Scorch) SetInternal ¶
type SegmentDictionarySnapshot ¶
type SegmentDictionarySnapshot struct {
// contains filtered or unexported fields
}
func (*SegmentDictionarySnapshot) Iterator ¶
func (s *SegmentDictionarySnapshot) Iterator() segment.DictionaryIterator
func (*SegmentDictionarySnapshot) PostingsList ¶
func (s *SegmentDictionarySnapshot) PostingsList(term string, except *roaring.Bitmap) (segment.PostingsList, error)
func (*SegmentDictionarySnapshot) PrefixIterator ¶
func (s *SegmentDictionarySnapshot) PrefixIterator(prefix string) segment.DictionaryIterator
func (*SegmentDictionarySnapshot) RangeIterator ¶
func (s *SegmentDictionarySnapshot) RangeIterator(start, end string) segment.DictionaryIterator
type SegmentSnapshot ¶
type SegmentSnapshot struct {
// contains filtered or unexported fields
}
func (*SegmentSnapshot) Close ¶
func (s *SegmentSnapshot) Close() error
func (*SegmentSnapshot) Count ¶
func (s *SegmentSnapshot) Count() uint64
func (*SegmentSnapshot) Deleted ¶
func (s *SegmentSnapshot) Deleted() *roaring.Bitmap
func (*SegmentSnapshot) Dictionary ¶
func (s *SegmentSnapshot) Dictionary(field string) (segment.TermDictionary, error)
func (*SegmentSnapshot) DocNumbers ¶
func (s *SegmentSnapshot) DocNumbers(docIDs []string) (*roaring.Bitmap, error)
func (*SegmentSnapshot) DocNumbersLive ¶
func (s *SegmentSnapshot) DocNumbersLive() *roaring.Bitmap
DocNumbersLive returns bitsit containing doc numbers for all live docs
func (*SegmentSnapshot) Fields ¶
func (s *SegmentSnapshot) Fields() []string
func (*SegmentSnapshot) FullSize ¶
func (s *SegmentSnapshot) FullSize() int64
func (*SegmentSnapshot) Id ¶
func (s *SegmentSnapshot) Id() uint64
func (SegmentSnapshot) LiveSize ¶
func (s SegmentSnapshot) LiveSize() int64
func (*SegmentSnapshot) Segment ¶
func (s *SegmentSnapshot) Segment() segment.Segment
func (*SegmentSnapshot) VisitDocument ¶
func (s *SegmentSnapshot) VisitDocument(num uint64, visitor segment.DocumentFieldValueVisitor) error
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package mergeplan provides a segment merge planning approach that's inspired by Lucene's TieredMergePolicy.java and descriptions like http://blog.mikemccandless.com/2011/02/visualizing-lucenes-segment-merges.html
|
Package mergeplan provides a segment merge planning approach that's inspired by Lucene's TieredMergePolicy.java and descriptions like http://blog.mikemccandless.com/2011/02/visualizing-lucenes-segment-merges.html |