config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultDataDirName = "data"

	DefaultNumFiles = 1

	// DefaultComputeBatchSize value must be divisible by 8, to guarantee that writing to disk
	// and file truncating is byte-granular regardless of `BitsPerLabel` value.
	DefaultComputeBatchSize = 1 << 14

	// 2KB per unit. Temporary value.
	DefaultBitsPerLabel  = 8
	DefaultLabelsPerUnit = 2048

	DefaultMaxNumUnits = 10
	DefaultMinNumUnits = 1

	DefaultK1 = 2000
	DefaultK2 = 1800
)
View Source
const (
	MaxBitsPerLabel = 256
	MinBitsPerLabel = 1

	MaxNumFiles = 32
	MinNumFiles = 1
)
View Source
const BestProviderID = -1

BestProviderID can be used for selecting the most performant provider based on a short benchmarking session.

Variables

View Source
var DefaultDataDir string

Functions

func Validate

func Validate(cfg Config, opts InitOpts) error

Types

type Config

type Config struct {
	MinNumUnits   uint32
	MaxNumUnits   uint32
	BitsPerLabel  uint8
	LabelsPerUnit uint64
	K1            uint32
	K2            uint32
}

func DefaultConfig

func DefaultConfig() Config

type InitOpts

type InitOpts struct {
	DataDir           string
	NumUnits          uint32
	NumFiles          uint32
	ComputeProviderID int
	Throttle          bool
}

func DefaultInitOpts

func DefaultInitOpts() InitOpts

Jump to

Keyboard shortcuts

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