Versions in this module Expand all Collapse all v0 v0.0.3 Aug 15, 2022 Changes in this version + var CastagnoliCrcTable = crc32.MakeTable(crc32.Castagnoli) + var ErrChecksumMismatch = errors.New("checksum mismatch") + var ErrCommitAfterFinish = errors.New("Batch commit not permitted after finish") + var ErrEOF = errors.New("ErrEOF: End of file") + var NoEventLog trace.EventLog = nilEventLog + func AssertTrue(b bool) + func AssertTruef(b bool, format string, args ...interface{}) + func BloomBitsPerKey(numEntries int, fp float64) int + func BytesToU16(b []byte) uint16 + func BytesToU32(b []byte) uint32 + func BytesToU32Slice(b []byte) []uint32 + func BytesToU64(b []byte) uint64 + func BytesToU64Slice(b []byte) []uint64 + func CalculateChecksum(data []byte, ct pb.Checksum_Algorithm) uint64 + func Check(err error) + func Check2(_ interface{}, err error) + func CompareKeys(key1, key2 []byte) int + func Copy(a []byte) []byte + func CreateSyncedFile(filename string, sync bool) (*os.File, error) + func FixedDuration(d time.Duration) string + func GenerateIV() ([]byte, error) + func Hash(b []byte) uint32 + func IBytesToString(size uint64, precision int) string + func KeyWithTs(key []byte, ts uint64) []byte + func LSMSizeGet(enabled bool, key string) expvar.Var + func LSMSizeSet(enabled bool, key string, val expvar.Var) + func NewKV(alloc *z.Allocator) *pb.KV + func NumBlockedPutsAdd(enabled bool, val int64) + func NumBytesReadAdd(enabled bool, val int64) + func NumBytesWrittenAdd(enabled bool, val int64) + func NumCompactionTablesAdd(enabled bool, val int64) + func NumGetsAdd(enabled bool, val int64) + func NumLSMBloomHitsAdd(enabled bool, key string, val int64) + func NumLSMGetsAdd(enabled bool, key string, val int64) + func NumMemtableGetsAdd(enabled bool, val int64) + func NumPutsAdd(enabled bool, val int64) + func NumReadsAdd(enabled bool, val int64) + func NumWritesAdd(enabled bool, val int64) + func OpenExistingFile(filename string, flags Flags) (*os.File, error) + func OpenSyncedFile(filename string, sync bool) (*os.File, error) + func OpenTruncFile(filename string, sync bool) (*os.File, error) + func ParseKey(key []byte) []byte + func ParseTs(key []byte) uint64 + func PendingWritesSet(enabled bool, key string, val expvar.Var) + func SafeCopy(a, src []byte) []byte + func SameKey(src, dst []byte) bool + func SetKeyTs(key []byte, ts uint64) + func U16ToBytes(v uint16) []byte + func U32SliceToBytes(u32s []uint32) []byte + func U32ToBytes(v uint32) []byte + func U64SliceToBytes(u64s []uint64) []byte + func U64ToBytes(v uint64) []byte + func VerifyChecksum(data []byte, expected *pb.Checksum) error + func VlogSizeGet(enabled bool, key string) expvar.Var + func VlogSizeSet(enabled bool, key string, val expvar.Var) + func Wrap(err error, msg string) error + func Wrapf(err error, format string, args ...interface{}) error + func XORBlock(dst, src, key, iv []byte) error + func XORBlockAllocate(src, key, iv []byte) ([]byte, error) + func XORBlockStream(w io.Writer, src, key, iv []byte) error + func ZSTDCompress(dst, src []byte, compressionLevel int) ([]byte, error) + func ZSTDCompressBound(srcSize int) int + func ZSTDDecompress(dst, src []byte) ([]byte, error) + type Filter []byte + func NewFilter(keys []uint32, bitsPerKey int) Filter + func (f Filter) MayContain(h uint32) bool + func (f Filter) MayContainKey(k []byte) bool + type Flags int + const ReadOnly + const Sync + type Iterator interface + Close func() error + Key func() []byte + Next func() + Rewind func() + Seek func(key []byte) + Valid func() bool + Value func() ValueStruct + type PageBuffer struct + func NewPageBuffer(pageSize int) *PageBuffer + func (b *PageBuffer) Bytes() []byte + func (b *PageBuffer) Len() int + func (b *PageBuffer) NewReaderAt(offset int) *PageBufferReader + func (b *PageBuffer) Truncate(n int) + func (b *PageBuffer) Write(data []byte) (int, error) + func (b *PageBuffer) WriteByte(data byte) error + func (b *PageBuffer) WriteTo(w io.Writer) (int64, error) + type PageBufferReader struct + func (r *PageBufferReader) Read(p []byte) (int, error) + type RateMonitor struct + func NewRateMonitor(numSamples int) *RateMonitor + func (rm *RateMonitor) Capture(sent uint64) + func (rm *RateMonitor) Rate() uint64 + type Slice struct + func (s *Slice) Resize(sz int) []byte + type Throttle struct + func NewThrottle(max int) *Throttle + func (t *Throttle) Do() error + func (t *Throttle) Done(err error) + func (t *Throttle) Finish() error + type ValueStruct struct + ExpiresAt uint64 + Meta byte + UserMeta byte + Value []byte + Version uint64 + func (v *ValueStruct) Decode(b []byte) + func (v *ValueStruct) Encode(b []byte) uint32 + func (v *ValueStruct) EncodeTo(buf *bytes.Buffer) + func (v *ValueStruct) EncodedSize() uint32 + type WaterMark struct + Name string + func (w *WaterMark) Begin(index uint64) + func (w *WaterMark) BeginMany(indices []uint64) + func (w *WaterMark) Done(index uint64) + func (w *WaterMark) DoneMany(indices []uint64) + func (w *WaterMark) DoneUntil() uint64 + func (w *WaterMark) Init(closer *z.Closer) + func (w *WaterMark) LastIndex() uint64 + func (w *WaterMark) SetDoneUntil(val uint64) + func (w *WaterMark) WaitForMark(ctx context.Context, index uint64) error