* types packages is imported more than onece
* lazy-loading
* fix bugs
* fix bugs
* fix unit tests
* fix test error
* rename function
* unload ldb after initial startup
* Don't load ldb when starting volume server if ldbtimeout is set.
* remove uncessary unloadldb
* Update weed/command/server.go
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
* Update weed/command/volume.go
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: guol-fnst <goul-fnst@fujitsu.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
serverOptions.v.readMode=cmdServer.Flag.String("volume.readMode","proxy","[local|proxy|redirect] how to deal with non-local volume: 'not found|read in remote node|redirect volume location'.")
serverOptions.v.readMode=cmdServer.Flag.String("volume.readMode","proxy","[local|proxy|redirect] how to deal with non-local volume: 'not found|read in remote node|redirect volume location'.")
serverOptions.v.compactionMBPerSecond=cmdServer.Flag.Int("volume.compactionMBps",0,"limit compaction speed in mega bytes per second")
serverOptions.v.compactionMBPerSecond=cmdServer.Flag.Int("volume.compactionMBps",0,"limit compaction speed in mega bytes per second")
serverOptions.v.fileSizeLimitMB=cmdServer.Flag.Int("volume.fileSizeLimitMB",256,"limit file size to avoid out of memory")
serverOptions.v.fileSizeLimitMB=cmdServer.Flag.Int("volume.fileSizeLimitMB",256,"limit file size to avoid out of memory")
serverOptions.v.ldbTimeout=cmdServer.Flag.Int64("volume.index.leveldbTimeout",0,"alive time for leveldb (default to 0). If leveldb of volume is not accessed in ldbTimeout hours, it will be off loaded to reduce opened files and memory consumption.")
serverOptions.v.concurrentUploadLimitMB=cmdServer.Flag.Int("volume.concurrentUploadLimitMB",64,"limit total concurrent upload size")
serverOptions.v.concurrentUploadLimitMB=cmdServer.Flag.Int("volume.concurrentUploadLimitMB",64,"limit total concurrent upload size")
serverOptions.v.concurrentDownloadLimitMB=cmdServer.Flag.Int("volume.concurrentDownloadLimitMB",64,"limit total concurrent download size")
serverOptions.v.concurrentDownloadLimitMB=cmdServer.Flag.Int("volume.concurrentDownloadLimitMB",64,"limit total concurrent download size")
v.compactionMBPerSecond=cmdVolume.Flag.Int("compactionMBps",0,"limit background compaction or copying speed in mega bytes per second")
v.compactionMBPerSecond=cmdVolume.Flag.Int("compactionMBps",0,"limit background compaction or copying speed in mega bytes per second")
v.fileSizeLimitMB=cmdVolume.Flag.Int("fileSizeLimitMB",256,"limit file size to avoid out of memory")
v.fileSizeLimitMB=cmdVolume.Flag.Int("fileSizeLimitMB",256,"limit file size to avoid out of memory")
v.ldbTimeout=cmdVolume.Flag.Int64("index.leveldbTimeout",0,"alive time for leveldb (default to 0). If leveldb of volume is not accessed in ldbTimeout hours, it will be off loaded to reduce opened files and memory consumption.")
v.concurrentUploadLimitMB=cmdVolume.Flag.Int("concurrentUploadLimitMB",256,"limit total concurrent upload size")
v.concurrentUploadLimitMB=cmdVolume.Flag.Int("concurrentUploadLimitMB",256,"limit total concurrent upload size")
v.concurrentDownloadLimitMB=cmdVolume.Flag.Int("concurrentDownloadLimitMB",256,"limit total concurrent download size")
v.concurrentDownloadLimitMB=cmdVolume.Flag.Int("concurrentDownloadLimitMB",256,"limit total concurrent download size")
v.pprof=cmdVolume.Flag.Bool("pprof",false,"enable pprof http handlers. precludes --memprofile and --cpuprofile")
v.pprof=cmdVolume.Flag.Bool("pprof",false,"enable pprof http handlers. precludes --memprofile and --cpuprofile")
@ -249,6 +251,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v