aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-12-23 12:48:20 -0800
committerChris Lu <chris.lu@gmail.com>2019-12-23 12:48:20 -0800
commit09ca936c78c1044412f47dc06caff1bf08273e60 (patch)
treec8402cc969ca53b841bfdcb6ae23d3955a20e5ec /weed/storage/volume.go
parentdda5c6d3cb32550777f1baf5bd00794e10e56d84 (diff)
downloadseaweedfs-09ca936c78c1044412f47dc06caff1bf08273e60.tar.xz
seaweedfs-09ca936c78c1044412f47dc06caff1bf08273e60.zip
shell: add ec.decode command
Diffstat (limited to 'weed/storage/volume.go')
-rw-r--r--weed/storage/volume.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index c92822e5c..eaeed4e77 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -12,6 +12,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/storage/backend"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
+ "github.com/chrislusf/seaweedfs/weed/storage/super_block"
"github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/glog"
@@ -28,7 +29,7 @@ type Volume struct {
noWriteCanDelete bool // if readonly, either noWriteOrDelete or noWriteCanDelete
MemoryMapMaxSizeMb uint32
- SuperBlock
+ super_block.SuperBlock
dataFileAccessLock sync.RWMutex
lastModifiedTsSeconds uint64 //unix time in seconds
@@ -42,10 +43,10 @@ type Volume struct {
volumeTierInfo *volume_server_pb.VolumeTierInfo
}
-func NewVolume(dirname string, collection string, id needle.VolumeId, needleMapKind NeedleMapType, replicaPlacement *ReplicaPlacement, ttl *needle.TTL, preallocate int64, memoryMapMaxSizeMb uint32) (v *Volume, e error) {
+func NewVolume(dirname string, collection string, id needle.VolumeId, needleMapKind NeedleMapType, replicaPlacement *super_block.ReplicaPlacement, ttl *needle.TTL, preallocate int64, memoryMapMaxSizeMb uint32) (v *Volume, e error) {
// if replicaPlacement is nil, the superblock will be loaded from disk
v = &Volume{dir: dirname, Collection: collection, Id: id, MemoryMapMaxSizeMb: memoryMapMaxSizeMb}
- v.SuperBlock = SuperBlock{ReplicaPlacement: replicaPlacement, Ttl: ttl}
+ v.SuperBlock = super_block.SuperBlock{ReplicaPlacement: replicaPlacement, Ttl: ttl}
v.needleMapKind = needleMapKind
e = v.load(true, true, needleMapKind, preallocate)
return
@@ -68,7 +69,7 @@ func (v *Volume) FileName() (fileName string) {
}
func (v *Volume) Version() needle.Version {
- return v.SuperBlock.Version()
+ return v.SuperBlock.Version
}
func (v *Volume) FileStat() (datSize uint64, idxSize uint64, modTime time.Time) {