aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-06-05 15:27:10 -0700
committerChris Lu <chris.lu@gmail.com>2020-06-05 15:27:10 -0700
commit45a9d852d3d10bdaaf2a5358e4a4d823a7edbfcc (patch)
treed122e72706f1d9130002798583ac81882974dd32
parent03c2f0350904bc2e69faf5f9a552092826df9ae3 (diff)
downloadseaweedfs-45a9d852d3d10bdaaf2a5358e4a4d823a7edbfcc.tar.xz
seaweedfs-45a9d852d3d10bdaaf2a5358e4a4d823a7edbfcc.zip
go fmt
-rw-r--r--weed/command/mount_std.go2
-rw-r--r--weed/command/server.go4
-rw-r--r--weed/command/volume.go4
-rw-r--r--weed/messaging/msgclient/publisher.go2
-rw-r--r--weed/messaging/msgclient/subscriber.go6
-rw-r--r--weed/stats/disk_windows.go1
-rw-r--r--weed/storage/disk_location.go20
-rw-r--r--weed/storage/types/offset_4bytes.go2
-rw-r--r--weed/storage/types/offset_5bytes.go2
-rw-r--r--weed/util/constants.go4
-rw-r--r--weed/wdclient/exclusive_locks/exclusive_locker.go2
11 files changed, 25 insertions, 24 deletions
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 4e83a44a0..c95626651 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -34,7 +34,7 @@ func runMount(cmd *Command, args []string) bool {
return false
}
- if len(args)>0 {
+ if len(args) > 0 {
return false
}
diff --git a/weed/command/server.go b/weed/command/server.go
index a48f78b5a..da74f4760 100644
--- a/weed/command/server.go
+++ b/weed/command/server.go
@@ -55,7 +55,7 @@ var (
serverDisableHttp = cmdServer.Flag.Bool("disableHttp", false, "disable http requests, only gRPC operations are allowed.")
volumeDataFolders = cmdServer.Flag.String("dir", os.TempDir(), "directories to store data files. dir[,dir]...")
volumeMaxDataVolumeCounts = cmdServer.Flag.String("volume.max", "7", "maximum numbers of volumes, count[,count]... If set to zero on non-windows OS, the limit will be auto configured.")
- volumeMinFreeSpacePercent = cmdServer.Flag.String("volume.minFreeSpacePercent", "0", "minimum free disk space(in percents). If free disk space lower this value - all volumes marks as ReadOnly")
+ volumeMinFreeSpacePercent = cmdServer.Flag.String("volume.minFreeSpacePercent", "0", "minimum free disk space(in percents). If free disk space lower this value - all volumes marks as ReadOnly")
// pulseSeconds = cmdServer.Flag.Int("pulseSeconds", 5, "number of seconds between heartbeats")
isStartingFiler = cmdServer.Flag.Bool("filer", false, "whether to start filer")
@@ -208,7 +208,7 @@ func runServer(cmd *Command, args []string) bool {
// start volume server
{
- go serverOptions.v.startVolumeServer(*volumeDataFolders, *volumeMaxDataVolumeCounts, *serverWhiteListOption, *volumeMinFreeSpacePercent )
+ go serverOptions.v.startVolumeServer(*volumeDataFolders, *volumeMaxDataVolumeCounts, *serverWhiteListOption, *volumeMinFreeSpacePercent)
}
diff --git a/weed/command/volume.go b/weed/command/volume.go
index dd44505de..89cf930f2 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -52,7 +52,7 @@ type VolumeServerOptions struct {
memProfile *string
compactionMBPerSecond *int
fileSizeLimitMB *int
- minFreeSpacePercent []float32
+ minFreeSpacePercent []float32
}
func init() {
@@ -88,7 +88,7 @@ var (
volumeFolders = cmdVolume.Flag.String("dir", os.TempDir(), "directories to store data files. dir[,dir]...")
maxVolumeCounts = cmdVolume.Flag.String("max", "7", "maximum numbers of volumes, count[,count]... If set to zero on non-windows OS, the limit will be auto configured.")
volumeWhiteListOption = cmdVolume.Flag.String("whiteList", "", "comma separated Ip addresses having write permission. No limit if empty.")
- minFreeSpacePercent = cmdVolume.Flag.String("minFreeSpacePercent ", "0", "minimum free disk space(in percents). If free disk space lower this value - all volumes marks as ReadOnly")
+ minFreeSpacePercent = cmdVolume.Flag.String("minFreeSpacePercent ", "0", "minimum free disk space(in percents). If free disk space lower this value - all volumes marks as ReadOnly")
)
func runVolume(cmd *Command, args []string) bool {
diff --git a/weed/messaging/msgclient/publisher.go b/weed/messaging/msgclient/publisher.go
index b0fc5afbf..1aa483ff8 100644
--- a/weed/messaging/msgclient/publisher.go
+++ b/weed/messaging/msgclient/publisher.go
@@ -26,7 +26,7 @@ func (mc *MessagingClient) NewPublisher(publisherId, namespace, topic string) (*
for i := 0; i < int(topicConfiguration.PartitionCount); i++ {
tp := broker.TopicPartition{
Namespace: namespace,
- Topic: topic,
+ Topic: topic,
Partition: int32(i),
}
grpcClientConn, err := mc.findBroker(tp)
diff --git a/weed/messaging/msgclient/subscriber.go b/weed/messaging/msgclient/subscriber.go
index caa795626..6c7dc1ab7 100644
--- a/weed/messaging/msgclient/subscriber.go
+++ b/weed/messaging/msgclient/subscriber.go
@@ -3,8 +3,8 @@ package msgclient
import (
"context"
"io"
- "time"
"sync"
+ "time"
"github.com/chrislusf/seaweedfs/weed/messaging/broker"
"github.com/chrislusf/seaweedfs/weed/pb/messaging_pb"
@@ -26,12 +26,12 @@ func (mc *MessagingClient) NewSubscriber(subscriberId, namespace, topic string,
subscriberCancels := make([]context.CancelFunc, topicConfiguration.PartitionCount)
for i := 0; i < int(topicConfiguration.PartitionCount); i++ {
- if partitionId>=0 && i != partitionId {
+ if partitionId >= 0 && i != partitionId {
continue
}
tp := broker.TopicPartition{
Namespace: namespace,
- Topic: topic,
+ Topic: topic,
Partition: int32(i),
}
grpcClientConn, err := mc.findBroker(tp)
diff --git a/weed/stats/disk_windows.go b/weed/stats/disk_windows.go
index 1185e129c..3cfa52c0b 100644
--- a/weed/stats/disk_windows.go
+++ b/weed/stats/disk_windows.go
@@ -6,6 +6,7 @@ import (
"syscall"
"unsafe"
)
+
var (
kernel32 = windows.NewLazySystemDLL("Kernel32.dll")
getDiskFreeSpaceEx = kernel32.NewProc("GetDiskFreeSpaceExW")
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go
index dafc0fb4a..853facc49 100644
--- a/weed/storage/disk_location.go
+++ b/weed/storage/disk_location.go
@@ -1,13 +1,13 @@
package storage
import (
- "fmt"
+ "fmt"
"github.com/chrislusf/seaweedfs/weed/stats"
- "io/ioutil"
- "os"
+ "io/ioutil"
+ "os"
"path/filepath"
- "strings"
- "sync"
+ "strings"
+ "sync"
"time"
"github.com/chrislusf/seaweedfs/weed/glog"
@@ -16,11 +16,11 @@ import (
)
type DiskLocation struct {
- Directory string
- MaxVolumeCount int
+ Directory string
+ MaxVolumeCount int
MinFreeSpacePercent float32
- volumes map[needle.VolumeId]*Volume
- volumesLock sync.RWMutex
+ volumes map[needle.VolumeId]*Volume
+ volumesLock sync.RWMutex
// erasure coding
ecVolumes map[needle.VolumeId]*erasure_coding.EcVolume
@@ -315,4 +315,4 @@ func (l *DiskLocation) CheckDiskSpace() {
}
}
-} \ No newline at end of file
+}
diff --git a/weed/storage/types/offset_4bytes.go b/weed/storage/types/offset_4bytes.go
index ded5b88cb..d53147e21 100644
--- a/weed/storage/types/offset_4bytes.go
+++ b/weed/storage/types/offset_4bytes.go
@@ -11,7 +11,7 @@ type OffsetHigher struct {
}
const (
- OffsetSize = 4
+ OffsetSize = 4
MaxPossibleVolumeSize uint64 = 4 * 1024 * 1024 * 1024 * 8 // 32GB
)
diff --git a/weed/storage/types/offset_5bytes.go b/weed/storage/types/offset_5bytes.go
index 1db22d524..05c6d2f39 100644
--- a/weed/storage/types/offset_5bytes.go
+++ b/weed/storage/types/offset_5bytes.go
@@ -11,7 +11,7 @@ type OffsetHigher struct {
}
const (
- OffsetSize = 4 + 1
+ OffsetSize = 4 + 1
MaxPossibleVolumeSize uint64 = 4 * 1024 * 1024 * 1024 * 8 * 256 /* 256 is from the extra byte */ // 8TB
)
diff --git a/weed/util/constants.go b/weed/util/constants.go
index 7c3927a66..fda69c8ae 100644
--- a/weed/util/constants.go
+++ b/weed/util/constants.go
@@ -6,9 +6,9 @@ import (
var (
VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 79)
- COMMIT = ""
+ COMMIT = ""
)
func Version() string {
return VERSION + " " + COMMIT
-} \ No newline at end of file
+}
diff --git a/weed/wdclient/exclusive_locks/exclusive_locker.go b/weed/wdclient/exclusive_locks/exclusive_locker.go
index 67823e7f4..1ecfe6ce2 100644
--- a/weed/wdclient/exclusive_locks/exclusive_locker.go
+++ b/weed/wdclient/exclusive_locks/exclusive_locker.go
@@ -42,7 +42,7 @@ func (l *ExclusiveLocker) GetToken() (token int64, lockTsNs int64) {
}
func (l *ExclusiveLocker) RequestLock() {
- if l.isLocking {
+ if l.isLocking {
return
}