Add InMemory to Volume Grow structure

This commit is contained in:
j.laycock 2019-09-03 18:19:02 +01:00
parent 1f01eb78e8
commit cbd0a98fa1
5 changed files with 5 additions and 11 deletions

View file

@ -214,7 +214,6 @@ func (m *VacuumVolumeCheckResponse) GetGarbageRatio() float64 {
type VacuumVolumeCompactRequest struct {
VolumeId uint32 `protobuf:"varint,1,opt,name=volume_id,json=volumeId" json:"volume_id,omitempty"`
Preallocate int64 `protobuf:"varint,2,opt,name=preallocate" json:"preallocate,omitempty"`
InMemory bool `protobuf:"varint,2,opt,name=inmemory" json:"inmemory,omitempty"`
}
func (m *VacuumVolumeCompactRequest) Reset() { *m = VacuumVolumeCompactRequest{} }
@ -236,13 +235,6 @@ func (m *VacuumVolumeCompactRequest) GetPreallocate() int64 {
return 0
}
func (m *VacuumVolumeCompactRequest) GetInMemory() bool {
if m != nil {
return m.InMemory
}
return false
}
type VacuumVolumeCompactResponse struct {
}

View file

@ -35,7 +35,7 @@ func (vs *VolumeServer) AllocateVolume(ctx context.Context, req *volume_server_p
req.Replication,
req.Ttl,
req.Preallocate,
req.GetInMemory(),
req.InMemory,
)
if err != nil {

View file

@ -59,7 +59,7 @@ func NewStore(grpcDialOption grpc.DialOption, port int, ip, publicUrl string, di
return
}
func (s *Store) AddVolume(volumeId needle.VolumeId, collection string, needleMapKind NeedleMapType, replicaPlacement string, ttlString string, preallocate int64, in_memory bool) error {
func (s *Store) AddVolume(volumeId needle.VolumeId, collection string, needleMapKind NeedleMapType, replicaPlacement string, ttlString string, preallocate int64, memoryMapped bool) error {
rt, e := NewReplicaPlacementFromString(replicaPlacement)
if e != nil {
return e
@ -68,7 +68,7 @@ func (s *Store) AddVolume(volumeId needle.VolumeId, collection string, needleMap
if e != nil {
return e
}
e = s.addVolume(volumeId, collection, needleMapKind, rt, ttl, preallocate, in_memory)
e = s.addVolume(volumeId, collection, needleMapKind, rt, ttl, preallocate, memoryMapped)
return e
}
func (s *Store) DeleteCollection(collection string) (e error) {

View file

@ -23,6 +23,7 @@ func AllocateVolume(dn *DataNode, grpcDialOption grpc.DialOption, vid needle.Vol
Replication: option.ReplicaPlacement.String(),
Ttl: option.Ttl.String(),
Preallocate: option.Prealloacte,
InMemory: option.InMemory,
})
return deleteErr
})

View file

@ -28,6 +28,7 @@ type VolumeGrowOption struct {
DataCenter string
Rack string
DataNode string
InMemory bool
}
type VolumeGrowth struct {