cfg

package
v3.35.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	DefaultMinWALCheckpointSize = 1 * (1 << 20) // 1MB
	DefaultMaxWALCheckpointSize = DefaultMaxWALSize / 2
)
View Source
const DefaultMaxDelete = 65536

DefaultMaxDelete is the maximum number of bits that will be deleted in a single batch

View Source
const DefaultMaxSize = 4 * (1 << 30)

DefaultMaxSize is the default mmap size and therefore the maximum allowed size of the database. The size can be increased by updating the DB.MaxSize and reopening the database. This setting mainly affects virtual space usage.

View Source
const DefaultMaxWALSize = 4 * (1 << 30)

DefaultMaxWALSize is the default mmap size and therefore the maximum allowed size of the WAL. The size can be increased by updating the DB.MaxWALSize and reopening the database. This setting mainly affects virtual space usage.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// The maximum allowed database size. Required by mmap.
	MaxSize int64 `toml:"max-db-size"`

	// The maximum allowed WAL size. Required by mmap.
	MaxWALSize int64 `toml:"max-wal-size"`

	// The minimum WAL size before the WAL is copied to the DB.
	MinWALCheckpointSize int64 `toml:"min-wal-checkpoint-size"`

	// The maximum WAL size before transactions are halted to allow a checkpoint.
	MaxWALCheckpointSize int64 `toml:"max-wal-checkpoint-size"`

	// Set before calling db.Open()
	FsyncEnabled    bool `toml:"fsync"`
	FsyncWALEnabled bool `toml:"fsync-wal"`

	// for mmap correctness testing.
	DoAllocZero bool `toml:"do-alloc-zero"`

	// CursorCacheSize is the number of copies of Cursor{} to keep in our
	// readyCursorCh arena to avoid GC pressure.
	CursorCacheSize int64 `toml:"cursor-cache-size"`

	// Logger specifies a logger for asynchronous errors, such as
	// background checkpoints. It cannot be set from toml. The default is
	// to use stderr.
	Logger logger.Logger `toml:"-"`

	// The maximum number of bits to be deleted in a single transaction default(65536)
	MaxDelete int `toml:"max-delete"`
}

Config defines externally configurable rbf options. The separate package avoids circular import.

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) DefineFlags

func (cfg *Config) DefineFlags(flags *pflag.FlagSet, prefix string)

Jump to

Keyboard shortcuts

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