diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-22 02:34:08 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-22 02:34:08 -0800 |
| commit | 4f31c1bb9496bddd55dc4586769d1834599c975e (patch) | |
| tree | c4e0f286db2582c310f3ae4e429df233519f47da /weed/storage | |
| parent | 6c4f32d1735d247fbf598663f8fe6ecc286dc099 (diff) | |
| download | seaweedfs-4f31c1bb9496bddd55dc4586769d1834599c975e.tar.xz seaweedfs-4f31c1bb9496bddd55dc4586769d1834599c975e.zip | |
go fmt
Diffstat (limited to 'weed/storage')
| -rw-r--r-- | weed/storage/volume.go | 2 | ||||
| -rw-r--r-- | weed/storage/volume_loading.go | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go index 7712c5eda..80a74c3e3 100644 --- a/weed/storage/volume.go +++ b/weed/storage/volume.go @@ -47,7 +47,7 @@ type Volume struct { volumeInfo *volume_server_pb.VolumeInfo location *DiskLocation - lastIoError error + lastIoError error } func NewVolume(dirname string, dirIdx string, collection string, id needle.VolumeId, needleMapKind NeedleMapType, replicaPlacement *super_block.ReplicaPlacement, ttl *needle.TTL, preallocate int64, memoryMapMaxSizeMb uint32) (v *Volume, e error) { diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go index 34eee876d..a6efc630d 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, needleMapKind if err == nil && alsoLoadIndex { // adjust for existing volumes with .idx together with .dat files if 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, needleMapKind if 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, needleMapKind if 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 { |
