Documentation
¶
Index ¶
- Constants
- type Config
- type Option
- func WithBackendFilter(filter func(morpc.Message, string) bool) Option
- func WithClock(clock clock.Clock) Option
- func WithConfigAdjust(adjustConfigFunc func(c *Config)) Option
- func WithHAKeeperClientFactory(factory func() (logservice.DNHAKeeperClient, error)) Option
- func WithLogServiceClientFactory(factory func(metadata.DNShard) (logservice.Client, error)) Option
- func WithLogger(logger *zap.Logger) Option
- func WithTaskStorageFactory(factory taskservice.TaskStorageFactory) Option
- type Service
- type StorageType
Constants ¶
View Source
const ( // StorageTAE TAE txn storage backend StorageTAE = StorageType("TAE") // StorageMEMKV MEMKV txn storage backend StorageMEMKV = StorageType("MEMKV") // StorageMEMKV MEM txn storage backend StorageMEM = StorageType("MEM") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DataDir data dir
DataDir string `toml:"-"`
// UUID dn store uuid
UUID string `toml:"uuid"`
// ListenAddress listening address for receiving external requests.
ListenAddress string `toml:"listen-address"`
// ServiceAddress service address for communication, if this address is not set, use
// ListenAddress as the communication address.
ServiceAddress string `toml:"service-address"`
// HAKeeper configuration
HAKeeper struct {
// HeatbeatInterval heartbeat interval to send message to hakeeper. Default is 1s
HeatbeatInterval toml.Duration `toml:"hakeeper-heartbeat-interval"`
// HeatbeatTimeout heartbeat request timeout. Default is 3s
HeatbeatTimeout toml.Duration `toml:"hakeeper-heartbeat-timeout"`
// DiscoveryTimeout discovery HAKeeper service timeout. Default is 30s
DiscoveryTimeout toml.Duration `toml:"hakeeper-discovery-timeout"`
// ClientConfig hakeeper client configuration
ClientConfig logservice.HAKeeperClientConfig
}
// LogService log service configuration
LogService struct {
// ConnectTimeout timeout for connect to logservice. Default is 30s.
ConnectTimeout toml.Duration `toml:"connect-timeout"`
}
// RPC configuration
RPC rpc.Config `toml:"rpc"`
Ckp struct {
FlushInterval toml.Duration `toml:"flush-interval"`
ScanInterval toml.Duration `toml:"scan-interval"`
MinCount int64 `toml:"min-count"`
IncrementalInterval toml.Duration `toml:"incremental-interval"`
GlobalInterval toml.Duration `toml:"global-interval"`
}
// Txn transactions configuration
Txn struct {
// ZombieTimeout A transaction timeout, if an active transaction has not operated for more
// than the specified time, it will be considered a zombie transaction and the backend will
// roll back the transaction.
ZombieTimeout toml.Duration `toml:"zombie-timeout"`
// Storage txn storage config
Storage struct {
// Backend txn storage backend implementation. [TAE|Mem], default TAE.
Backend StorageType `toml:"backend"`
// LogBackend the backend used to store logs
LogBackend string `toml:"log-backend"`
// contains filtered or unexported fields
}
}
}
Config dn store configuration
type Option ¶
type Option func(*store)
Option store option
func WithBackendFilter ¶
WithBackendFilter set filtering txn.TxnRequest sent to other DNShard
func WithConfigAdjust ¶
WithConfigAdjust set adjust config func
func WithHAKeeperClientFactory ¶
func WithHAKeeperClientFactory(factory func() (logservice.DNHAKeeperClient, error)) Option
WithHAKeeperClientFactory set hakeeper client factory
func WithLogServiceClientFactory ¶
WithLogServiceClientFactory set log service client factory
func WithTaskStorageFactory ¶
func WithTaskStorageFactory(factory taskservice.TaskStorageFactory) Option
WithTaskStorageFactory setup the special task strorage factory
type Service ¶
type Service interface {
// Start start dn store. Start all DNShards currently managed by the Store and listen
// to and process requests from CN and other DNs.
Start() error
// Close close dn store
Close() error
// StartDNReplica start the DNShard replica
StartDNReplica(metadata.DNShard) error
// CloseDNReplica close the DNShard replica.
CloseDNReplica(shard metadata.DNShard) error
// GetTaskService returns taskservice
GetTaskService() (taskservice.TaskService, bool)
}
Service DN Service
func NewService ¶
func NewService(cfg *Config, fileService fileservice.FileService, opts ...Option) (Service, error)
NewService create DN Service
Click to show internal directories.
Click to hide internal directories.