aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2019-01-16 17:22:32 -0800
committerGitHub <noreply@github.com>2019-01-16 17:22:32 -0800
commit041d29eea302edad6a988b0f10b21dd42ba5ba16 (patch)
tree1be9b1b5e7f91693f4cabe3ae0d114cb7f7dced6 /weed/command
parent123df7453f75c437c98ed12c14ad48748140563a (diff)
parentab6be025d76748388ad3eea6fe6ca000db1c2435 (diff)
downloadseaweedfs-041d29eea302edad6a988b0f10b21dd42ba5ba16.tar.xz
seaweedfs-041d29eea302edad6a988b0f10b21dd42ba5ba16.zip
Merge pull request #838 from bingoohuang/master
go fmt and fix some typo
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/backup.go2
-rw-r--r--weed/command/benchmark.go12
-rw-r--r--weed/command/filer_copy.go4
-rw-r--r--weed/command/filer_export.go2
4 files changed, 10 insertions, 10 deletions
diff --git a/weed/command/backup.go b/weed/command/backup.go
index 7cdec34ad..072aea75b 100644
--- a/weed/command/backup.go
+++ b/weed/command/backup.go
@@ -38,7 +38,7 @@ var cmdBackup = &Command{
This will help to backup future new volumes.
Usually backing up is just copying the .dat (and .idx) files.
- But it's tricky to incremententally copy the differences.
+ But it's tricky to incrementally copy the differences.
The complexity comes when there are multiple addition, deletion and compaction.
This tool will handle them correctly and efficiently, avoiding unnecessary data transporation.
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index d0a1a587a..60fd88ccd 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -45,7 +45,7 @@ var (
)
func init() {
- cmdBenchmark.Run = runbenchmark // break init cycle
+ cmdBenchmark.Run = runBenchmark // break init cycle
cmdBenchmark.IsDebug = cmdBenchmark.Flag.Bool("debug", false, "verbose debug information")
b.masters = cmdBenchmark.Flag.String("master", "localhost:9333", "SeaweedFS master location")
b.concurrency = cmdBenchmark.Flag.Int("c", 16, "number of concurrent write or read processes")
@@ -101,7 +101,7 @@ var (
readStats *stats
)
-func runbenchmark(cmd *Command, args []string) bool {
+func runBenchmark(cmd *Command, args []string) bool {
fmt.Printf("This is SeaweedFS version %s %s %s\n", util.VERSION, runtime.GOOS, runtime.GOARCH)
if *b.maxCpu < 1 {
*b.maxCpu = runtime.NumCPU()
@@ -121,17 +121,17 @@ func runbenchmark(cmd *Command, args []string) bool {
masterClient.WaitUntilConnected()
if *b.write {
- bench_write()
+ benchWrite()
}
if *b.read {
- bench_read()
+ benchRead()
}
return true
}
-func bench_write() {
+func benchWrite() {
fileIdLineChan := make(chan string)
finishChan := make(chan bool)
writeStats = newStats(*b.concurrency)
@@ -158,7 +158,7 @@ func bench_write() {
writeStats.printStats()
}
-func bench_read() {
+func benchRead() {
fileIdLineChan := make(chan string)
finishChan := make(chan bool)
readStats = newStats(*b.concurrency)
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index 2d318bc1a..3638bcb27 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -315,7 +315,7 @@ func uploadFileInChunks(filerAddress, filerGrpcAddress string, urlFolder string,
func detectMimeType(f *os.File) string {
head := make([]byte, 512)
- f.Seek(0, 0)
+ f.Seek(0, io.SeekStart)
n, err := f.Read(head)
if err == io.EOF {
return ""
@@ -324,7 +324,7 @@ func detectMimeType(f *os.File) string {
fmt.Printf("read head of %v: %v\n", f.Name(), err)
return "application/octet-stream"
}
- f.Seek(0, 0)
+ f.Seek(0, io.SeekStart)
mimeType := http.DetectContentType(head[:n])
return mimeType
}
diff --git a/weed/command/filer_export.go b/weed/command/filer_export.go
index dcc8ccd4e..7a2e7920a 100644
--- a/weed/command/filer_export.go
+++ b/weed/command/filer_export.go
@@ -14,7 +14,7 @@ func init() {
}
var cmdFilerExport = &Command{
- UsageLine: "filer.export -sourceStore=mysql -targetStroe=cassandra",
+ UsageLine: "filer.export -sourceStore=mysql -targetStore=cassandra",
Short: "export meta data in filer store",
Long: `Iterate the file tree and export all metadata out