config

package
v0.0.0-...-c602644 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultKVStoreName = "goleveldb"
	DefaultDataDir     = "./data"
	DefaultDatabases   = 16
	DefaulSlots        = 1024

	DefaultTTLCheckInterval = 1
	MaxTTLCheckInterval     = 3600

	DefaultChSize   = 10
	DefaultWorkerCn = 10

	DefaultMgrtBatchKeyCn = 10000
)
View Source
const (
	// https://en.wikipedia.org/wiki/Bloom_filter
	// use github.com/bits-and-blooms/bloom/v3 EstimateParameters to check
	// 85M (BFBitSize/8) ~ 50 million keys and 0.01 False Positive Rate (bit size: 718879379)
	DefaultBFBitSize = 718879379
	// 10 hash 0.01 False Positive Rate
	DefaultBFHashCn = 10

	// http://pages.cs.wisc.edu/~jussara/papers/00ton.pdf
	// use github.com/tylertreat/BoomFilters
	// 502533109 bit size ~ 64M
	DefaultCBFItmeCn = 50 * 1024 * 1024
	// counter bucket size, counter Max 2^4 - 1
	// in this db key stats case, use DefaultCBFBucketSize is ok
	DefaultCBFBucketSize = 4
	// false-positive rate
	DefaultCBFfpRate = 0.01
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncTask

type AsyncTask struct {
	Name     string `mapstructure:"name"`
	ChSize   int64  `mapstructure:"chSize"`
	WorkerCn int    `mapstructure:"workerCn"`
}

func DefaultMigrateAsyncTask

func DefaultMigrateAsyncTask() *AsyncTask

type OpenkvOptions

type OpenkvOptions struct {
	DataDir        string `mapstructure:"dataDir"`
	KVStoreName    string `mapstructure:"kvStoreName"`
	DBPath         string `mapstructure:"dbPath"`
	DBSyncCommit   int    `mapstructure:"dbSyncCommit"`
	BufferOpCommit bool   `mapstructure:"bufferOpCommit"`
}

func DefaultOpenkvOptions

func DefaultOpenkvOptions() *OpenkvOptions

type StorgerOptions

type StorgerOptions struct {
	OpenkvOptions     `mapstructure:",squash"`
	Databases         int       `mapstructure:"databases"`
	Slots             int       `mapstructure:"slots"`
	TTLCheckInterval  int       `mapstructure:"ttlCheckInterval"`
	CBFItmeCn         uint      `mapstructure:"cbfItmeCn"`
	CBFBucketSize     uint8     `mapstructure:"cbfBucketSize"`
	CBFFpRate         float64   `mapstructure:"cbfFpRate"`
	MigrateAsyncTask  AsyncTask `mapstructure:"migrateAsyncTask"`
	MigrateBatchKeyCn int       `mapstructure:"migrateBatchKeyCn"`
}

func DefaultStoragerOptions

func DefaultStoragerOptions() *StorgerOptions

Jump to

Keyboard shortcuts

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