buffer

package
v0.0.0-...-2d5464a Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package buffer provides a sorted.KeyValue implementation that buffers one KeyValue implementation in front of an another. It's used for cases such as reindexing where you need a KeyValue but it doesn't need to be flushed and consistent until the end.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValue

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

func New

func New(buffer, backing sorted.KeyValue, maxBufferBytes int64) *KeyValue

New returnes a sorted.KeyValue implementation that adds a Flush method to flush the buffer to the backing storage. A flush will also be performed when maxBufferBytes are reached. If maxBufferBytes <= 0, no automatic flushing is performed.

func (*KeyValue) BeginBatch

func (kv *KeyValue) BeginBatch() sorted.BatchMutation

func (*KeyValue) Close

func (kv *KeyValue) Close() error

func (*KeyValue) CommitBatch

func (kv *KeyValue) CommitBatch(bm sorted.BatchMutation) error

func (*KeyValue) Delete

func (kv *KeyValue) Delete(key string) error

func (*KeyValue) Find

func (kv *KeyValue) Find(start, end string) sorted.Iterator

func (*KeyValue) Flush

func (kv *KeyValue) Flush() error

func (*KeyValue) Get

func (kv *KeyValue) Get(key string) (string, error)

func (*KeyValue) Set

func (kv *KeyValue) Set(key, value string) error

Jump to

Keyboard shortcuts

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