Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

refactoring: simplify function parameter

Chris Lu8b26d1574005
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go
index 9589d92810..cd81b22108 100644
--- a/weed/storage/disk_location.go
+++ b/weed/storage/disk_location.go
@@ -63,14 +63,7 @@ func (l *DiskLocation) loadExistingVolume(dir os.FileInfo, needleMapKind NeedleM
}
}
-func (l *DiskLocation) concurrentLoadingVolumes(needleMapKind NeedleMapType, concurrentFlag bool) {
- var concurrency int
- if concurrentFlag {
- //You could choose a better optimized concurency value after testing at your environment
- concurrency = 10
- } else {
- concurrency = 1
- }
+func (l *DiskLocation) concurrentLoadingVolumes(needleMapKind NeedleMapType, concurrency int) {
task_queue := make(chan os.FileInfo, 10*concurrency)
go func() {
@@ -101,7 +94,7 @@ func (l *DiskLocation) loadExistingVolumes(needleMapKind NeedleMapType) {
l.Lock()
defer l.Unlock()
- l.concurrentLoadingVolumes(needleMapKind, true)
+ l.concurrentLoadingVolumes(needleMapKind, 10)
glog.V(0).Infoln("Store started on dir:", l.Directory, "with", len(l.volumes), "volumes", "max", l.MaxVolumeCount)
}