diff --git a/weed/pb/master.proto b/weed/pb/master.proto index ff47a16d4..2c4dc4a92 100644 --- a/weed/pb/master.proto +++ b/weed/pb/master.proto @@ -165,6 +165,8 @@ message DataNodeInfo { uint64 free_volume_count = 4; uint64 active_volume_count = 5; repeated VolumeInformationMessage volume_infos = 6; + string url = 7; + string public_url = 8; } message RackInfo { string id = 1; @@ -189,6 +191,7 @@ message TopologyInfo { uint64 free_volume_count = 4; uint64 active_volume_count = 5; repeated DataCenterInfo data_center_infos = 6; + uint64 volume_size_limit_bytes = 7; } message VolumeListRequest { } diff --git a/weed/pb/master_pb/master.pb.go b/weed/pb/master_pb/master.pb.go index a586d11b3..4ab414124 100644 --- a/weed/pb/master_pb/master.pb.go +++ b/weed/pb/master_pb/master.pb.go @@ -38,13 +38,13 @@ It has these top-level messages: */ package master_pb -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import "github.com/golang/protobuf/proto" +import "fmt" +import "math" import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" + "golang.org/x/net/context" + "google.golang.org/grpc" ) // Reference imports to suppress errors if they are not otherwise used. @@ -793,6 +793,8 @@ type DataNodeInfo struct { FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"` ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"` VolumeInfos []*VolumeInformationMessage `protobuf:"bytes,6,rep,name=volume_infos,json=volumeInfos" json:"volume_infos,omitempty"` + Url string `protobuf:"bytes,7,opt,name=url" json:"url,omitempty"` + PublicUrl string `protobuf:"bytes,8,opt,name=public_url,json=publicUrl" json:"public_url,omitempty"` } func (m *DataNodeInfo) Reset() { *m = DataNodeInfo{} } @@ -842,6 +844,20 @@ func (m *DataNodeInfo) GetVolumeInfos() []*VolumeInformationMessage { return nil } +func (m *DataNodeInfo) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *DataNodeInfo) GetPublicUrl() string { + if m != nil { + return m.PublicUrl + } + return "" +} + type RackInfo struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"` @@ -955,12 +971,13 @@ func (m *DataCenterInfo) GetRackInfos() []*RackInfo { } type TopologyInfo struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"` - MaxVolumeCount uint64 `protobuf:"varint,3,opt,name=max_volume_count,json=maxVolumeCount" json:"max_volume_count,omitempty"` - FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"` - ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"` - DataCenterInfos []*DataCenterInfo `protobuf:"bytes,6,rep,name=data_center_infos,json=dataCenterInfos" json:"data_center_infos,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"` + MaxVolumeCount uint64 `protobuf:"varint,3,opt,name=max_volume_count,json=maxVolumeCount" json:"max_volume_count,omitempty"` + FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"` + ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"` + DataCenterInfos []*DataCenterInfo `protobuf:"bytes,6,rep,name=data_center_infos,json=dataCenterInfos" json:"data_center_infos,omitempty"` + VolumeSizeLimitBytes uint64 `protobuf:"varint,7,opt,name=volume_size_limit_bytes,json=volumeSizeLimitBytes" json:"volume_size_limit_bytes,omitempty"` } func (m *TopologyInfo) Reset() { *m = TopologyInfo{} } @@ -1010,6 +1027,13 @@ func (m *TopologyInfo) GetDataCenterInfos() []*DataCenterInfo { return nil } +func (m *TopologyInfo) GetVolumeSizeLimitBytes() uint64 { + if m != nil { + return m.VolumeSizeLimitBytes + } + return 0 +} + type VolumeListRequest struct { } diff --git a/weed/server/volume_grpc_copy.go b/weed/server/volume_grpc_copy.go index dbcdb1052..03ab04a62 100644 --- a/weed/server/volume_grpc_copy.go +++ b/weed/server/volume_grpc_copy.go @@ -92,7 +92,7 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo return nil, err } - if err = checkCopyFiles(volFileInfoResp, idxFileName, datFileName); err != nil { // added by panyc16 + if err = checkCopyFiles(volFileInfoResp, idxFileName, datFileName); err != nil { return nil, err }