diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-07-22 01:14:36 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-07-22 01:14:36 -0700 |
| commit | 6319d84f42fba2a1c1617c4d2603adac4ea57301 (patch) | |
| tree | e90403bf8cc9a2946bf2ecec94d411efb00bed6a /weed/command | |
| parent | 922c614bdea87028d0e5a690b3e3b7f2d4675f11 (diff) | |
| download | seaweedfs-6319d84f42fba2a1c1617c4d2603adac4ea57301.tar.xz seaweedfs-6319d84f42fba2a1c1617c4d2603adac4ea57301.zip | |
s3 API add ListObjectsV1
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/mount.go | 2 | ||||
| -rw-r--r-- | weed/command/mount_std.go | 19 |
2 files changed, 18 insertions, 3 deletions
diff --git a/weed/command/mount.go b/weed/command/mount.go index d35723c15..0912a51ba 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -11,6 +11,7 @@ type MountOptions struct { filerGrpcPort *int filerMountRootPath *string dir *string + dirListingLimit *int collection *string replication *string ttlSec *int @@ -28,6 +29,7 @@ func init() { mountOptions.filerGrpcPort = cmdMount.Flag.Int("filer.grpc.port", 0, "filer grpc server listen port, default to http port + 10000") mountOptions.filerMountRootPath = cmdMount.Flag.String("filer.path", "/", "mount this remote path from filer server") mountOptions.dir = cmdMount.Flag.String("dir", ".", "mount weed filer to this directory") + mountOptions.dirListingLimit = cmdMount.Flag.Int("dirListLimit", 1000, "limit sub dir listing size") mountOptions.collection = cmdMount.Flag.String("collection", "", "collection to create the files") mountOptions.replication = cmdMount.Flag.String("replication", "000", "replication to create to files") mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds") diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index 4fb6a4465..8f4d8dc36 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -11,6 +11,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/filesys" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/util" + "strings" ) func runMount(cmd *Command, args []string) bool { @@ -57,9 +58,21 @@ func runMount(cmd *Command, args []string) bool { return false } - err = fs.Serve(c, filesys.NewSeaweedFileSystem( - filerGrpcAddress, *mountOptions.filerMountRootPath, *mountOptions.collection, *mountOptions.replication, int32(*mountOptions.ttlSec), - *mountOptions.chunkSizeLimitMB, *mountOptions.dataCenter)) + mountRoot := *mountOptions.filerMountRootPath + if mountRoot != "/" && strings.HasSuffix(mountRoot, "/") { + mountRoot = mountRoot[0: len(mountRoot)-1] + } + + err = fs.Serve(c, filesys.NewSeaweedFileSystem(&filesys.Option{ + FilerGrpcAddress: filerGrpcAddress, + FilerMountRootPath: mountRoot, + Collection: *mountOptions.collection, + Replication: *mountOptions.replication, + TtlSec: int32(*mountOptions.ttlSec), + ChunkSizeLimit: int64(*mountOptions.chunkSizeLimitMB) * 1024 * 1024, + DataCenter: *mountOptions.dataCenter, + DirListingLimit: *mountOptions.dirListingLimit, + })) if err != nil { fuse.Unmount(*mountOptions.dir) } |
