Documentation
¶
Index ¶
- Variables
- type DBManager
- func (m *DBManager) Get(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) (proto.Message, error)
- func (m *DBManager) GetLatest(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) (proto.Message, error)
- func (m *DBManager) Save(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) error
- func (m *DBManager) Update(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) error
- func (m *DBManager) WithCache(cache cache.Cache)
- type ExampleSettings
- func (*ExampleSettings) Descriptor() ([]byte, []int)deprecated
- func (x *ExampleSettings) GetExampleInt() int32
- func (x *ExampleSettings) GetExampleMap() map[string]int32
- func (x *ExampleSettings) GetExampleStr() string
- func (*ExampleSettings) ProtoMessage()
- func (x *ExampleSettings) ProtoReflect() protoreflect.Message
- func (x *ExampleSettings) Reset()
- func (x *ExampleSettings) String() string
- type KVManager
- func (m *KVManager) Get(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) (proto.Message, error)
- func (m *KVManager) GetLatest(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) (proto.Message, error)
- func (m *KVManager) Save(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) error
- func (m *KVManager) Update(ctx context.Context, repositoryID graveler.RepositoryID, key string, ...) error
- func (m *KVManager) WithCache(cache cache.Cache)
- type Manager
- type ManagerOption
Constants ¶
This section is empty.
Variables ¶
var File_test_settings_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type DBManager ¶ added in v0.70.1
type DBManager struct {
// contains filtered or unexported fields
}
DBManager is a key-value store for Graveler repository-level settings. Each setting is stored under a key, and can be any proto.Message. Fetched settings are cached using cache.Cache with a default expiry time of 1 second. Hence, the store is eventually consistent.
func (*DBManager) Get ¶ added in v0.70.1
func (m *DBManager) Get(ctx context.Context, repositoryID graveler.RepositoryID, key string, settingTemplate proto.Message) (proto.Message, error)
Get fetches the setting under the given repository and key, and returns the result. The result is eventually consistent: it is not guaranteed to be the most up-to-date setting. The cache expiry period is 1 second. The settingTemplate parameter is used to determine the returned type.
func (*DBManager) Save ¶ added in v0.70.1
func (m *DBManager) Save(ctx context.Context, repositoryID graveler.RepositoryID, key string, setting proto.Message) error
Save persists the given setting under the given repository and key.
func (*DBManager) Update ¶ added in v0.70.1
func (m *DBManager) Update(ctx context.Context, repositoryID graveler.RepositoryID, key string, settingTemplate proto.Message, update updateFunc) error
Update atomically gets a setting, performs the update function, and persists the setting to the store. The settingTemplate parameter is used to determine the type passed to the update function.
type ExampleSettings ¶
type ExampleSettings struct { ExampleInt int32 `protobuf:"varint,1,opt,name=example_int,json=exampleInt,proto3" json:"example_int,omitempty"` ExampleStr string `protobuf:"bytes,2,opt,name=example_str,json=exampleStr,proto3" json:"example_str,omitempty"` ExampleMap map[string]int32 `` /* 180-byte string literal not displayed */ // contains filtered or unexported fields }
func (*ExampleSettings) Descriptor
deprecated
func (*ExampleSettings) Descriptor() ([]byte, []int)
Deprecated: Use ExampleSettings.ProtoReflect.Descriptor instead.
func (*ExampleSettings) GetExampleInt ¶
func (x *ExampleSettings) GetExampleInt() int32
func (*ExampleSettings) GetExampleMap ¶
func (x *ExampleSettings) GetExampleMap() map[string]int32
func (*ExampleSettings) GetExampleStr ¶
func (x *ExampleSettings) GetExampleStr() string
func (*ExampleSettings) ProtoMessage ¶
func (*ExampleSettings) ProtoMessage()
func (*ExampleSettings) ProtoReflect ¶
func (x *ExampleSettings) ProtoReflect() protoreflect.Message
func (*ExampleSettings) Reset ¶
func (x *ExampleSettings) Reset()
func (*ExampleSettings) String ¶
func (x *ExampleSettings) String() string
type KVManager ¶ added in v0.70.1
type KVManager struct {
// contains filtered or unexported fields
}
KVManager is a key-value store for Graveler repository-level settings. Each setting is stored under a key, and can be any proto.Message. Fetched settings are cached using cache.Cache with a default expiry time of 1 second. Hence, the store is eventually consistent.
func NewManager ¶
func NewManager(refManager graveler.RefManager, store kv.StoreMessage, options ...ManagerOption) *KVManager
func (*KVManager) Get ¶ added in v0.70.1
func (m *KVManager) Get(ctx context.Context, repositoryID graveler.RepositoryID, key string, settingTemplate proto.Message) (proto.Message, error)
Get fetches the setting under the given repository and key, and returns the result. The result is eventually consistent: it is not guaranteed to be the most up-to-date setting. The cache expiry period is 1 second. The settingTemplate parameter is used to determine the returned type.
func (*KVManager) Save ¶ added in v0.70.1
func (m *KVManager) Save(ctx context.Context, repositoryID graveler.RepositoryID, key string, setting proto.Message) error
Save persists the given setting under the given repository and key. Overrides settings key in KV Store
func (*KVManager) Update ¶ added in v0.70.1
func (m *KVManager) Update(ctx context.Context, repositoryID graveler.RepositoryID, key string, settingTemplate proto.Message, update updateFunc) error
Update atomically gets a setting, performs the update function, and persists the setting to the store. The settingTemplate parameter is used to determine the type passed to the update function.
type Manager ¶
type Manager interface { // TODO (niro): Delete Save (unused) Save(context.Context, graveler.RepositoryID, string, proto.Message) error GetLatest(context.Context, graveler.RepositoryID, string, proto.Message) (proto.Message, error) Get(context.Context, graveler.RepositoryID, string, proto.Message) (proto.Message, error) Update(context.Context, graveler.RepositoryID, string, proto.Message, updateFunc) error WithCache(cache cache.Cache) }
TODO (niro): Remove interface once DB implementation is deleted
func NewDBManager ¶ added in v0.70.1
func NewDBManager(refManager graveler.RefManager, branchLock graveler.BranchLocker, blockAdapter block.Adapter, committedBlockStoragePrefix string, options ...ManagerOption) Manager
type ManagerOption ¶
type ManagerOption func(m Manager)
func WithCache ¶
func WithCache(cache cache.Cache) ManagerOption