posting

package
v0.0.0-...-754cd28 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2015 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const Del = 0x02
View Source
const NBUCKETS = 32
View Source
const Set = 0x01

Variables

View Source
var E_TMP_ERROR = errors.New("Temporary Error. Please retry.")
View Source
var MIB, MAX_MEMORY uint64

Functions

func Init

func Init(posting *store.Store, log *commit.Logger)

func Key

func Key(uid uint64, attr string) []byte

key = (entity uid, attribute)

func MergeLists

func MergeLists(numRoutines int)

func NewCounters

func NewCounters() *counters

func NewQuery

func NewQuery(attr string, uids []uint64) []byte

func ParseValue

func ParseValue(i *interface{}, value []byte) error

func ProcessTask

func ProcessTask(query []byte) (result []byte, rerr error)

Types

type ByUid

type ByUid []*types.Posting

func (ByUid) Len

func (pa ByUid) Len() int

func (ByUid) Less

func (pa ByUid) Less(i, j int) bool

func (ByUid) Swap

func (pa ByUid) Swap(i, j int)

type List

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

func GetOrCreate

func GetOrCreate(key []byte) *List

func NewList

func NewList() *List

func (*List) AddMutation

func (l *List) AddMutation(t x.DirectedEdge, op byte) error

In benchmarks, the time taken per AddMutation before was plateauing at 2.5 ms with sync per 10 log entries, and increasing for sync per 100 log entries (to 3 ms per AddMutation), largely because of how index generation was being done.

With this change, the benchmarks perform as good as benchmarks for commit.Logger, where the less frequently file sync happens, the faster AddMutations run.

PASS BenchmarkAddMutations_SyncEveryLogEntry-6 100 24712455 ns/op BenchmarkAddMutations_SyncEvery10LogEntry-6 500 2485961 ns/op BenchmarkAddMutations_SyncEvery100LogEntry-6 10000 298352 ns/op BenchmarkAddMutations_SyncEvery1000LogEntry-6 30000 63544 ns/op ok github.com/dgraph-io/dgraph/posting 10.291s

func (*List) Get

func (l *List) Get(p *types.Posting, i int) bool

func (*List) GetUids

func (l *List) GetUids() []uint64

func (*List) LastCompactionTs

func (l *List) LastCompactionTs() time.Time

func (*List) Length

func (l *List) Length() int

func (*List) MergeIfDirty

func (l *List) MergeIfDirty() (merged bool, err error)

func (*List) SetForDeletion

func (l *List) SetForDeletion()

func (*List) Value

func (l *List) Value() (result []byte, rerr error)

type Map

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

func NewMap

func NewMap(withLog bool) *Map

func (*Map) Get

func (m *Map) Get(key uint64) (*List, bool)

func (*Map) StreamAllKeys

func (m *Map) StreamAllKeys(ch chan uint64)

func (*Map) StreamUntilCap

func (m *Map) StreamUntilCap(ch chan uint64)
type MutationLink struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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