aboutsummaryrefslogtreecommitdiff
path: root/weed/command/compact.go
diff options
context:
space:
mode:
authorj.laycock <joseph.laycock@4sightimaging.com>2019-09-03 17:00:59 +0100
committerj.laycock <joseph.laycock@4sightimaging.com>2019-09-03 17:00:59 +0100
commit1f01eb78e81454c54569d8c7baaca115982a87c2 (patch)
tree93718397d25eef7bc6f22136deb091f195a2c6f5 /weed/command/compact.go
parentd637d86d22f6f4033d931dd59aa86233521246a4 (diff)
downloadseaweedfs-1f01eb78e81454c54569d8c7baaca115982a87c2.tar.xz
seaweedfs-1f01eb78e81454c54569d8c7baaca115982a87c2.zip
Rename mem_map to mMap, remove some in_memory variables being passed around, added MemoryMapped member to volume struct
Diffstat (limited to 'weed/command/compact.go')
-rw-r--r--weed/command/compact.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/weed/command/compact.go b/weed/command/compact.go
index 7a61f0b95..f10b0b2bc 100644
--- a/weed/command/compact.go
+++ b/weed/command/compact.go
@@ -26,7 +26,6 @@ var (
compactVolumeId = cmdCompact.Flag.Int("volumeId", -1, "a volume id. The volume should already exist in the dir.")
compactMethod = cmdCompact.Flag.Int("method", 0, "option to choose which compact method. use 0 or 1.")
compactVolumePreallocate = cmdCompact.Flag.Int64("preallocateMB", 0, "preallocate volume disk space")
- compactVolumeInMemory = cmdCompact.Flag.Bool("volumeInMemory", false, "create the volume in memory")
)
func runCompact(cmd *Command, args []string) bool {
@@ -36,16 +35,15 @@ func runCompact(cmd *Command, args []string) bool {
}
preallocate := *compactVolumePreallocate * (1 << 20)
- inMemory := *compactVolumeInMemory
vid := needle.VolumeId(*compactVolumeId)
v, err := storage.NewVolume(*compactVolumePath, *compactVolumeCollection, vid,
- storage.NeedleMapInMemory, nil, nil, preallocate, inMemory)
+ storage.NeedleMapInMemory, nil, nil, preallocate, false)
if err != nil {
glog.Fatalf("Load Volume [ERROR] %s\n", err)
}
if *compactMethod == 0 {
- if err = v.Compact(preallocate, 0, inMemory); err != nil {
+ if err = v.Compact(preallocate, 0); err != nil {
glog.Fatalf("Compact Volume [ERROR] %s\n", err)
}
} else {