caching ec shard locations

This commit is contained in:
Chris Lu
2019-05-27 22:54:58 -07:00
parent 3a8c1055a2
commit 713596e781
8 changed files with 45 additions and 22 deletions

View File

@@ -5,6 +5,8 @@ import (
"math"
"os"
"sort"
"sync"
"time"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/idx"
@@ -13,12 +15,15 @@ import (
)
type EcVolume struct {
Shards []*EcVolumeShard
VolumeId needle.VolumeId
Collection string
dir string
ecxFile *os.File
ecxFileSize int64
VolumeId needle.VolumeId
Collection string
dir string
ecxFile *os.File
ecxFileSize int64
Shards []*EcVolumeShard
ShardLocations map[ShardId][]string
ShardLocationsRefreshTime time.Time
ShardLocationsLock sync.RWMutex
}
func NewEcVolume(dir string, collection string, vid needle.VolumeId) (ev *EcVolume, err error) {