mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 06:07:24 +08:00
remove unused code
This commit is contained in:
@@ -19,26 +19,19 @@ const (
|
|||||||
|
|
||||||
type UniversalRedis2Store struct {
|
type UniversalRedis2Store struct {
|
||||||
Client redis.UniversalClient
|
Client redis.UniversalClient
|
||||||
superLargeDirectoryHash map[string]string
|
superLargeDirectoryHash map[string]bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (store *UniversalRedis2Store) isSuperLargeDirectory(dir string) (dirHash string, isSuperLargeDirectory bool) {
|
func (store *UniversalRedis2Store) isSuperLargeDirectory(dir string) (isSuperLargeDirectory bool) {
|
||||||
dirHash, isSuperLargeDirectory = store.superLargeDirectoryHash[dir]
|
_, isSuperLargeDirectory = store.superLargeDirectoryHash[dir]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (store *UniversalRedis2Store) loadSuperLargeDirectories(superLargeDirectories []string) {
|
func (store *UniversalRedis2Store) loadSuperLargeDirectories(superLargeDirectories []string) {
|
||||||
// set directory hash
|
// set directory hash
|
||||||
store.superLargeDirectoryHash = make(map[string]string)
|
store.superLargeDirectoryHash = make(map[string]bool)
|
||||||
existingHash := make(map[string]string)
|
|
||||||
for _, dir := range superLargeDirectories {
|
for _, dir := range superLargeDirectories {
|
||||||
// adding dir hash to avoid duplicated names
|
store.superLargeDirectoryHash[dir] = true
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +61,7 @@ func (store *UniversalRedis2Store) InsertEntry(ctx context.Context, entry *filer
|
|||||||
}
|
}
|
||||||
|
|
||||||
dir, name := entry.FullPath.DirAndName()
|
dir, name := entry.FullPath.DirAndName()
|
||||||
if _, found := store.isSuperLargeDirectory(dir); found {
|
if store.isSuperLargeDirectory(dir) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +114,7 @@ func (store *UniversalRedis2Store) DeleteEntry(ctx context.Context, fullpath uti
|
|||||||
}
|
}
|
||||||
|
|
||||||
dir, name := fullpath.DirAndName()
|
dir, name := fullpath.DirAndName()
|
||||||
if _, found := store.isSuperLargeDirectory(dir); found {
|
if store.isSuperLargeDirectory(dir) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if name != "" {
|
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) {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user