mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-05-06 14:47:49 +08:00
Move ListDirectoryEntries logic to ListDirectoryPrefixedEntries in etcd meta storage backend (#5416)
Move ListDirectoryEntries logic to ListDirectoryPrefixedEntries
This commit is contained in:
parent
2dd2bb3e16
commit
9ca871af53
@ -178,11 +178,7 @@ func (store *EtcdStore) DeleteFolderChildren(ctx context.Context, fullpath weed_
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (store *EtcdStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPath weed_util.FullPath, startFileName string, includeStartFile bool, limit int64, prefix string, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
func (store *EtcdStore) ListDirectoryPrefixedEntries(ctx context.Context, dirPath weed_util.FullPath, startFileName string, includeStartFile bool, limit int64, prefix string, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
||||||
return lastFileName, filer.ErrUnsupportedListDirectoryPrefixed
|
directoryPrefix := genDirectoryKeyPrefix(dirPath, prefix)
|
||||||
}
|
|
||||||
|
|
||||||
func (store *EtcdStore) ListDirectoryEntries(ctx context.Context, dirPath weed_util.FullPath, startFileName string, includeStartFile bool, limit int64, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
|
||||||
directoryPrefix := genDirectoryKeyPrefix(dirPath, "")
|
|
||||||
lastFileStart := directoryPrefix
|
lastFileStart := directoryPrefix
|
||||||
if startFileName != "" {
|
if startFileName != "" {
|
||||||
lastFileStart = genDirectoryKeyPrefix(dirPath, startFileName)
|
lastFileStart = genDirectoryKeyPrefix(dirPath, startFileName)
|
||||||
@ -224,6 +220,10 @@ func (store *EtcdStore) ListDirectoryEntries(ctx context.Context, dirPath weed_u
|
|||||||
return lastFileName, err
|
return lastFileName, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (store *EtcdStore) ListDirectoryEntries(ctx context.Context, dirPath weed_util.FullPath, startFileName string, includeStartFile bool, limit int64, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error) {
|
||||||
|
return store.ListDirectoryPrefixedEntries(ctx, dirPath, startFileName, includeStartFile, limit, "", eachEntryFunc)
|
||||||
|
}
|
||||||
|
|
||||||
func genKey(dirPath, fileName string) (key []byte) {
|
func genKey(dirPath, fileName string) (key []byte) {
|
||||||
key = []byte(dirPath)
|
key = []byte(dirPath)
|
||||||
key = append(key, DIR_FILE_SEPARATOR)
|
key = append(key, DIR_FILE_SEPARATOR)
|
||||||
|
Loading…
Reference in New Issue
Block a user