Browse Source

volume: sdx generation uses memdb instead of compactMap

fix https://github.com/chrislusf/seaweedfs/issues/1194
fasthttp
Chris Lu 5 years ago
parent
commit
c1288e9eb4
  1. 7
      weed/storage/erasure_coding/ec_encoder.go

7
weed/storage/erasure_coding/ec_encoder.go

@ -5,12 +5,13 @@ import (
"io"
"os"
"github.com/klauspost/reedsolomon"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage/idx"
"github.com/chrislusf/seaweedfs/weed/storage/needle_map"
"github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/klauspost/reedsolomon"
)
const (
@ -280,14 +281,14 @@ func rebuildEcFiles(shardHasData []bool, inputFiles []*os.File, outputFiles []*o
}
func readCompactMap(baseFileName string) (*needle_map.CompactMap, error) {
func readCompactMap(baseFileName string) (*needle_map.MemDb, error) {
indexFile, err := os.OpenFile(baseFileName+".idx", os.O_RDONLY, 0644)
if err != nil {
return nil, fmt.Errorf("cannot read Volume Index %s.idx: %v", baseFileName, err)
}
defer indexFile.Close()
cm := needle_map.NewCompactMap()
cm := needle_map.NewMemDb()
err = idx.WalkIndexFile(indexFile, func(key types.NeedleId, offset types.Offset, size uint32) error {
if !offset.IsZero() && size != types.TombstoneFileSize {
cm.Set(key, offset, size)

Loading…
Cancel
Save