Documentation
¶
Index ¶
- Constants
- Variables
- type Badger
- type Config
- func (c *Config) BuildBadgerOptions() (*bdb.Options, error)
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (x *Config) GetBadgerDebug() bool
- func (x *Config) GetBaseLevelSize() uint64
- func (x *Config) GetBaseTableSize() uint64
- func (c *Config) GetConfigID() string
- func (c *Config) GetDebugVals() config.DebugValues
- func (x *Config) GetDir() string
- func (x *Config) GetKvKeyOpts() *kvkey.Config
- func (x *Config) GetLevelSizeMultiplier() uint32
- func (x *Config) GetMaxLevels() uint32
- func (x *Config) GetNoGenerateKey() bool
- func (x *Config) GetNoSyncWrites() bool
- func (x *Config) GetNoWriteKey() bool
- func (x *Config) GetNumCompactors() uint32
- func (x *Config) GetNumLevelZeroTables() uint32
- func (x *Config) GetNumLevelZeroTablesStall() uint32
- func (x *Config) GetNumMemtables() uint32
- func (x *Config) GetNumVersionsToKeep() uint32
- func (x *Config) GetStoreConfig() *kvtx.Config
- func (x *Config) GetValueDir() string
- func (x *Config) GetValueLogFileSize() uint64
- func (x *Config) GetValueLogMaxEntries() uint32
- func (x *Config) GetValueThreshold() uint64
- func (x *Config) GetVerbose() bool
- func (x *Config) GetVolumeConfig() *controller.Config
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Factory
- func (t *Factory) Construct(ctx context.Context, conf config.Config, opts controller.ConstructOpts) (controller.Controller, error)
- func (t *Factory) ConstructConfig() config.Config
- func (t *Factory) GetConfigID() string
- func (t *Factory) GetControllerID() string
- func (t *Factory) GetVersion() semver.Version
Constants ¶
const ControllerID = "hydra/volume/badger"
ControllerID identifies the Badger volume controller.
Variables ¶
var ConfigID = ControllerID
ConfigID is the id attached to the config objects.
var Version = semver.MustParse("0.0.1")
Version is the version of the badger implementation.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Dir is the directory to store the data in.
// Should exist and be writable.
Dir string `protobuf:"bytes,1,opt,name=dir,proto3" json:"dir,omitempty"`
// ValueDir is the directory to store the value log in.
// Can be the same as dir.
// Should exist and be writable.
// If empty, defaults to Dir.
ValueDir string `protobuf:"bytes,2,opt,name=value_dir,json=valueDir,proto3" json:"valueDir,omitempty"`
// KvKeyOpts are key/value options.
KvKeyOpts *kvkey.Config `protobuf:"bytes,3,opt,name=kv_key_opts,json=kvKeyOpts,proto3" json:"kvKeyOpts,omitempty"`
// NoGenerateKey indicates the controller should not generate a private key if
// one is not already present. Setting this to false will cause the system to
// create a new private key if one is not present in the store at startup. If
// no key is in the store at startup and this is true, returns an error.
NoGenerateKey bool `protobuf:"varint,4,opt,name=no_generate_key,json=noGenerateKey,proto3" json:"noGenerateKey,omitempty"`
// NoWriteKey indicates the controller should not write a private key to
// storage if it generates one. This results in an ephemeral volume peer
// identity if there is no key present in the store already.
//
// Has no effect if the store has a peer private key.
NoWriteKey bool `protobuf:"varint,25,opt,name=no_write_key,json=noWriteKey,proto3" json:"noWriteKey,omitempty"`
// Verbose indicates we should log every operation.
Verbose bool `protobuf:"varint,21,opt,name=verbose,proto3" json:"verbose,omitempty"`
// BadgerDebug indicates to enable badger debug log messages.
BadgerDebug bool `protobuf:"varint,24,opt,name=badger_debug,json=badgerDebug,proto3" json:"badgerDebug,omitempty"`
// VolumeConfig is the volume controller config.
VolumeConfig *controller.Config `protobuf:"bytes,22,opt,name=volume_config,json=volumeConfig,proto3" json:"volumeConfig,omitempty"`
// StoreConfig is the store configuration for kvtx.
StoreConfig *kvtx.Config `protobuf:"bytes,23,opt,name=store_config,json=storeConfig,proto3" json:"storeConfig,omitempty"`
// NumVersionsToKeep indicates how many versions to keep per key.
// Defaults to 1.
NumVersionsToKeep uint32 `protobuf:"varint,7,opt,name=num_versions_to_keep,json=numVersionsToKeep,proto3" json:"numVersionsToKeep,omitempty"`
// BaseTableSize is the base size for tables.
// Defaults to 2 << 20.
BaseTableSize uint64 `protobuf:"varint,26,opt,name=base_table_size,json=baseTableSize,proto3" json:"baseTableSize,omitempty"`
// LevelSizeMultiplier is SizeOf(Li+1)/SizeOf(Li).
// Defaults to 10.
LevelSizeMultiplier uint32 `protobuf:"varint,9,opt,name=level_size_multiplier,json=levelSizeMultiplier,proto3" json:"levelSizeMultiplier,omitempty"`
// MaxLevels is the maximum number of levels of compaction.
// Defaults to 7
MaxLevels uint32 `protobuf:"varint,10,opt,name=max_levels,json=maxLevels,proto3" json:"maxLevels,omitempty"`
// ValueThreshold if value size >= threshold, only store offsets in tree.
// Defaults to 1 << 20, 1MB
ValueThreshold uint64 `protobuf:"varint,27,opt,name=value_threshold,json=valueThreshold,proto3" json:"valueThreshold,omitempty"`
// NumMemtables is the Maximum number of tables to keep in memory, before
// stalling.
// Defaults to 5.
NumMemtables uint32 `protobuf:"varint,12,opt,name=num_memtables,json=numMemtables,proto3" json:"numMemtables,omitempty"`
// NumLevelZeroTables affects how LSM tree L0 is handled.
// Maximum number of Level 0 tables before we start compacting.
// Defaults to 5.
NumLevelZeroTables uint32 `protobuf:"varint,13,opt,name=num_level_zero_tables,json=numLevelZeroTables,proto3" json:"numLevelZeroTables,omitempty"`
// NumLevelZeroTablesStall is the number of level 0 tables to stall at until
// l0 is compacted.
// Defaults to 10.
NumLevelZeroTablesStall uint32 `` /* 134-byte string literal not displayed */
// BaseLevelSize is the base size for levels.
// Defaults to 10 << 20.
BaseLevelSize uint64 `protobuf:"varint,28,opt,name=base_level_size,json=baseLevelSize,proto3" json:"baseLevelSize,omitempty"`
// ValueLogFileSize is the size of single value log file.
// (2^30 - 1)*2 when mmapping < 2^31 - 1, max int32.
// -1 so 2*ValueLogFileSize won't overflow on 32-bit systems.
// Defaults to 1<<30 - 1
ValueLogFileSize uint64 `protobuf:"varint,16,opt,name=value_log_file_size,json=valueLogFileSize,proto3" json:"valueLogFileSize,omitempty"`
// ValueLogMaxEntries is the max number of entries a value log file can hold
// (approximately). A value log file would be determined by the smaller of its
// file size and max entries.
// Defaults to 1000000
ValueLogMaxEntries uint32 `protobuf:"varint,17,opt,name=value_log_max_entries,json=valueLogMaxEntries,proto3" json:"valueLogMaxEntries,omitempty"`
// NumCompactors is the number of compaction workers to run concurrently.
// Defaults to 3.
NumCompactors uint32 `protobuf:"varint,18,opt,name=num_compactors,json=numCompactors,proto3" json:"numCompactors,omitempty"`
// NoSyncWrites indicates all writes should not require disk sync before
// returning. If set, writes will return before the filesystem has confirmed
// the write is complete. Setting this to false will increase performance but
// introduces risk of data loss.
NoSyncWrites bool `protobuf:"varint,20,opt,name=no_sync_writes,json=noSyncWrites,proto3" json:"noSyncWrites,omitempty"`
// contains filtered or unexported fields
}
Config is the badger volume controller config. Flag Dir is the only mandatory flag.
func (*Config) BuildBadgerOptions ¶
BuildBadgerOptions builds badger options from the config.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the config is equal to another.
func (*Config) GetBadgerDebug ¶
func (*Config) GetBaseLevelSize ¶
func (*Config) GetBaseTableSize ¶
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.
func (*Config) GetDebugVals ¶
func (c *Config) GetDebugVals() config.DebugValues
GetDebugVals returns the directive arguments as key/value pairs. This should be something like param1="test", param2="test". This is not necessarily unique, and is primarily intended for display.
func (*Config) GetKvKeyOpts ¶
func (*Config) GetLevelSizeMultiplier ¶
func (*Config) GetMaxLevels ¶
func (*Config) GetNoGenerateKey ¶
func (*Config) GetNoSyncWrites ¶
func (*Config) GetNoWriteKey ¶
func (*Config) GetNumCompactors ¶
func (*Config) GetNumLevelZeroTables ¶
func (*Config) GetNumLevelZeroTablesStall ¶
func (*Config) GetNumMemtables ¶
func (*Config) GetNumVersionsToKeep ¶
func (*Config) GetStoreConfig ¶
func (*Config) GetValueDir ¶
func (*Config) GetValueLogFileSize ¶
func (*Config) GetValueLogMaxEntries ¶
func (*Config) GetValueThreshold ¶
func (*Config) GetVerbose ¶
func (*Config) GetVolumeConfig ¶
func (x *Config) GetVolumeConfig() *controller.Config
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs a Badger volume.
func (*Factory) Construct ¶
func (t *Factory) Construct( ctx context.Context, conf config.Config, opts controller.ConstructOpts, ) (controller.Controller, error)
Construct constructs the associated controller given configuration.
func (*Factory) ConstructConfig ¶
ConstructConfig constructs an instance of the controller configuration.
func (*Factory) GetConfigID ¶
GetConfigID returns the unique ID for the config.
func (*Factory) GetControllerID ¶
GetControllerID returns the unique ID for the controller.
func (*Factory) GetVersion ¶
GetVersion returns the version of this controller.