Browse Source

fmt

pull/7396/head
chrislu 2 months ago
parent
commit
97d1638342
  1. 4
      weed/server/volume_grpc_erasure_coding.go
  2. 1
      weed/storage/erasure_coding/ec_context.go
  3. 2
      weed/storage/erasure_coding/ec_volume.go

4
weed/server/volume_grpc_erasure_coding.go

@ -88,11 +88,11 @@ func (vs *VolumeServer) VolumeEcShardsGenerate(ctx context.Context, req *volume_
datSize, _, _ := v.FileStat() datSize, _, _ := v.FileStat()
volumeInfo.DatFileSize = int64(datSize) volumeInfo.DatFileSize = int64(datSize)
// Save EC configuration to VolumeInfo // Save EC configuration to VolumeInfo
volumeInfo.DataShardsCount = uint32(ecCtx.DataShards) volumeInfo.DataShardsCount = uint32(ecCtx.DataShards)
volumeInfo.ParityShardsCount = uint32(ecCtx.ParityShards) volumeInfo.ParityShardsCount = uint32(ecCtx.ParityShards)
if err := volume_info.SaveVolumeInfo(baseFileName+".vif", volumeInfo); err != nil { if err := volume_info.SaveVolumeInfo(baseFileName+".vif", volumeInfo); err != nil {
return nil, fmt.Errorf("SaveVolumeInfo %s: %v", baseFileName, err) return nil, fmt.Errorf("SaveVolumeInfo %s: %v", baseFileName, err)
} }

1
weed/storage/erasure_coding/ec_context.go

@ -41,4 +41,3 @@ func (ctx *ECContext) ToExt(shardIndex int) string {
func (ctx *ECContext) String() string { func (ctx *ECContext) String() string {
return fmt.Sprintf("%d+%d (total: %d)", ctx.DataShards, ctx.ParityShards, ctx.TotalShards) return fmt.Sprintf("%d+%d (total: %d)", ctx.DataShards, ctx.ParityShards, ctx.TotalShards)
} }

2
weed/storage/erasure_coding/ec_volume.go

@ -41,7 +41,7 @@ type EcVolume struct {
ecjFileAccessLock sync.Mutex ecjFileAccessLock sync.Mutex
diskType types.DiskType diskType types.DiskType
datFileSize int64 datFileSize int64
ExpireAtSec uint64 //ec volume destroy time, calculated from the ec volume was created
ExpireAtSec uint64 //ec volume destroy time, calculated from the ec volume was created
ECContext *ECContext // EC encoding parameters ECContext *ECContext // EC encoding parameters
} }

Loading…
Cancel
Save