mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
show volume info in volume.list in weed shell
This commit is contained in:
parent
1becbce657
commit
7ae8b1cc86
|
@ -27,16 +27,18 @@ type VolumeInfo struct {
|
||||||
|
|
||||||
func NewVolumeInfo(m *master_pb.VolumeInformationMessage) (vi VolumeInfo, err error) {
|
func NewVolumeInfo(m *master_pb.VolumeInformationMessage) (vi VolumeInfo, err error) {
|
||||||
vi = VolumeInfo{
|
vi = VolumeInfo{
|
||||||
Id: needle.VolumeId(m.Id),
|
Id: needle.VolumeId(m.Id),
|
||||||
Size: m.Size,
|
Size: m.Size,
|
||||||
Collection: m.Collection,
|
Collection: m.Collection,
|
||||||
FileCount: int(m.FileCount),
|
FileCount: int(m.FileCount),
|
||||||
DeleteCount: int(m.DeleteCount),
|
DeleteCount: int(m.DeleteCount),
|
||||||
DeletedByteCount: m.DeletedByteCount,
|
DeletedByteCount: m.DeletedByteCount,
|
||||||
ReadOnly: m.ReadOnly,
|
ReadOnly: m.ReadOnly,
|
||||||
Version: needle.Version(m.Version),
|
Version: needle.Version(m.Version),
|
||||||
CompactRevision: m.CompactRevision,
|
CompactRevision: m.CompactRevision,
|
||||||
ModifiedAtSecond: m.ModifiedAtSecond,
|
ModifiedAtSecond: m.ModifiedAtSecond,
|
||||||
|
RemoteStorageName: m.RemoteStorageName,
|
||||||
|
RemoteStorageKey: m.RemoteStorageKey,
|
||||||
}
|
}
|
||||||
rp, e := NewReplicaPlacementFromByte(byte(m.ReplicaPlacement))
|
rp, e := NewReplicaPlacementFromByte(byte(m.ReplicaPlacement))
|
||||||
if e != nil {
|
if e != nil {
|
||||||
|
@ -69,18 +71,20 @@ func (vi VolumeInfo) String() string {
|
||||||
|
|
||||||
func (vi VolumeInfo) ToVolumeInformationMessage() *master_pb.VolumeInformationMessage {
|
func (vi VolumeInfo) ToVolumeInformationMessage() *master_pb.VolumeInformationMessage {
|
||||||
return &master_pb.VolumeInformationMessage{
|
return &master_pb.VolumeInformationMessage{
|
||||||
Id: uint32(vi.Id),
|
Id: uint32(vi.Id),
|
||||||
Size: uint64(vi.Size),
|
Size: uint64(vi.Size),
|
||||||
Collection: vi.Collection,
|
Collection: vi.Collection,
|
||||||
FileCount: uint64(vi.FileCount),
|
FileCount: uint64(vi.FileCount),
|
||||||
DeleteCount: uint64(vi.DeleteCount),
|
DeleteCount: uint64(vi.DeleteCount),
|
||||||
DeletedByteCount: vi.DeletedByteCount,
|
DeletedByteCount: vi.DeletedByteCount,
|
||||||
ReadOnly: vi.ReadOnly,
|
ReadOnly: vi.ReadOnly,
|
||||||
ReplicaPlacement: uint32(vi.ReplicaPlacement.Byte()),
|
ReplicaPlacement: uint32(vi.ReplicaPlacement.Byte()),
|
||||||
Version: uint32(vi.Version),
|
Version: uint32(vi.Version),
|
||||||
Ttl: vi.Ttl.ToUint32(),
|
Ttl: vi.Ttl.ToUint32(),
|
||||||
CompactRevision: vi.CompactRevision,
|
CompactRevision: vi.CompactRevision,
|
||||||
ModifiedAtSecond: vi.ModifiedAtSecond,
|
ModifiedAtSecond: vi.ModifiedAtSecond,
|
||||||
|
RemoteStorageName: vi.RemoteStorageName,
|
||||||
|
RemoteStorageKey: vi.RemoteStorageKey,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue