aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/leveldb
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-14 22:33:05 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-14 22:33:05 -0800
commitb5ceffe18845a08d3f709b41b39b69ba8dff2f35 (patch)
treeac78755b793dbf2ad66350ab24f611ae2615c324 /weed/filer/leveldb
parentc64bfb0e2ebf0ca547edd445ad7d7dd30d517280 (diff)
downloadseaweedfs-b5ceffe18845a08d3f709b41b39b69ba8dff2f35.tar.xz
seaweedfs-b5ceffe18845a08d3f709b41b39b69ba8dff2f35.zip
implement leveldb changes
Diffstat (limited to 'weed/filer/leveldb')
-rw-r--r--weed/filer/leveldb/leveldb_store.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/filer/leveldb/leveldb_store.go b/weed/filer/leveldb/leveldb_store.go
index e596a180e..32814af14 100644
--- a/weed/filer/leveldb/leveldb_store.go
+++ b/weed/filer/leveldb/leveldb_store.go
@@ -162,12 +162,11 @@ func (store *LevelDBStore) DeleteFolderChildren(ctx context.Context, fullpath we
return nil
}
-func (store *LevelDBStore) ListDirectoryEntries(ctx context.Context, fullpath weed_util.FullPath, startFileName string, inclusive bool,
- limit int) (entries []*filer.Entry, err error) {
- return store.ListDirectoryPrefixedEntries(ctx, fullpath, startFileName, inclusive, limit, "")
+func (store *LevelDBStore) ListDirectoryEntries(ctx context.Context, dirPath weed_util.FullPath, startFileName string, includeStartFile bool, limit int) (entries []*filer.Entry, hasMore bool, err error) {
+ return store.ListDirectoryPrefixedEntries(ctx, dirPath, startFileName, includeStartFile, limit, "")
}
-func (store *LevelDBStore) ListDirectoryPrefixedEntries(ctx context.Context, fullpath weed_util.FullPath, startFileName string, inclusive bool, limit int, prefix string) (entries []*filer.Entry, err error) {
+func (store *LevelDBStore) ListDirectoryPrefixedEntries(ctx context.Context, fullpath weed_util.FullPath, startFileName string, inclusive bool, limit int, prefix string) (entries []*filer.Entry, hasMore bool, err error) {
directoryPrefix := genDirectoryKeyPrefix(fullpath, prefix)
lastFileStart := directoryPrefix
@@ -190,6 +189,7 @@ func (store *LevelDBStore) ListDirectoryPrefixedEntries(ctx context.Context, ful
}
limit--
if limit < 0 {
+ hasMore = true
break
}
entry := &filer.Entry{
@@ -204,7 +204,7 @@ func (store *LevelDBStore) ListDirectoryPrefixedEntries(ctx context.Context, ful
}
iter.Release()
- return entries, err
+ return entries, hasMore, err
}
func genKey(dirPath, fileName string) (key []byte) {