SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
go fmt
Chris Lu1bf22c0b5b1e
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.goindex 9a66083f1c..351efd3dc7 100644--- a/weed/command/benchmark.go+++ b/weed/command/benchmark.go@@ -35,7 +35,7 @@ type BenchmarkOptions struct {sequentialRead *boolcollection *stringreplication *string- diskType *string+ diskType *stringcpuprofile *stringmaxCpu *intgrpcDialOption grpc.DialOption@@ -236,7 +236,7 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {Count: 1,Collection: *b.collection,Replication: *b.replication,- DiskType: *b.diskType,+ DiskType: *b.diskType,}if assignResult, err := operation.Assign(b.masterClient.GetMaster(), b.grpcDialOption, ar); err == nil {fp.Server, fp.Fid, fp.Collection = assignResult.Url, assignResult.Fid, *b.collectiondiff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.goindex 1b5f4c8496..9b4c029041 100644--- a/weed/command/filer_copy.go+++ b/weed/command/filer_copy.go@@ -37,7 +37,7 @@ type CopyOptions struct {replication *stringcollection *stringttl *string- diskType *string+ diskType *stringmaxMB *intmasterClient *wdclient.MasterClientconcurrenctFiles *int@@ -313,7 +313,7 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) errReplication: *worker.options.replication,Collection: *worker.options.collection,TtlSec: worker.options.ttlSec,- DiskType: *worker.options.diskType,+ DiskType: *worker.options.diskType,Path: task.destinationUrlPath,}@@ -408,7 +408,7 @@ func (worker *FileCopyWorker) uploadFileInChunks(task FileCopyTask, f *os.File,Replication: *worker.options.replication,Collection: *worker.options.collection,TtlSec: worker.options.ttlSec,- DiskType: *worker.options.diskType,+ DiskType: *worker.options.diskType,Path: task.destinationUrlPath + fileName,}diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.goindex 07a4f8ffbc..050fef7d45 100644--- a/weed/command/filer_sync.go+++ b/weed/command/filer_sync.go@@ -31,8 +31,8 @@ type SyncOptions struct {bCollection *stringaTtlSec *intbTtlSec *int- aDiskType *string- bDiskType *string+ aDiskType *string+ bDiskType *stringaDebug *boolbDebug *bool}diff --git a/weed/command/mount.go b/weed/command/mount.goindex dc0bb54886..e380ff57ca 100644--- a/weed/command/mount.go+++ b/weed/command/mount.go@@ -12,7 +12,7 @@ type MountOptions struct {dirAutoCreate *boolcollection *stringreplication *string- diskType *string+ diskType *stringttlSec *intchunkSizeLimitMB *intconcurrentWriters *intdiff --git a/weed/command/mount_std.go b/weed/command/mount_std.goindex e3bfba9fbe..0798d18af0 100644--- a/weed/command/mount_std.go+++ b/weed/command/mount_std.go@@ -181,7 +181,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {Collection: *option.collection,Replication: *option.replication,TtlSec: int32(*option.ttlSec),- DiskType: diskType,+ DiskType: diskType,ChunkSizeLimit: int64(chunkSizeLimitMB) * 1024 * 1024,ConcurrentWriters: *option.concurrentWriters,CacheDir: *option.cacheDir,diff --git a/weed/command/upload.go b/weed/command/upload.goindex 8ffc0c2b81..592f716103 100644--- a/weed/command/upload.go+++ b/weed/command/upload.go@@ -23,7 +23,7 @@ type UploadOptions struct {collection *stringdataCenter *stringttl *string- diskType *string+ diskType *stringmaxMB *intusePublicUrl *bool}diff --git a/weed/command/volume.go b/weed/command/volume.goindex b90dc5967d..fa7dcaa06b 100644--- a/weed/command/volume.go+++ b/weed/command/volume.go@@ -49,7 +49,7 @@ type VolumeServerOptions struct {rack *stringwhiteList []stringindexType *string- diskType *string+ diskType *stringfixJpgOrientation *boolreadRedirect *boolcpuProfile *stringdiff --git a/weed/filer/abstract_sql/abstract_sql_store_kv.go b/weed/filer/abstract_sql/abstract_sql_store_kv.goindex 81d105134e..792a45ff47 100644--- a/weed/filer/abstract_sql/abstract_sql_store_kv.go+++ b/weed/filer/abstract_sql/abstract_sql_store_kv.go@@ -34,7 +34,7 @@ func (store *AbstractSqlStore) KvPut(ctx context.Context, key []byte, value []by}_, err = res.RowsAffected()- if err != nil {+ if err != nil {return fmt.Errorf("kv upsert no rows affected: %s", err)}return nildiff --git a/weed/filer/entry.go b/weed/filer/entry.goindex 987ea8cca1..b7c8370e68 100644--- a/weed/filer/entry.go+++ b/weed/filer/entry.go@@ -18,7 +18,7 @@ type Attr struct {Replication string // replicationCollection string // collection nameTtlSec int32 // ttl in seconds- DiskType string+ DiskType stringUserName stringGroupNames []stringSymlinkTarget stringdiff --git a/weed/filer/entry_codec.go b/weed/filer/entry_codec.goindex cc73539740..4c613f0680 100644--- a/weed/filer/entry_codec.go+++ b/weed/filer/entry_codec.go@@ -56,7 +56,7 @@ func EntryAttributeToPb(entry *Entry) *filer_pb.FuseAttributes {Collection: entry.Attr.Collection,Replication: entry.Attr.Replication,TtlSec: entry.Attr.TtlSec,- DiskType: entry.Attr.DiskType,+ DiskType: entry.Attr.DiskType,UserName: entry.Attr.UserName,GroupName: entry.Attr.GroupNames,SymlinkTarget: entry.Attr.SymlinkTarget,diff --git a/weed/filer/filer_deletion.go b/weed/filer/filer_deletion.goindex 09af80b428..9eee382779 100644--- a/weed/filer/filer_deletion.go+++ b/weed/filer/filer_deletion.go@@ -151,4 +151,3 @@ func (f *Filer) deleteChunksIfNotNew(oldEntry, newEntry *Entry) {}f.DeleteChunks(toDelete)}-diff --git a/weed/filer/read_write.go b/weed/filer/read_write.goindex 5484731167..1f78057efc 100644--- a/weed/filer/read_write.go+++ b/weed/filer/read_write.go@@ -82,8 +82,8 @@ func SaveInsideFiler(client filer_pb.SeaweedFilerClient, dir, name string, conteif err == filer_pb.ErrNotFound {err = filer_pb.CreateEntry(client, &filer_pb.CreateEntryRequest{- Directory: dir,- Entry: &filer_pb.Entry{+ Directory: dir,+ Entry: &filer_pb.Entry{Name: name,IsDirectory: false,Attributes: &filer_pb.FuseAttributes{@@ -92,7 +92,7 @@ func SaveInsideFiler(client filer_pb.SeaweedFilerClient, dir, name string, conteFileMode: uint32(0644),Collection: "",Replication: "",- FileSize: uint64(len(content)),+ FileSize: uint64(len(content)),},Content: content,},@@ -103,10 +103,10 @@ func SaveInsideFiler(client filer_pb.SeaweedFilerClient, dir, name string, conteentry.Attributes.Mtime = time.Now().Unix()entry.Attributes.FileSize = uint64(len(content))err = filer_pb.UpdateEntry(client, &filer_pb.UpdateEntryRequest{- Directory: dir,- Entry: entry,+ Directory: dir,+ Entry: entry,})}return err-}\ No newline at end of file+}diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.goindex 48893f80a1..d8f865be77 100644--- a/weed/filesys/wfs.go+++ b/weed/filesys/wfs.go@@ -31,7 +31,7 @@ type Option struct {Collection stringReplication stringTtlSec int32- DiskType storage.DiskType+ DiskType storage.DiskTypeChunkSizeLimit int64ConcurrentWriters intCacheDir string@@ -178,7 +178,7 @@ func (wfs *WFS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.Collection: wfs.option.Collection,Replication: wfs.option.Replication,Ttl: fmt.Sprintf("%ds", wfs.option.TtlSec),- DiskType: string(wfs.option.DiskType),+ DiskType: string(wfs.option.DiskType),}glog.V(4).Infof("reading filer stats: %+v", request)diff --git a/weed/filesys/wfs_write.go b/weed/filesys/wfs_write.goindex 903fed810a..92ff5c8daf 100644--- a/weed/filesys/wfs_write.go+++ b/weed/filesys/wfs_write.go@@ -26,7 +26,7 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFunReplication: wfs.option.Replication,Collection: wfs.option.Collection,TtlSec: wfs.option.TtlSec,- DiskType: string(wfs.option.DiskType),+ DiskType: string(wfs.option.DiskType),DataCenter: wfs.option.DataCenter,Path: string(fullPath),}diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.goindex bb0b8e6dff..b2fcf0c969 100644--- a/weed/operation/assign_file_id.go+++ b/weed/operation/assign_file_id.go@@ -18,7 +18,7 @@ type VolumeAssignRequest struct {Replication stringCollection stringTtl string- DiskType string+ DiskType stringDataCenter stringRack stringDataNode string@@ -55,7 +55,7 @@ func Assign(server string, grpcDialOption grpc.DialOption, primaryRequest *VolumReplication: request.Replication,Collection: request.Collection,Ttl: request.Ttl,- DiskType: request.DiskType,+ DiskType: request.DiskType,DataCenter: request.DataCenter,Rack: request.Rack,DataNode: request.DataNode,@@ -107,7 +107,7 @@ func LookupJwt(master string, fileId string) security.EncodedJwt {type StorageOption struct {Replication string- DiskType string+ DiskType stringCollection stringDataCenter stringRack string@@ -126,7 +126,7 @@ func (so *StorageOption) ToAssignRequests(count int) (ar *VolumeAssignRequest, aReplication: so.Replication,Collection: so.Collection,Ttl: so.TtlString(),- DiskType: so.DiskType,+ DiskType: so.DiskType,DataCenter: so.DataCenter,Rack: so.Rack,WritableVolumeCount: so.VolumeGrowthCount,@@ -137,7 +137,7 @@ func (so *StorageOption) ToAssignRequests(count int) (ar *VolumeAssignRequest, aReplication: so.Replication,Collection: so.Collection,Ttl: so.TtlString(),- DiskType: so.DiskType,+ DiskType: so.DiskType,DataCenter: "",Rack: "",WritableVolumeCount: so.VolumeGrowthCount,diff --git a/weed/operation/submit.go b/weed/operation/submit.goindex bcdf9ddce6..9078253114 100644--- a/weed/operation/submit.go+++ b/weed/operation/submit.go@@ -25,7 +25,7 @@ type FilePart struct {Collection stringDataCenter stringTtl string- DiskType string+ DiskType stringServer string //this comes from assign resultFid string //this comes from assign result, but customizableFsync bool@@ -50,7 +50,7 @@ func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePartCollection: collection,DataCenter: dataCenter,Ttl: ttl,- DiskType: diskType,+ DiskType: diskType,}ret, err := Assign(master, grpcDialOption, ar)if err != nil {@@ -146,7 +146,7 @@ func (fi FilePart) Upload(maxMB int, master string, usePublicUrl bool, jwt securReplication: fi.Replication,Collection: fi.Collection,Ttl: fi.Ttl,- DiskType: fi.DiskType,+ DiskType: fi.DiskType,}ret, err = Assign(master, grpcDialOption, ar)if err != nil {@@ -160,7 +160,7 @@ func (fi FilePart) Upload(maxMB int, master string, usePublicUrl bool, jwt securReplication: fi.Replication,Collection: fi.Collection,Ttl: fi.Ttl,- DiskType: fi.DiskType,+ DiskType: fi.DiskType,}ret, err = Assign(master, grpcDialOption, ar)if err != nil {diff --git a/weed/replication/sink/filersink/fetch_write.go b/weed/replication/sink/filersink/fetch_write.goindex bdd2ba5857..6b51a7966e 100644--- a/weed/replication/sink/filersink/fetch_write.go+++ b/weed/replication/sink/filersink/fetch_write.go@@ -77,7 +77,7 @@ func (fs *FilerSink) fetchAndWrite(sourceChunk *filer_pb.FileChunk, path string)Collection: fs.collection,TtlSec: fs.ttlSec,DataCenter: fs.dataCenter,- DiskType: fs.diskType,+ DiskType: fs.diskType,Path: path,}diff --git a/weed/replication/sink/filersink/filer_sink.go b/weed/replication/sink/filersink/filer_sink.goindex 579883d621..a69c9dc8e2 100644--- a/weed/replication/sink/filersink/filer_sink.go+++ b/weed/replication/sink/filersink/filer_sink.go@@ -23,7 +23,7 @@ type FilerSink struct {replication stringcollection stringttlSec int32- diskType string+ diskType stringdataCenter stringgrpcDialOption grpc.DialOption}diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.goindex da0a38dbfd..93544b75ee 100644--- a/weed/s3api/auth_credentials.go+++ b/weed/s3api/auth_credentials.go@@ -79,7 +79,6 @@ func (iam *IdentityAccessManagement) loadS3ApiConfigurationFromBytes(content []breturn nil}-func (iam *IdentityAccessManagement) loadS3ApiConfiguration(config *iam_pb.S3ApiConfiguration) error {var identities []*Identityfor _, ident := range config.Identities {diff --git a/weed/s3api/s3_constants/s3_actions.go b/weed/s3api/s3_constants/s3_actions.goindex f6056ef789..4e484ac980 100644--- a/weed/s3api/s3_constants/s3_actions.go+++ b/weed/s3api/s3_constants/s3_actions.go@@ -7,4 +7,3 @@ const (ACTION_TAGGING = "Tagging"ACTION_LIST = "List")-diff --git a/weed/server/common.go b/weed/server/common.goindex 5457030951..0ce846ed73 100644--- a/weed/server/common.go+++ b/weed/server/common.go@@ -131,7 +131,7 @@ func submitForClientHandler(w http.ResponseWriter, r *http.Request, masterUrl stReplication: r.FormValue("replication"),Collection: r.FormValue("collection"),Ttl: r.FormValue("ttl"),- DiskType: r.FormValue("disk"),+ DiskType: r.FormValue("disk"),}assignResult, ae := operation.Assign(masterUrl, grpcDialOption, ar)if ae != nil {diff --git a/weed/server/filer_grpc_server.go b/weed/server/filer_grpc_server.goindex e8a57261d2..7f3012e964 100644--- a/weed/server/filer_grpc_server.go+++ b/weed/server/filer_grpc_server.go@@ -405,7 +405,7 @@ func (fs *FilerServer) Statistics(ctx context.Context, req *filer_pb.StatisticsRReplication: req.Replication,Collection: req.Collection,Ttl: req.Ttl,- DiskType: req.DiskType,+ DiskType: req.DiskType,})if grpcErr != nil {return grpcErrdiff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.goindex 0cfbeba474..963f1cd117 100644--- a/weed/server/filer_server_handlers_write_autochunk.go+++ b/weed/server/filer_server_handlers_write_autochunk.go@@ -163,7 +163,7 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNaReplication: so.Replication,Collection: so.Collection,TtlSec: so.TtlSeconds,- DiskType: so.DiskType,+ DiskType: so.DiskType,Mime: contentType,Md5: md5bytes,FileSize: uint64(chunkOffset),diff --git a/weed/server/filer_server_handlers_write_cipher.go b/weed/server/filer_server_handlers_write_cipher.goindex f9310bdd28..8334d16182 100644--- a/weed/server/filer_server_handlers_write_cipher.go+++ b/weed/server/filer_server_handlers_write_cipher.go@@ -68,7 +68,7 @@ func (fs *FilerServer) encrypt(ctx context.Context, w http.ResponseWriter, r *htReplication: so.Replication,Collection: so.Collection,TtlSec: so.TtlSeconds,- DiskType: so.DiskType,+ DiskType: so.DiskType,Mime: pu.MimeType,Md5: util.Base64Md5ToBytes(pu.ContentMd5),},diff --git a/weed/server/master_grpc_server_volume.go b/weed/server/master_grpc_server_volume.goindex debb21b94e..f1d65896a0 100644--- a/weed/server/master_grpc_server_volume.go+++ b/weed/server/master_grpc_server_volume.go@@ -70,7 +70,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequestCollection: req.Collection,ReplicaPlacement: replicaPlacement,Ttl: ttl,- DiskType: diskType,+ DiskType: diskType,Prealloacte: ms.preallocateSize,DataCenter: req.DataCenter,Rack: req.Rack,diff --git a/weed/server/master_server_handlers_admin.go b/weed/server/master_server_handlers_admin.goindex 1f340cb111..5b0fe26de4 100644--- a/weed/server/master_server_handlers_admin.go+++ b/weed/server/master_server_handlers_admin.go@@ -174,7 +174,7 @@ func (ms *MasterServer) getVolumeGrowOption(r *http.Request) (*topology.VolumeGrCollection: r.FormValue("collection"),ReplicaPlacement: replicaPlacement,Ttl: ttl,- DiskType: diskType,+ DiskType: diskType,Prealloacte: preallocate,DataCenter: r.FormValue("dataCenter"),Rack: r.FormValue("rack"),diff --git a/weed/server/webdav_server.go b/weed/server/webdav_server.goindex 04b7e0519e..6694086af0 100644--- a/weed/server/webdav_server.go+++ b/weed/server/webdav_server.go@@ -33,7 +33,7 @@ type WebDavOption struct {BucketsPath stringGrpcDialOption grpc.DialOptionCollection string- DiskType string+ DiskType stringUid uint32Gid uint32Cipher bool@@ -379,7 +379,7 @@ func (f *WebDavFile) saveDataAsChunk(reader io.Reader, name string, offset int64Count: 1,Replication: "",Collection: f.fs.option.Collection,- DiskType: f.fs.option.DiskType,+ DiskType: f.fs.option.DiskType,Path: name,}diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.goindex 59303ec550..1539ccb193 100644--- a/weed/shell/command_volume_server_evacuate.go+++ b/weed/shell/command_volume_server_evacuate.go@@ -175,7 +175,7 @@ func moveAwayOneEcVolume(commandEnv *CommandEnv, ecShardInfo *master_pb.VolumeEcfunc moveAwayOneNormalVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][]*VolumeReplica, vol *master_pb.VolumeInformationMessage, thisNode *Node, otherNodes []*Node, applyChange bool) (hasMoved bool, err error) {sort.Slice(otherNodes, func(i, j int) bool {- return otherNodes[i].localVolumeRatio(capacityByMaxVolumeCount) + otherNodes[i].localVolumeRatio(capacityByMaxSsdVolumeCount) < otherNodes[j].localVolumeRatio(capacityByMaxVolumeCount) + otherNodes[j].localVolumeRatio(capacityByMaxSsdVolumeCount)+ return otherNodes[i].localVolumeRatio(capacityByMaxVolumeCount)+otherNodes[i].localVolumeRatio(capacityByMaxSsdVolumeCount) < otherNodes[j].localVolumeRatio(capacityByMaxVolumeCount)+otherNodes[j].localVolumeRatio(capacityByMaxSsdVolumeCount)})for i := 0; i < len(otherNodes); i++ {diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.goindex c6619b2604..271a36ef73 100644--- a/weed/storage/disk_location.go+++ b/weed/storage/disk_location.go@@ -19,7 +19,7 @@ import (type DiskLocation struct {Directory stringIdxDirectory string- DiskType DiskType+ DiskType DiskTypeMaxVolumeCount intOriginalMaxVolumeCount intMinFreeSpacePercent float32@@ -43,7 +43,7 @@ func NewDiskLocation(dir string, maxVolumeCount int, minFreeSpacePercent float32location := &DiskLocation{Directory: dir,IdxDirectory: idxDir,- DiskType: diskType,+ DiskType: diskType,MaxVolumeCount: maxVolumeCount,OriginalMaxVolumeCount: maxVolumeCount,MinFreeSpacePercent: minFreeSpacePercent,@@ -117,7 +117,7 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Neglog.V(0).Infof("new volume %s error %s", volumeName, e)return false}-+l.SetVolume(vid, v)size, _, _ := v.FileStat()@@ -362,4 +362,4 @@ func (l *DiskLocation) GetDiskType() string {return "SSD"}return "HDD"-}\ No newline at end of file+}diff --git a/weed/storage/volume_info.go b/weed/storage/volume_info.goindex e9ecb500af..9c64c96826 100644--- a/weed/storage/volume_info.go+++ b/weed/storage/volume_info.go@@ -14,7 +14,7 @@ type VolumeInfo struct {Size uint64ReplicaPlacement *super_block.ReplicaPlacementTtl *needle.TTL- DiskType string+ DiskType stringCollection stringVersion needle.VersionFileCount int@@ -41,7 +41,7 @@ func NewVolumeInfo(m *master_pb.VolumeInformationMessage) (vi VolumeInfo, err erModifiedAtSecond: m.ModifiedAtSecond,RemoteStorageName: m.RemoteStorageName,RemoteStorageKey: m.RemoteStorageKey,- DiskType: m.DiskType,+ DiskType: m.DiskType,}rp, e := super_block.NewReplicaPlacementFromByte(byte(m.ReplicaPlacement))if e != nil {@@ -93,7 +93,7 @@ func (vi VolumeInfo) ToVolumeInformationMessage() *master_pb.VolumeInformationMeModifiedAtSecond: vi.ModifiedAtSecond,RemoteStorageName: vi.RemoteStorageName,RemoteStorageKey: vi.RemoteStorageKey,- DiskType: vi.DiskType,+ DiskType: vi.DiskType,}}diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.goindex 34eee876d4..a6efc630d2 100644--- a/weed/storage/volume_loading.go+++ b/weed/storage/volume_loading.go@@ -92,7 +92,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKindif err == nil && alsoLoadIndex {// adjust for existing volumes with .idx together with .dat filesif v.dirIdx != v.dir {- if util.FileExists(v.DataFileName()+".idx") {+ if util.FileExists(v.DataFileName() + ".idx") {v.dirIdx = v.dir}}@@ -100,12 +100,12 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKindif v.noWriteOrDelete {glog.V(0).Infoln("open to read file", v.FileName(".idx"))if indexFile, err = os.OpenFile(v.FileName(".idx"), os.O_RDONLY, 0644); err != nil {- return fmt.Errorf("cannot read Volume Index %s: %v", v.FileName(".idx"), err)+ return fmt.Errorf("cannot read Volume Index %s: %v", v.FileName(".idx"), err)}} else {glog.V(1).Infoln("open to write file", v.FileName(".idx"))if indexFile, err = os.OpenFile(v.FileName(".idx"), os.O_RDWR|os.O_CREATE, 0644); err != nil {- return fmt.Errorf("cannot write Volume Index %s: %v", v.FileName(".idx"), err)+ return fmt.Errorf("cannot write Volume Index %s: %v", v.FileName(".idx"), err)}}if v.lastAppendAtNs, err = CheckAndFixVolumeDataIntegrity(v, indexFile); err != nil {@@ -115,7 +115,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKindif v.noWriteOrDelete || v.noWriteCanDelete {if v.nm, err = NewSortedFileNeedleMap(v.IndexFileName(), indexFile); err != nil {- glog.V(0).Infof("loading sorted db %s error: %v", v.FileName(".sdx"), err)+ glog.V(0).Infof("loading sorted db %s error: %v", v.FileName(".sdx"), err)}} else {switch needleMapKind {diff --git a/weed/storage/volume_type.go b/weed/storage/volume_type.goindex 05cd6b2c3d..3e8d5ffb5c 100644--- a/weed/storage/volume_type.go+++ b/weed/storage/volume_type.go@@ -6,7 +6,7 @@ type DiskType stringconst (HardDriveType DiskType = ""- SsdType = "ssd"+ SsdType = "ssd")func ToDiskType(vt string) (diskType DiskType, err error) {diff --git a/weed/topology/topology_test.go b/weed/topology/topology_test.goindex 92dcb9a22e..b7088947c7 100644--- a/weed/topology/topology_test.go+++ b/weed/topology/topology_test.go@@ -60,7 +60,7 @@ func TestHandlingVolumeServerHeartbeat(t *testing.T) {ReplicaPlacement: uint32(0),Version: uint32(needle.CurrentVersion),Ttl: 0,- DiskType: "ssd",+ DiskType: "ssd",}volumeMessages = append(volumeMessages, volumeMessage)}@@ -168,7 +168,7 @@ func TestAddRemoveVolume(t *testing.T) {Id: needle.VolumeId(1),Size: 100,Collection: "xcollection",- DiskType: "ssd",+ DiskType: "ssd",FileCount: 123,DeleteCount: 23,DeletedByteCount: 45,diff --git a/weed/topology/volume_growth.go b/weed/topology/volume_growth.goindex b2f1fe3d55..260013c38f 100644--- a/weed/topology/volume_growth.go+++ b/weed/topology/volume_growth.go@@ -27,7 +27,7 @@ type VolumeGrowOption struct {Collection stringReplicaPlacement *super_block.ReplicaPlacementTtl *needle.TTL- DiskType storage.DiskType+ DiskType storage.DiskTypePrealloacte int64DataCenter stringRack stringdiff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.goindex ba30eca495..3b1feefa41 100644--- a/weed/topology/volume_layout.go+++ b/weed/topology/volume_layout.go@@ -103,7 +103,7 @@ func (v *volumesBinaryState) copyState(list *VolumeLocationList) copyState {type VolumeLayout struct {rp *super_block.ReplicaPlacementttl *needle.TTL- diskType storage.DiskType+ diskType storage.DiskTypevid2location map[needle.VolumeId]*VolumeLocationListwritables []needle.VolumeId // transient array of writable volume idreadonlyVolumes *volumesBinaryState // readonly volumes@@ -123,7 +123,7 @@ func NewVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskTypereturn &VolumeLayout{rp: rp,ttl: ttl,- diskType: diskType,+ diskType: diskType,vid2location: make(map[needle.VolumeId]*VolumeLocationList),writables: *new([]needle.VolumeId),readonlyVolumes: NewVolumesBinaryState(readOnlyState, rp, ExistCopies()),diff --git a/weed/util/config.go b/weed/util/config.goindex 47f4330283..94e621e34f 100644--- a/weed/util/config.go+++ b/weed/util/config.go@@ -19,11 +19,11 @@ type Configuration interface {func LoadConfiguration(configFileName string, required bool) (loaded bool) {// find a filer store- viper.SetConfigName(configFileName) // name of config file (without extension)- viper.AddConfigPath(".") // optionally look for config in the working directory- viper.AddConfigPath("$HOME/.seaweedfs") // call multiple times to add many search paths- viper.AddConfigPath("/usr/local/etc/seaweedfs/") // search path for bsd-style config directory in- viper.AddConfigPath("/etc/seaweedfs/") // path to look for the config file in+ viper.SetConfigName(configFileName) // name of config file (without extension)+ viper.AddConfigPath(".") // optionally look for config in the working directory+ viper.AddConfigPath("$HOME/.seaweedfs") // call multiple times to add many search paths+ viper.AddConfigPath("/usr/local/etc/seaweedfs/") // search path for bsd-style config directory in+ viper.AddConfigPath("/etc/seaweedfs/") // path to look for the config file inglog.V(1).Infof("Reading %s.toml from %s", configFileName, viper.ConfigFileUsed())