aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/benchmark.go7
-rw-r--r--weed/command/mount.go7
-rw-r--r--weed/command/mount_std.go2
-rw-r--r--weed/command/s3.go2
4 files changed, 8 insertions, 10 deletions
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index 44601e567..aa54946a7 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -36,6 +36,7 @@ type BenchmarkOptions struct {
read *bool
sequentialRead *bool
collection *string
+ replication *string
cpuprofile *string
maxCpu *int
grpcDialOption grpc.DialOption
@@ -61,6 +62,7 @@ func init() {
b.read = cmdBenchmark.Flag.Bool("read", true, "enable read")
b.sequentialRead = cmdBenchmark.Flag.Bool("readSequentially", false, "randomly read by ids from \"-list\" specified file")
b.collection = cmdBenchmark.Flag.String("collection", "benchmark", "write data to this collection")
+ b.replication = cmdBenchmark.Flag.String("replication", "000", "replication type")
b.cpuprofile = cmdBenchmark.Flag.String("cpuprofile", "", "cpu profile output file")
b.maxCpu = cmdBenchmark.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
sharedBytes = make([]byte, 1024)
@@ -228,8 +230,9 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {
MimeType: "image/bench", // prevent gzip benchmark content
}
ar := &operation.VolumeAssignRequest{
- Count: 1,
- Collection: *b.collection,
+ Count: 1,
+ Collection: *b.collection,
+ Replication: *b.replication,
}
if assignResult, err := operation.Assign(masterClient.GetMaster(), b.grpcDialOption, ar); err == nil {
fp.Server, fp.Fid, fp.Collection = assignResult.Url, assignResult.Fid, *b.collection
diff --git a/weed/command/mount.go b/weed/command/mount.go
index 760c68e40..ec790c999 100644
--- a/weed/command/mount.go
+++ b/weed/command/mount.go
@@ -8,7 +8,6 @@ import (
type MountOptions struct {
filer *string
- filerGrpcPort *int
filerMountRootPath *string
dir *string
dirListingLimit *int
@@ -29,7 +28,6 @@ var (
func init() {
cmdMount.Run = runMount // break init cycle
mountOptions.filer = cmdMount.Flag.String("filer", "localhost:8888", "weed filer location")
- 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", 100000, "limit directory listing size")
@@ -61,7 +59,7 @@ var cmdMount = &Command{
`,
}
-func parseFilerGrpcAddress(filer string, optionalGrpcPort int) (filerGrpcAddress string, err error) {
+func parseFilerGrpcAddress(filer string) (filerGrpcAddress string, err error) {
hostnameAndPort := strings.Split(filer, ":")
if len(hostnameAndPort) != 2 {
return "", fmt.Errorf("The filer should have hostname:port format: %v", hostnameAndPort)
@@ -73,9 +71,6 @@ func parseFilerGrpcAddress(filer string, optionalGrpcPort int) (filerGrpcAddress
}
filerGrpcPort := int(filerPort) + 10000
- if optionalGrpcPort != 0 {
- filerGrpcPort = optionalGrpcPort
- }
return fmt.Sprintf("%s:%d", hostnameAndPort[0], filerGrpcPort), nil
}
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 2b274e200..c047b94c3 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -87,7 +87,7 @@ func runMount(cmd *Command, args []string) bool {
c.Close()
})
- filerGrpcAddress, err := parseFilerGrpcAddress(*mountOptions.filer, *mountOptions.filerGrpcPort)
+ filerGrpcAddress, err := parseFilerGrpcAddress(*mountOptions.filer)
if err != nil {
glog.Fatal(err)
return false
diff --git a/weed/command/s3.go b/weed/command/s3.go
index a54ddd2f7..9aa9f8e2f 100644
--- a/weed/command/s3.go
+++ b/weed/command/s3.go
@@ -51,7 +51,7 @@ func runS3(cmd *Command, args []string) bool {
weed_server.LoadConfiguration("security", false)
- filerGrpcAddress, err := parseFilerGrpcAddress(*s3options.filer, *s3options.filerGrpcPort)
+ filerGrpcAddress, err := parseFilerGrpcAddress(*s3options.filer)
if err != nil {
glog.Fatal(err)
return false