mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-15 20:06:19 +08:00
filer store adds kv support
can compile now, need to implement those unimplemented
This commit is contained in:
@@ -2,6 +2,7 @@ package filer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -10,6 +11,12 @@ import (
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrUnsupportedListDirectoryPrefixed = errors.New("unsupported directory prefix listing")
|
||||
ErrKvNotImplemented = errors.New("kv not implemented yet")
|
||||
ErrKvNotFound = errors.New("kv: not found")
|
||||
)
|
||||
|
||||
type FilerStore interface {
|
||||
// GetName gets the name to locate the configuration in filer.toml file
|
||||
GetName() string
|
||||
@@ -28,6 +35,10 @@ type FilerStore interface {
|
||||
CommitTransaction(ctx context.Context) error
|
||||
RollbackTransaction(ctx context.Context) error
|
||||
|
||||
KvPut(ctx context.Context, key []byte, value []byte) (err error)
|
||||
KvGet(ctx context.Context, key []byte) (value []byte, err error)
|
||||
KvDelete(ctx context.Context, key []byte) (err error)
|
||||
|
||||
Shutdown()
|
||||
}
|
||||
|
||||
@@ -206,3 +217,13 @@ func (fsw *FilerStoreWrapper) RollbackTransaction(ctx context.Context) error {
|
||||
func (fsw *FilerStoreWrapper) Shutdown() {
|
||||
fsw.ActualStore.Shutdown()
|
||||
}
|
||||
|
||||
func (fsw *FilerStoreWrapper) KvPut(ctx context.Context, key []byte, value []byte) (err error) {
|
||||
return fsw.ActualStore.KvPut(ctx, key, value)
|
||||
}
|
||||
func (fsw *FilerStoreWrapper) KvGet(ctx context.Context, key []byte) (value []byte, err error) {
|
||||
return fsw.ActualStore.KvGet(ctx, key)
|
||||
}
|
||||
func (fsw *FilerStoreWrapper) KvDelete(ctx context.Context, key []byte) (err error) {
|
||||
return fsw.ActualStore.KvDelete(ctx, key)
|
||||
}
|
||||
|
Reference in New Issue
Block a user