Aaron Gipson
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with
43 additions and
35 deletions
-
weed/filer/redis/redis_cluster_store.go
-
weed/filer/redis/redis_store.go
-
weed/filer/redis/universal_redis_store.go
-
weed/filer/redis/universal_redis_store_kv.go
-
weed/filer/redis2/redis_cluster_store.go
-
weed/filer/redis2/redis_sentinel_store.go
-
weed/filer/redis2/redis_store.go
-
weed/filer/redis2/universal_redis_store.go
-
weed/filer/redis2/universal_redis_store_kv.go
-
weed/filer/redis3/ItemList.go
-
weed/filer/redis3/item_list_serde.go
-
weed/filer/redis3/kv_directory_children.go
-
weed/filer/redis3/kv_directory_children_test.go
-
weed/filer/redis3/redis_cluster_store.go
-
weed/filer/redis3/redis_sentinel_store.go
-
weed/filer/redis3/redis_store.go
-
weed/filer/redis3/skiplist_element_store.go
-
weed/filer/redis3/universal_redis_store.go
-
weed/filer/redis3/universal_redis_store_kv.go
-
weed/filer/redis_lua/redis_cluster_store.go
-
weed/filer/redis_lua/redis_sentinel_store.go
-
weed/filer/redis_lua/redis_store.go
-
weed/filer/redis_lua/stored_procedure/init.go
-
weed/filer/redis_lua/universal_redis_store.go
-
weed/filer/redis_lua/universal_redis_store_kv.go
|
@ -1,7 +1,7 @@ |
|
|
package redis |
|
|
package redis |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -1,7 +1,7 @@ |
|
|
package redis |
|
|
package redis |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -3,11 +3,12 @@ package redis |
|
|
import ( |
|
|
import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"golang.org/x/exp/slices" |
|
|
|
|
|
"strings" |
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"golang.org/x/exp/slices" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
|
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
|
@ -4,7 +4,7 @@ import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
package redis2 |
|
|
package redis2 |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -1,10 +1,11 @@ |
|
|
package redis2 |
|
|
package redis2 |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"time" |
|
|
|
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func init() { |
|
|
func init() { |
|
|
|
@ -1,7 +1,7 @@ |
|
|
package redis2 |
|
|
package redis2 |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -5,7 +5,7 @@ import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
|
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
@ -57,7 +57,7 @@ func (store *UniversalRedis2Store) InsertEntry(ctx context.Context, entry *filer |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if name != "" { |
|
|
if name != "" { |
|
|
if err = store.Client.ZAddNX(ctx, genDirectoryListKey(dir), &redis.Z{Score: 0, Member: name}).Err(); err != nil { |
|
|
|
|
|
|
|
|
if err = store.Client.ZAddNX(ctx, genDirectoryListKey(dir), redis.Z{Score: 0, Member: name}).Err(); err != nil { |
|
|
return fmt.Errorf("persisting %s in parent dir: %v", entry.FullPath, err) |
|
|
return fmt.Errorf("persisting %s in parent dir: %v", entry.FullPath, err) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
@ -4,7 +4,7 @@ import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
@ -4,7 +4,8 @@ import ( |
|
|
"bytes" |
|
|
"bytes" |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util/skiplist" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util/skiplist" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -399,9 +400,9 @@ func (nl *ItemList) NodeSize(node *skiplist.SkipListElementReference) int { |
|
|
|
|
|
|
|
|
func (nl *ItemList) NodeAddMember(node *skiplist.SkipListElementReference, names ...string) error { |
|
|
func (nl *ItemList) NodeAddMember(node *skiplist.SkipListElementReference, names ...string) error { |
|
|
key := fmt.Sprintf("%s%dm", nl.prefix, node.ElementPointer) |
|
|
key := fmt.Sprintf("%s%dm", nl.prefix, node.ElementPointer) |
|
|
var members []*redis.Z |
|
|
|
|
|
|
|
|
var members []redis.Z |
|
|
for _, name := range names { |
|
|
for _, name := range names { |
|
|
members = append(members, &redis.Z{ |
|
|
|
|
|
|
|
|
members = append(members, redis.Z{ |
|
|
Score: 0, |
|
|
Score: 0, |
|
|
Member: name, |
|
|
Member: name, |
|
|
}) |
|
|
}) |
|
|
|
@ -1,7 +1,7 @@ |
|
|
package redis3 |
|
|
package redis3 |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util/skiplist" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util/skiplist" |
|
|
"google.golang.org/protobuf/proto" |
|
|
"google.golang.org/protobuf/proto" |
|
|
|
@ -3,7 +3,8 @@ package redis3 |
|
|
import ( |
|
|
import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
@ -3,11 +3,12 @@ package redis3 |
|
|
import ( |
|
|
import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
"github.com/stvp/tempredis" |
|
|
|
|
|
"strconv" |
|
|
"strconv" |
|
|
"testing" |
|
|
"testing" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
|
|
|
"github.com/stvp/tempredis" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var names = []string{ |
|
|
var names = []string{ |
|
|
|
@ -1,9 +1,9 @@ |
|
|
package redis3 |
|
|
package redis3 |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
"github.com/go-redsync/redsync/v4" |
|
|
"github.com/go-redsync/redsync/v4" |
|
|
"github.com/go-redsync/redsync/v4/redis/goredis/v8" |
|
|
|
|
|
|
|
|
"github.com/go-redsync/redsync/v4/redis/goredis/v9" |
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -3,9 +3,9 @@ package redis3 |
|
|
import ( |
|
|
import ( |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
"github.com/go-redsync/redsync/v4" |
|
|
"github.com/go-redsync/redsync/v4" |
|
|
"github.com/go-redsync/redsync/v4/redis/goredis/v8" |
|
|
|
|
|
|
|
|
"github.com/go-redsync/redsync/v4/redis/goredis/v9" |
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -1,9 +1,9 @@ |
|
|
package redis3 |
|
|
package redis3 |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
"github.com/go-redsync/redsync/v4" |
|
|
"github.com/go-redsync/redsync/v4" |
|
|
"github.com/go-redsync/redsync/v4/redis/goredis/v8" |
|
|
|
|
|
|
|
|
"github.com/go-redsync/redsync/v4/redis/goredis/v9" |
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -3,7 +3,8 @@ package redis3 |
|
|
import ( |
|
|
import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util/skiplist" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util/skiplist" |
|
|
"google.golang.org/protobuf/proto" |
|
|
"google.golang.org/protobuf/proto" |
|
|
|
@ -5,7 +5,7 @@ import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
|
|
|
|
|
|
redsync "github.com/go-redsync/redsync/v4" |
|
|
redsync "github.com/go-redsync/redsync/v4" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
|
@ -4,7 +4,7 @@ import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
package redis_lua |
|
|
package redis_lua |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -1,10 +1,11 @@ |
|
|
package redis_lua |
|
|
package redis_lua |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"time" |
|
|
|
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func init() { |
|
|
func init() { |
|
|
|
@ -1,7 +1,7 @@ |
|
|
package redis_lua |
|
|
package redis_lua |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
"github.com/seaweedfs/seaweedfs/weed/util" |
|
|
) |
|
|
) |
|
|
|
@ -2,7 +2,8 @@ package stored_procedure |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
_ "embed" |
|
|
_ "embed" |
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func init() { |
|
|
func init() { |
|
|
|
@ -5,7 +5,7 @@ import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
|
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer/redis_lua/stored_procedure" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer/redis_lua/stored_procedure" |
|
|
|
@ -4,7 +4,7 @@ import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
|
|
|
|
|
|
"github.com/go-redis/redis/v8" |
|
|
|
|
|
|
|
|
"github.com/redis/go-redis/v9" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
"github.com/seaweedfs/seaweedfs/weed/filer" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|