aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-04-18 21:43:36 -0700
committerChris Lu <chris.lu@gmail.com>2019-04-18 21:43:36 -0700
commite5506152c0a27d38fa334b2e338d82ee02669ab9 (patch)
tree1f589cbbf7244cbe5dbfe84ca89f5996e4ca9ff3 /weed/storage/volume.go
parent33c92b819a334b5709e6f1cbe304e4b8855c1238 (diff)
downloadseaweedfs-e5506152c0a27d38fa334b2e338d82ee02669ab9.tar.xz
seaweedfs-e5506152c0a27d38fa334b2e338d82ee02669ab9.zip
refactoring
Diffstat (limited to 'weed/storage/volume.go')
-rw-r--r--weed/storage/volume.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index 54769eaca..e33d90d28 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -2,7 +2,10 @@ package storage
import (
"fmt"
+
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
+ "github.com/chrislusf/seaweedfs/weed/storage/needle"
+
"os"
"path"
"strconv"
@@ -13,7 +16,7 @@ import (
)
type Volume struct {
- Id VolumeId
+ Id needle.VolumeId
dir string
Collection string
dataFile *os.File
@@ -31,7 +34,7 @@ type Volume struct {
lastCompactRevision uint16
}
-func NewVolume(dirname string, collection string, id VolumeId, needleMapKind NeedleMapType, replicaPlacement *ReplicaPlacement, ttl *TTL, preallocate int64) (v *Volume, e error) {
+func NewVolume(dirname string, collection string, id needle.VolumeId, needleMapKind NeedleMapType, replicaPlacement *ReplicaPlacement, ttl *needle.TTL, preallocate int64) (v *Volume, e error) {
// if replicaPlacement is nil, the superblock will be loaded from disk
v = &Volume{dir: dirname, Collection: collection, Id: id}
v.SuperBlock = SuperBlock{ReplicaPlacement: replicaPlacement, Ttl: ttl}
@@ -59,7 +62,7 @@ func (v *Volume) DataFile() *os.File {
return v.dataFile
}
-func (v *Volume) Version() Version {
+func (v *Volume) Version() needle.Version {
return v.SuperBlock.Version()
}