Documentation ¶
Overview ¶
Package backend defines a standard interface for etcd's backend MVCC storage.
Index ¶
Constants ¶
View Source
const ( // DefaultQuotaBytes is the number of bytes the backend Size may // consume before exceeding the space quota. DefaultQuotaBytes = int64(2 * 1024 * 1024 * 1024) // 2GB // MaxQuotaBytes is the maximum number of bytes suggested for a backend // quota. A larger quota may lead to degraded performance. MaxQuotaBytes = int64(8 * 1024 * 1024 * 1024) // 8GB )
Variables ¶
View Source
var ( // InitialMmapSize is the initial size of the mmapped region. Setting this larger than // the potential max db size can prevent writer from blocking reader. // This only works for linux. InitialMmapSize = int64(10 * 1024 * 1024 * 1024) )
Functions ¶
func NewDefaultTmpBackend ¶
func NewDefaultTmpBackend() (*backend, string)
Types ¶
type Backend ¶
type Backend interface { ReadTx() ReadTx BatchTx() BatchTx Snapshot() Snapshot Hash(ignores map[IgnoreKey]struct{}) (uint32, error) // Size returns the current size of the backend. Size() int64 Defrag() error ForceCommit() Close() error }
func NewDefaultBackend ¶
type BatchTx ¶
type BatchTx interface { ReadTx UnsafeCreateBucket(name []byte) UnsafePut(bucketName []byte, key []byte, value []byte) UnsafeSeqPut(bucketName []byte, key []byte, value []byte) UnsafeDelete(bucketName []byte, key []byte) // Commit commits a previous tx and begins a new writable one. Commit() // CommitAndStop commits the previous tx and does not create a new one. CommitAndStop() }
Click to show internal directories.
Click to hide internal directories.