config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FileIOType = iota + 1 // Standard File IO
	BufIOType             // File IO with buffer
	MmapIOType            // Memory Mapping IO
)
View Source
const (
	DefaultAddr = "127.0.0.1:8999"
)

Variables

View Source
var DefaultIteratorOptions = IteratorOptions{
	Prefix:  nil,
	Reverse: false,
}
View Source
var DefaultOptions = Options{
	DirPath:      os.TempDir(),
	DataFileSize: 256 * 1024 * 1024,
	SyncWrite:    false,
	IndexType:    ART,
	FIOType:      MmapIOType,
}
View Source
var DefaultWriteBatchOptions = WriteBatchOptions{
	MaxBatchNum: 10000,
	SyncWrites:  true,
}

Functions

This section is empty.

Types

type Config added in v1.0.5

type Config struct {
	ReplicationFactor   int
	ShardingStrategy    string
	SchedulingStrategy  string
	LogDataStorage      string
	LogDataStoragePath  string
	SnapshotStorage     string
	SnapshotStoragePath string
	LogDataStorageSize  int64
	HeartbeatInterval   time.Duration
	MetaNodes           []string
	StoreNodes          []string
}

type FIOType added in v1.0.5

type FIOType = int8

type IndexerType

type IndexerType = int8
const (
	// Btree
	Btree IndexerType = iota + 1

	// ART (Adpative Radix Tree)
	ART

	// SkipList
	SkipList
)

type IteratorOptions

type IteratorOptions struct {
	// Prefix specifies the prefix value for keys to iterate over. Default is empty.
	Prefix []byte
	// Reverse indicates whether to iterate in reverse order.
	// Default is false for forward iteration.
	Reverse bool
}

IteratorOptions is the configuration for index iteration.

type Options

type Options struct {
	DirPath      string // Database data directory
	DataFileSize int64  // Size of data files
	SyncWrite    bool   // Whether to persist data on every write
	IndexType    IndexerType
	FIOType      FIOType
}

type RegionConfig added in v1.0.12

type RegionConfig struct {
	Options Options
	Config  Config
	Id      int64
	Start   []byte
	End     []byte
}

type StoreConfig added in v1.0.12

type StoreConfig struct {
	Options Options
	Config  Config
	Id      int64
	Addr    string
}

type TcpServerConfiguration

type TcpServerConfiguration struct {
	Host       string
	Port       int
	MaxClients int
}

TcpServerConfiguration define global tcp server config

var Configuration *TcpServerConfiguration

Configuration is global tcp server config

func Init

func Init() *TcpServerConfiguration

Init global tcp server config

type WriteBatchOptions

type WriteBatchOptions struct {
	// MaxBatchNum is the maximum number of data entries in a batch.
	MaxBatchNum uint
	// SyncWrites indicates whether to sync (persist) the data on batch commit.
	SyncWrites bool
}

WriteBatchOptions is the configuration for batch writing.

Jump to

Keyboard shortcuts

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