volume server set volume type and heartbeat to the master

This commit is contained in:
Chris Lu
2020-12-13 03:11:24 -08:00
parent e9cd798bd3
commit d156c74ec0
19 changed files with 802 additions and 544 deletions

View File

@@ -14,7 +14,7 @@ type VolumeInfo struct {
Size uint64
ReplicaPlacement *super_block.ReplicaPlacement
Ttl *needle.TTL
VolumeType VolumeType
VolumeType string
Collection string
Version needle.Version
FileCount int
@@ -41,6 +41,7 @@ func NewVolumeInfo(m *master_pb.VolumeInformationMessage) (vi VolumeInfo, err er
ModifiedAtSecond: m.ModifiedAtSecond,
RemoteStorageName: m.RemoteStorageName,
RemoteStorageKey: m.RemoteStorageKey,
VolumeType: m.VolumeType,
}
rp, e := super_block.NewReplicaPlacementFromByte(byte(m.ReplicaPlacement))
if e != nil {
@@ -91,6 +92,7 @@ func (vi VolumeInfo) ToVolumeInformationMessage() *master_pb.VolumeInformationMe
ModifiedAtSecond: vi.ModifiedAtSecond,
RemoteStorageName: vi.RemoteStorageName,
RemoteStorageKey: vi.RemoteStorageKey,
VolumeType: vi.VolumeType,
}
}