From 0d5683fb0e6b1afe5fe7dadaa05361c0d698e795 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 18 Dec 2020 03:05:42 -0800 Subject: [PATCH] todo: load path-specific store from filer.toml --- weed/filer/configuration.go | 3 +++ weed/filer/filerstore.go | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/weed/filer/configuration.go b/weed/filer/configuration.go index 3dce67d6d..d04ab06cb 100644 --- a/weed/filer/configuration.go +++ b/weed/filer/configuration.go @@ -27,6 +27,9 @@ func (f *Filer) LoadConfiguration(config *viper.Viper) { } } + // TODO load path-specific filer store here + // f.Store.AddPathSpecificStore(path, store) + println() println("Supported filer stores are:") for _, store := range Stores { diff --git a/weed/filer/filerstore.go b/weed/filer/filerstore.go index a2b81c5d9..5e10bb0a6 100644 --- a/weed/filer/filerstore.go +++ b/weed/filer/filerstore.go @@ -50,6 +50,7 @@ type VirtualFilerStore interface { FilerStore DeleteHardLink(ctx context.Context, hardLinkId HardLinkId) error DeleteOneEntry(ctx context.Context, entry *Entry) error + AddPathSpecificStore(path string, store FilerStore) } type FilerStoreWrapper struct { @@ -67,7 +68,7 @@ func NewFilerStoreWrapper(store FilerStore) *FilerStoreWrapper { } } -func (fsw *FilerStoreWrapper) addStore(path string, store FilerStore) { +func (fsw *FilerStoreWrapper) AddPathSpecificStore(path string, store FilerStore) { fsw.pathToStore.Put([]byte(path), store) }