diff options
| author | Nikita Borzykh <354018+sample@users.noreply.github.com> | 2024-03-25 00:08:54 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-24 14:08:54 -0700 |
| commit | 9ca871af5313475ad9138a2288d71a1bd0843ccd (patch) | |
| tree | dd2ca1baf21cf8bd52b8cf56dbc5601f6b479c8e | |
| parent | 2dd2bb3e16eada165a47b54af807a4c44e72f921 (diff) | |
| download | seaweedfs-9ca871af5313475ad9138a2288d71a1bd0843ccd.tar.xz seaweedfs-9ca871af5313475ad9138a2288d71a1bd0843ccd.zip | |
Move ListDirectoryEntries logic to ListDirectoryPrefixedEntries in etcd meta storage backend (#5416)
Move ListDirectoryEntries logic to ListDirectoryPrefixedEntries
| -rw-r--r-- | weed/filer/etcd/etcd_store.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/filer/etcd/etcd_store.go b/weed/filer/etcd/etcd_store.go index 12261827c..fa2a72ca5 100644 --- a/weed/filer/etcd/etcd_store.go +++ b/weed/filer/etcd/etcd_store.go @@ -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) { - return lastFileName, filer.ErrUnsupportedListDirectoryPrefixed -} - -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, "") + directoryPrefix := genDirectoryKeyPrefix(dirPath, prefix) lastFileStart := directoryPrefix if startFileName != "" { lastFileStart = genDirectoryKeyPrefix(dirPath, startFileName) @@ -224,6 +220,10 @@ func (store *EtcdStore) ListDirectoryEntries(ctx context.Context, dirPath weed_u 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) { key = []byte(dirPath) key = append(key, DIR_FILE_SEPARATOR) |
