disk

package
v0.0.0-...-05bd1a1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PAD = 64

Variables

View Source
var EBADRQC = errors.New("bad length")
View Source
var EBADSLT = errors.New("checksum mismatch")

Functions

func DeleteUncompactedPostings

func DeleteUncompactedPostings(root string) error

func InvertedReadRaw

func InvertedReadRaw(root string, maxDocuments int32, tagKey, tagValue string) []int32

func ParseFile

func ParseFile(fd *os.File, off uint32) (uint32, map[string]uint32, error)

func ReadAllTermsInSegment

func ReadAllTermsInSegment(root string) (map[string][]uint32, error)

func WriteCompactedIndex

func WriteCompactedIndex(root string, segment map[string][]uint32) error

Types

type CompactIndexCache

type CompactIndexCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCompactIndexCache

func NewCompactIndexCache() *CompactIndexCache

func (*CompactIndexCache) FindPostingsList

func (c *CompactIndexCache) FindPostingsList(root, k, v string) []int32

type ForwardWriter

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

func NewForwardWriter

func NewForwardWriter(root string, name string) (*ForwardWriter, error)

func (*ForwardWriter) Append

func (fw *ForwardWriter) Append(encoded []byte) (uint32, error)

func (*ForwardWriter) Close

func (fw *ForwardWriter) Close() error

func (*ForwardWriter) Offset

func (fw *ForwardWriter) Offset() uint32

func (*ForwardWriter) Read

func (fw *ForwardWriter) Read(offset uint32) ([]byte, uint32, error)

func (*ForwardWriter) Scan

func (fw *ForwardWriter) Scan(offset uint32, cb func(uint32, []byte) error) error

func (*ForwardWriter) Size

func (fw *ForwardWriter) Size() (uint32, error)

func (*ForwardWriter) Sync

func (fw *ForwardWriter) Sync() error

type InvertedWriter

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

func NewInvertedWriter

func NewInvertedWriter(maxOpenDescriptors int) (*InvertedWriter, error)

func (*InvertedWriter) Append

func (fw *InvertedWriter) Append(root string, docId int32, tagKey, tagValue string) error

func (*InvertedWriter) Close

func (fw *InvertedWriter) Close()

func (*InvertedWriter) Size

func (fw *InvertedWriter) Size(root, tagKey, tagValue string) int32

type PersistedDictionary

type PersistedDictionary struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewPersistedDictionary

func NewPersistedDictionary(root string) (*PersistedDictionary, error)

func (*PersistedDictionary) Close

func (pd *PersistedDictionary) Close()

func (*PersistedDictionary) GetUniqueTerm

func (pd *PersistedDictionary) GetUniqueTerm(s string) (uint32, error)

func (*PersistedDictionary) Resolve

func (pd *PersistedDictionary) Resolve(s string) (uint32, bool)

func (*PersistedDictionary) ReverseResolve

func (pd *PersistedDictionary) ReverseResolve(s uint32) string

Jump to

Keyboard shortcuts

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