diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-11 21:12:41 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-11 21:12:41 -0700 |
| commit | df97da25f902912dd527d4aed567408c3ca0f9ae (patch) | |
| tree | 3e5d4d6bcfb69b3ab869c0b519048943f26e69a1 /weed/command/mount.go | |
| parent | c8ca234773e2a0c57c503c1f3464d1ded4edd2df (diff) | |
| download | seaweedfs-df97da25f902912dd527d4aed567408c3ca0f9ae.tar.xz seaweedfs-df97da25f902912dd527d4aed567408c3ca0f9ae.zip | |
mount: add on disk caching
Diffstat (limited to 'weed/command/mount.go')
| -rw-r--r-- | weed/command/mount.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/weed/command/mount.go b/weed/command/mount.go index adf384a6f..6165402b4 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -1,5 +1,9 @@ package command +import ( + "os" +) + type MountOptions struct { filer *string filerMountRootPath *string @@ -9,7 +13,8 @@ type MountOptions struct { replication *string ttlSec *int chunkSizeLimitMB *int - chunkCacheCountLimit *int64 + cacheDir *string + cacheSizeMB *int64 dataCenter *string allowOthers *bool umaskString *string @@ -33,7 +38,8 @@ func init() { mountOptions.replication = cmdMount.Flag.String("replication", "", "replication(e.g. 000, 001) to create to files. If empty, let filer decide.") mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds") mountOptions.chunkSizeLimitMB = cmdMount.Flag.Int("chunkSizeLimitMB", 4, "local write buffer size, also chunk large files") - mountOptions.chunkCacheCountLimit = cmdMount.Flag.Int64("chunkCacheCountLimit", 1000, "number of file chunks to cache in memory") + mountOptions.cacheDir = cmdMount.Flag.String("cacheDir", os.TempDir(), "local cache directory for file chunks") + mountOptions.cacheSizeMB = cmdMount.Flag.Int64("cacheCapacityMB", 1000, "local cache capacity in MB") mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center") mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system") mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111") |
