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 { type VacuumVolumeCompactRequest struct {
VolumeId uint32 `protobuf:"varint,1,opt,name=volume_id,json=volumeId" json:"volume_id,omitempty"` 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"` 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{} } func (m *VacuumVolumeCompactRequest) Reset() { *m = VacuumVolumeCompactRequest{} }
@ -236,13 +235,6 @@ func (m *VacuumVolumeCompactRequest) GetPreallocate() int64 {
return 0 return 0
} }
func (m *VacuumVolumeCompactRequest) GetInMemory() bool {
if m != nil {
return m.InMemory
}
return false
}
type VacuumVolumeCompactResponse struct { type VacuumVolumeCompactResponse struct {
} }

View file

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

View file

@ -59,7 +59,7 @@ func NewStore(grpcDialOption grpc.DialOption, port int, ip, publicUrl string, di
return 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) rt, e := NewReplicaPlacementFromString(replicaPlacement)
if e != nil { if e != nil {
return e return e
@ -68,7 +68,7 @@ func (s *Store) AddVolume(volumeId needle.VolumeId, collection string, needleMap
if e != nil { if e != nil {
return e 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 return e
} }
func (s *Store) DeleteCollection(collection string) (e error) { 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(), Replication: option.ReplicaPlacement.String(),
Ttl: option.Ttl.String(), Ttl: option.Ttl.String(),
Preallocate: option.Prealloacte, Preallocate: option.Prealloacte,
InMemory: option.InMemory,
}) })
return deleteErr return deleteErr
}) })

View file

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