|
|
@ -3,12 +3,12 @@ package filer2 |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
|
"github.com/karlseguin/ccache" |
|
|
|
"strings" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
"os" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
|
) |
|
|
|
|
|
|
|
type Filer struct { |
|
|
@ -24,15 +24,15 @@ func NewFiler(master string) *Filer { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func (f *Filer) SetStore(store FilerStore) () { |
|
|
|
func (f *Filer) SetStore(store FilerStore) { |
|
|
|
f.store = store |
|
|
|
} |
|
|
|
|
|
|
|
func (f *Filer) DisableDirectoryCache() () { |
|
|
|
func (f *Filer) DisableDirectoryCache() { |
|
|
|
f.directoryCache = nil |
|
|
|
} |
|
|
|
|
|
|
|
func (f *Filer) CreateEntry(entry *Entry) (error) { |
|
|
|
func (f *Filer) CreateEntry(entry *Entry) error { |
|
|
|
|
|
|
|
dirParts := strings.Split(string(entry.FullPath), "/") |
|
|
|
|
|
|
@ -140,7 +140,7 @@ func (f *Filer) ListDirectoryEntries(p FullPath, startFileName string, inclusive |
|
|
|
return f.store.ListDirectoryEntries(p, startFileName, inclusive, limit) |
|
|
|
} |
|
|
|
|
|
|
|
func (f *Filer) cacheGetDirectory(dirpath string) (*Entry) { |
|
|
|
func (f *Filer) cacheGetDirectory(dirpath string) *Entry { |
|
|
|
if f.directoryCache == nil { |
|
|
|
return nil |
|
|
|
} |
|
|
|