Documentation ¶
Overview ¶
Package pebble provides a configurable Pebble database backend for use with IPFS Cluster.
Index ¶
- Constants
- Variables
- func Cleanup(cfg *Config) error
- func New(cfg *Config) (ds.Datastore, error)
- type Config
- func (cfg *Config) ApplyEnvVars() error
- func (cfg *Config) ConfigKey() string
- func (cfg *Config) Default() error
- func (cfg *Config) GetFolder() string
- func (cfg *Config) LoadJSON(raw []byte) error
- func (cfg *Config) ToDisplayJSON() ([]byte, error)
- func (cfg *Config) ToJSON() (raw []byte, err error)
- func (cfg *Config) Validate() error
Constants ¶
View Source
const (
DefaultSubFolder = "pebble"
)
Default values for Pebble Config
Variables ¶
View Source
var ( // DefaultPebbleOptions for convenience. DefaultPebbleOptions pebble.Options // DefaultCacheSize sets the maximum size of the block cache. DefaultCacheSize int64 = 1 << 30 // Pebble's default: 8MiB // DefaultMemTableSize sets the size of the memtables and affecst total // size of the WAL. It must be under 4GB. DefaultMemTableSize uint64 = 64 << 20 // Pebble's default: 4MiB // DefaultMemTableStopWritesThreshold defines how many memtables can // be queued for writing before stopping writes (memtable memory // consumption should approach // MemTableStopWritesThreshold*MemTableSize in that case). DefaultMemTableStopWritesThreshold = 20 // Pebble's default: 12 // DefaultBytesPerSync controls how often to call the Filesystem // Sync. DefaultBytesPerSync = 1 << 20 // Pebble's default: 512KiB // DefaultMaxConcurrentCompactions controls how many compactions // happen at a single time. DefaultMaxConcurrentCompactions = 5 // Pebble's default: 1 // DefaultMaxOpenFiles controls how many files can be kept open by // Pebble. DefaultMaxOpenFiles = 1000 // Pebble's default: 500 // DefaultL0CompactionThreshold defines the read amplification on L0 // that triggers compaction DefaultL0CompactionThreshold = 4 // Pebble's default: 4 // DefaultL0CompactionFileThreshold defines the number of files that // trigger compactions of L0 DefaultL0CompactionFileThreshold = 750 // Pebble's default: 500 // DefaultL0StopWritesThreshold defines the critical threshold for // read amplification on L0, which stops writes until compaction // reduces it. DefaultL0StopWritesThreshold = 12 // Pebble's default : 4 // DefaultLBaseMaxBytes defines maximum size of LBase, where memtables // are temporally written to DefaultLBaseMaxBytes int64 = 128 << 20 // Pebble's default: 64MiB // DefaultL0TargetFileSize defines the target filesize for L0. It is // multiplied by 2 for every subsequent level. DefaultL0TargetFileSize int64 = 4 << 20 // Pebble's default: 4M // DefaultBlockSize defines the target size for table blocks (used in // all levels). DefaultBlockSize int = 4 << 10 // Pebble's default: 4KiB // DefaultFilterPolicy defines the number of bits used per key for // bloom filters. 10 yields a 1% false positive rate. DefaultFilterPolicy bloom.FilterPolicy = 10 // Pebble's default: 10 // DefaultFormatMajorVersion sets the format of Pebble on-disk files. DefaultFormatMajorVersion = pebble.FormatNewest )
Functions ¶
Types ¶
type Config ¶
type Config struct { config.Saver // The folder for this datastore. Non-absolute paths are relative to // the base configuration folder. Folder string PebbleOptions pebble.Options }
Config is used to initialize a Pebble datastore. It implements the ComponentConfig interface.
func (*Config) ApplyEnvVars ¶
ApplyEnvVars fills in any Config fields found as environment variables.
func (*Config) ConfigKey ¶
ConfigKey returns a human-friendly identifier for this type of Datastore.
func (*Config) LoadJSON ¶
LoadJSON reads the fields of this Config from a JSON byteslice as generated by ToJSON.
func (*Config) ToDisplayJSON ¶
ToDisplayJSON returns JSON config as a string.
Click to show internal directories.
Click to hide internal directories.