posting

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2016 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

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

Variables

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

Functions

func Init

func Init(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

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, pstore *store.Store) *List

func NewList

func NewList() *List

func (*List) AddMutation

func (l *List) AddMutation(ctx context.Context, 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(offset, count int) []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(ctx context.Context) (merged bool, err error)

func (*List) SetForDeletion

func (l *List) SetForDeletion()

func (*List) Value

func (l *List) Value() (result []byte, rerr error)
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