aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/storage/volume.go')
-rw-r--r--weed/storage/volume.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index a2e34bd04..efe0328cd 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -3,10 +3,10 @@ package storage
import (
"fmt"
- "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
- "github.com/chrislusf/seaweedfs/weed/stats"
- "github.com/chrislusf/seaweedfs/weed/storage/needle"
- "github.com/chrislusf/seaweedfs/weed/storage/types"
+ "github.com/joeslay/seaweedfs/weed/pb/master_pb"
+ "github.com/joeslay/seaweedfs/weed/stats"
+ "github.com/joeslay/seaweedfs/weed/storage/needle"
+ "github.com/joeslay/seaweedfs/weed/storage/types"
"os"
"path"
@@ -14,7 +14,7 @@ import (
"sync"
"time"
- "github.com/chrislusf/seaweedfs/weed/glog"
+ "github.com/joeslay/seaweedfs/weed/glog"
)
type Volume struct {
@@ -25,6 +25,7 @@ type Volume struct {
nm NeedleMapper
needleMapKind NeedleMapType
readOnly bool
+ MemoryMapped bool
SuperBlock
@@ -38,9 +39,9 @@ type Volume struct {
isCompacting bool
}
-func NewVolume(dirname string, collection string, id needle.VolumeId, needleMapKind NeedleMapType, replicaPlacement *ReplicaPlacement, ttl *needle.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, memoryMapped bool) (v *Volume, e error) {
// if replicaPlacement is nil, the superblock will be loaded from disk
- v = &Volume{dir: dirname, Collection: collection, Id: id}
+ v = &Volume{dir: dirname, Collection: collection, Id: id, MemoryMapped: memoryMapped}
v.SuperBlock = SuperBlock{ReplicaPlacement: replicaPlacement, Ttl: ttl}
v.needleMapKind = needleMapKind
e = v.load(true, true, needleMapKind, preallocate)