display remote volumes on volume server ui page
This commit is contained in:
@@ -144,6 +144,7 @@ func (s *Store) VolumeInfos() []*VolumeInfo {
|
||||
Ttl: v.Ttl,
|
||||
CompactRevision: uint32(v.CompactionRevision),
|
||||
}
|
||||
s.RemoteStorageName, s.RemoteStorageKey = v.RemoteStorageNameKey()
|
||||
stats = append(stats, s)
|
||||
}
|
||||
location.volumesLock.RUnlock()
|
||||
|
||||
@@ -203,7 +203,7 @@ func (v *Volume) expiredLongEnough(maxDelayMinutes uint32) bool {
|
||||
func (v *Volume) ToVolumeInformationMessage() *master_pb.VolumeInformationMessage {
|
||||
size, _, modTime := v.FileStat()
|
||||
|
||||
return &master_pb.VolumeInformationMessage{
|
||||
volumInfo := &master_pb.VolumeInformationMessage{
|
||||
Id: uint32(v.Id),
|
||||
Size: size,
|
||||
Collection: v.Collection,
|
||||
@@ -217,4 +217,15 @@ func (v *Volume) ToVolumeInformationMessage() *master_pb.VolumeInformationMessag
|
||||
CompactRevision: uint32(v.SuperBlock.CompactionRevision),
|
||||
ModifiedAtSecond: modTime.Unix(),
|
||||
}
|
||||
|
||||
volumInfo.RemoteStorageName, volumInfo.RemoteStorageKey = v.RemoteStorageNameKey()
|
||||
|
||||
return volumInfo
|
||||
}
|
||||
|
||||
func (v *Volume) RemoteStorageNameKey() (storageName, storageKey string) {
|
||||
if len(v.volumeTierInfo.GetFiles()) == 0 {
|
||||
return
|
||||
}
|
||||
return v.volumeTierInfo.GetFiles()[0].BackendName(), v.volumeTierInfo.GetFiles()[0].GetKey()
|
||||
}
|
||||
|
||||
@@ -9,18 +9,20 @@ import (
|
||||
)
|
||||
|
||||
type VolumeInfo struct {
|
||||
Id needle.VolumeId
|
||||
Size uint64
|
||||
ReplicaPlacement *ReplicaPlacement
|
||||
Ttl *needle.TTL
|
||||
Collection string
|
||||
Version needle.Version
|
||||
FileCount int
|
||||
DeleteCount int
|
||||
DeletedByteCount uint64
|
||||
ReadOnly bool
|
||||
CompactRevision uint32
|
||||
ModifiedAtSecond int64
|
||||
Id needle.VolumeId
|
||||
Size uint64
|
||||
ReplicaPlacement *ReplicaPlacement
|
||||
Ttl *needle.TTL
|
||||
Collection string
|
||||
Version needle.Version
|
||||
FileCount int
|
||||
DeleteCount int
|
||||
DeletedByteCount uint64
|
||||
ReadOnly bool
|
||||
CompactRevision uint32
|
||||
ModifiedAtSecond int64
|
||||
RemoteStorageName string
|
||||
RemoteStorageKey string
|
||||
}
|
||||
|
||||
func NewVolumeInfo(m *master_pb.VolumeInformationMessage) (vi VolumeInfo, err error) {
|
||||
|
||||
Reference in New Issue
Block a user