diff --git a/weed/command/master.go b/weed/command/master.go index 21c759f4e..7cbd66f5c 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -26,13 +26,13 @@ var ( ) type MasterOptions struct { - port *int - ip *string - ipBind *string - metaFolder *string - peers *string - volumeSizeLimitMB *uint - volumePreallocate *bool + port *int + ip *string + ipBind *string + metaFolder *string + peers *string + volumeSizeLimitMB *uint + volumePreallocate *bool // pulseSeconds *int defaultReplication *string garbageThreshold *float64 @@ -173,11 +173,11 @@ func checkPeers(masterIp string, masterPort int, peers string) (masterAddress st func (m *MasterOptions) toMasterOption(whiteList []string) *weed_server.MasterOption { return &weed_server.MasterOption{ - Host: *m.ip, - Port: *m.port, - MetaFolder: *m.metaFolder, - VolumeSizeLimitMB: *m.volumeSizeLimitMB, - VolumePreallocate: *m.volumePreallocate, + Host: *m.ip, + Port: *m.port, + MetaFolder: *m.metaFolder, + VolumeSizeLimitMB: *m.volumeSizeLimitMB, + VolumePreallocate: *m.volumePreallocate, // PulseSeconds: *m.pulseSeconds, DefaultReplicaPlacement: *m.defaultReplication, GarbageThreshold: *m.garbageThreshold, diff --git a/weed/filer2/meta_aggregator.go b/weed/filer2/meta_aggregator.go index 8ce0d2dab..00fcf27d1 100644 --- a/weed/filer2/meta_aggregator.go +++ b/weed/filer2/meta_aggregator.go @@ -98,7 +98,7 @@ func (ma *MetaAggregator) subscribeToOneFiler(f *Filer, self string, filer strin for { err := pb.WithFilerClient(filer, ma.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error { stream, err := client.SubscribeLocalMetadata(context.Background(), &filer_pb.SubscribeMetadataRequest{ - ClientName: "filer:"+self, + ClientName: "filer:" + self, PathPrefix: "/", SinceNs: lastTsNs, }) diff --git a/weed/filesys/meta_cache/meta_cache.go b/weed/filesys/meta_cache/meta_cache.go index 3b04040a5..fdb486ba4 100644 --- a/weed/filesys/meta_cache/meta_cache.go +++ b/weed/filesys/meta_cache/meta_cache.go @@ -60,7 +60,7 @@ func (mc *MetaCache) AtomicUpdateEntry(ctx context.Context, oldPath util.FullPat return err } } - }else{ + } else { // println("unknown old directory:", oldDir) } diff --git a/weed/filesys/unimplemented.go b/weed/filesys/unimplemented.go index 1f4fe554d..5c2dcf0e1 100644 --- a/weed/filesys/unimplemented.go +++ b/weed/filesys/unimplemented.go @@ -10,11 +10,13 @@ import ( // https://github.com/bazil/fuse/issues/130 var _ = fs.NodeAccesser(&Dir{}) + func (dir *Dir) Access(ctx context.Context, req *fuse.AccessRequest) error { return fuse.ENOSYS } var _ = fs.NodeAccesser(&File{}) + func (file *File) Access(ctx context.Context, req *fuse.AccessRequest) error { return fuse.ENOSYS } diff --git a/weed/operation/needle_parse_test.go b/weed/operation/needle_parse_test.go index 9caf1b1eb..74d58d1b5 100644 --- a/weed/operation/needle_parse_test.go +++ b/weed/operation/needle_parse_test.go @@ -101,7 +101,6 @@ func TestCreateNeedleFromRequest(t *testing.T) { } - var textContent = `Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -127,4 +126,4 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -` \ No newline at end of file +` diff --git a/weed/server/master_server.go b/weed/server/master_server.go index 9a490bb1f..377fac26f 100644 --- a/weed/server/master_server.go +++ b/weed/server/master_server.go @@ -32,11 +32,11 @@ const ( ) type MasterOption struct { - Host string - Port int - MetaFolder string - VolumeSizeLimitMB uint - VolumePreallocate bool + Host string + Port int + MetaFolder string + VolumeSizeLimitMB uint + VolumePreallocate bool // PulseSeconds int DefaultReplicaPlacement string GarbageThreshold float64 @@ -66,7 +66,7 @@ type MasterServer struct { MasterClient *wdclient.MasterClient - adminLocks *AdminLocks + adminLocks *AdminLocks } func NewMasterServer(r *mux.Router, option *MasterOption, peers []string) *MasterServer { diff --git a/weed/storage/erasure_coding/ec_decoder.go b/weed/storage/erasure_coding/ec_decoder.go index 7b42d02e7..99bcb6ca5 100644 --- a/weed/storage/erasure_coding/ec_decoder.go +++ b/weed/storage/erasure_coding/ec_decoder.go @@ -119,7 +119,7 @@ func iterateEcxFile(baseFileName string, processNeedleFn func(key types.NeedleId } func iterateEcjFile(baseFileName string, processNeedleFn func(key types.NeedleId) error) error { - if !util.FileExists(baseFileName+".ecj") { + if !util.FileExists(baseFileName + ".ecj") { return nil } ecjFile, openErr := os.OpenFile(baseFileName+".ecj", os.O_RDONLY, 0644) diff --git a/weed/storage/erasure_coding/ec_volume_test.go b/weed/storage/erasure_coding/ec_volume_test.go index 66be2b997..9a3b1e644 100644 --- a/weed/storage/erasure_coding/ec_volume_test.go +++ b/weed/storage/erasure_coding/ec_volume_test.go @@ -24,8 +24,8 @@ func TestPositioning(t *testing.T) { tests := []struct { needleId string - offset int64 - size int + offset int64 + size int }{ {needleId: "0f0edb92", offset: 31300679656, size: 1167}, {needleId: "0ef7d7f8", offset: 11513014944, size: 66044}, diff --git a/weed/util/bounded_tree/bounded_tree_test.go b/weed/util/bounded_tree/bounded_tree_test.go index 2328f0497..0b9c3177a 100644 --- a/weed/util/bounded_tree/bounded_tree_test.go +++ b/weed/util/bounded_tree/bounded_tree_test.go @@ -9,9 +9,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/util" ) - var ( - visitFn = func(path util.FullPath) (childDirectories []string, err error) { fmt.Printf(" visit %v ...\n", path) switch path { @@ -37,14 +35,11 @@ var ( return nil, nil } - printMap = func(m map[string]*Node) { for k := range m { println(" >", k) } } - - ) func TestBoundedTree(t *testing.T) { diff --git a/weed/util/compression.go b/weed/util/compression.go index b526f47c9..4488e019e 100644 --- a/weed/util/compression.go +++ b/weed/util/compression.go @@ -54,6 +54,7 @@ func ungzipData(input []byte) ([]byte, error) { } var decoder, _ = zstd.NewReader(nil) + func unzstdData(input []byte) ([]byte, error) { return decoder.DecodeAll(input, nil) }