aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-12-22 02:33:31 -0800
committerChris Lu <chris.lu@gmail.com>2020-12-22 02:33:31 -0800
commit6c4f32d1735d247fbf598663f8fe6ecc286dc099 (patch)
treeb03f573e7e323d43438eb9211072b82eeb451e59
parent90d785a15fb8c0379e068aab94066cf5e3622071 (diff)
downloadseaweedfs-6c4f32d1735d247fbf598663f8fe6ecc286dc099.tar.xz
seaweedfs-6c4f32d1735d247fbf598663f8fe6ecc286dc099.zip
remove unused code
-rw-r--r--weed/filer/redis2/universal_redis_store.go23
1 files changed, 8 insertions, 15 deletions
diff --git a/weed/filer/redis2/universal_redis_store.go b/weed/filer/redis2/universal_redis_store.go
index c6b566305..6db5541c6 100644
--- a/weed/filer/redis2/universal_redis_store.go
+++ b/weed/filer/redis2/universal_redis_store.go
@@ -19,26 +19,19 @@ const (
type UniversalRedis2Store struct {
Client redis.UniversalClient
- superLargeDirectoryHash map[string]string
+ superLargeDirectoryHash map[string]bool
}
-func (store *UniversalRedis2Store) isSuperLargeDirectory(dir string) (dirHash string, isSuperLargeDirectory bool) {
- dirHash, isSuperLargeDirectory = store.superLargeDirectoryHash[dir]
+func (store *UniversalRedis2Store) isSuperLargeDirectory(dir string) (isSuperLargeDirectory bool) {
+ _, isSuperLargeDirectory = store.superLargeDirectoryHash[dir]
return
}
func (store *UniversalRedis2Store) loadSuperLargeDirectories(superLargeDirectories []string) {
// set directory hash
- store.superLargeDirectoryHash = make(map[string]string)
- existingHash := make(map[string]string)
+ store.superLargeDirectoryHash = make(map[string]bool)
for _, dir := range superLargeDirectories {
- // adding dir hash to avoid duplicated names
- dirHash := util.Md5String([]byte(dir))[:4]
- store.superLargeDirectoryHash[dir] = dirHash
- if existingDir, found := existingHash[dirHash]; found {
- glog.Fatalf("directory %s has the same hash as %s", dir, existingDir)
- }
- existingHash[dirHash] = dir
+ store.superLargeDirectoryHash[dir] = true
}
}
@@ -68,7 +61,7 @@ func (store *UniversalRedis2Store) InsertEntry(ctx context.Context, entry *filer
}
dir, name := entry.FullPath.DirAndName()
- if _, found := store.isSuperLargeDirectory(dir); found {
+ if store.isSuperLargeDirectory(dir) {
return nil
}
@@ -121,7 +114,7 @@ func (store *UniversalRedis2Store) DeleteEntry(ctx context.Context, fullpath uti
}
dir, name := fullpath.DirAndName()
- if _, found := store.isSuperLargeDirectory(dir); found {
+ if store.isSuperLargeDirectory(dir) {
return nil
}
if name != "" {
@@ -136,7 +129,7 @@ func (store *UniversalRedis2Store) DeleteEntry(ctx context.Context, fullpath uti
func (store *UniversalRedis2Store) DeleteFolderChildren(ctx context.Context, fullpath util.FullPath) (err error) {
- if _, found := store.isSuperLargeDirectory(string(fullpath)); found {
+ if store.isSuperLargeDirectory(string(fullpath)) {
return nil
}