Browse Source
upgrade proto2 to proto3
upgrade proto2 to proto3
master add a new interface `/dir/join2` to process new join message, it use a `JoinKey` sync the settings betweed master and volumepull/279/head
17 changed files with 521 additions and 454 deletions
-
5Makefile
-
7go/operation/data_struts.go
-
278go/operation/system_message.pb.go
-
45go/proto/system_message.proto
-
110go/storage/store.go
-
22go/storage/volume_info.go
-
3go/topology/store_replicate.go
-
73go/topology/topology.go
-
29go/util/http_util.go
-
65go/weed/weed_server/common.go
-
1go/weed/weed_server/master_server.go
-
52go/weed/weed_server/master_server_handlers_admin.go
-
2go/weed/weed_server/volume_server_handlers_admin.go
-
2go/weedpb/Makefile
-
180go/weedpb/system_message.pb.go
-
61go/weedpb/system_message.proto
-
40go/weedpb/system_message_test.go
@ -1,7 +0,0 @@ |
|||||
package operation |
|
||||
|
|
||||
type JoinResult struct { |
|
||||
VolumeSizeLimit uint64 `json:"VolumeSizeLimit,omitempty"` |
|
||||
SecretKey string `json:"secretKey,omitempty"` |
|
||||
Error string `json:"error,omitempty"` |
|
||||
} |
|
||||
@ -1,278 +0,0 @@ |
|||||
// Code generated by protoc-gen-go.
|
|
||||
// source: system_message.proto
|
|
||||
// DO NOT EDIT!
|
|
||||
|
|
||||
/* |
|
||||
Package operation is a generated protocol buffer package. |
|
||||
|
|
||||
It is generated from these files: |
|
||||
system_message.proto |
|
||||
|
|
||||
It has these top-level messages: |
|
||||
VolumeInformationMessage |
|
||||
JoinMessage |
|
||||
CollectionSetting |
|
||||
GlobalSetting |
|
||||
JoinResponse |
|
||||
*/ |
|
||||
package operation |
|
||||
|
|
||||
import proto "github.com/golang/protobuf/proto" |
|
||||
import math "math" |
|
||||
|
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
|
||||
var _ = proto.Marshal |
|
||||
var _ = math.Inf |
|
||||
|
|
||||
type VolumeInformationMessage struct { |
|
||||
Id *uint32 `protobuf:"varint,1,req,name=id" json:"id,omitempty"` |
|
||||
Size *uint64 `protobuf:"varint,2,req,name=size" json:"size,omitempty"` |
|
||||
Collection *string `protobuf:"bytes,3,opt,name=collection" json:"collection,omitempty"` |
|
||||
FileCount *uint64 `protobuf:"varint,4,req,name=file_count" json:"file_count,omitempty"` |
|
||||
DeleteCount *uint64 `protobuf:"varint,5,req,name=delete_count" json:"delete_count,omitempty"` |
|
||||
DeletedByteCount *uint64 `protobuf:"varint,6,req,name=deleted_byte_count" json:"deleted_byte_count,omitempty"` |
|
||||
ReadOnly *bool `protobuf:"varint,7,opt,name=read_only" json:"read_only,omitempty"` |
|
||||
ReplicaPlacement *uint32 `protobuf:"varint,8,opt,name=replica_placement" json:"replica_placement,omitempty"` |
|
||||
Version *uint32 `protobuf:"varint,9,opt,name=version,def=2" json:"version,omitempty"` |
|
||||
Ttl *uint32 `protobuf:"varint,10,opt,name=ttl" json:"ttl,omitempty"` |
|
||||
XXX_unrecognized []byte `json:"-"` |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) Reset() { *m = VolumeInformationMessage{} } |
|
||||
func (m *VolumeInformationMessage) String() string { return proto.CompactTextString(m) } |
|
||||
func (*VolumeInformationMessage) ProtoMessage() {} |
|
||||
|
|
||||
const Default_VolumeInformationMessage_Version uint32 = 2 |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetId() uint32 { |
|
||||
if m != nil && m.Id != nil { |
|
||||
return *m.Id |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetSize() uint64 { |
|
||||
if m != nil && m.Size != nil { |
|
||||
return *m.Size |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetCollection() string { |
|
||||
if m != nil && m.Collection != nil { |
|
||||
return *m.Collection |
|
||||
} |
|
||||
return "" |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetFileCount() uint64 { |
|
||||
if m != nil && m.FileCount != nil { |
|
||||
return *m.FileCount |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetDeleteCount() uint64 { |
|
||||
if m != nil && m.DeleteCount != nil { |
|
||||
return *m.DeleteCount |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetDeletedByteCount() uint64 { |
|
||||
if m != nil && m.DeletedByteCount != nil { |
|
||||
return *m.DeletedByteCount |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetReadOnly() bool { |
|
||||
if m != nil && m.ReadOnly != nil { |
|
||||
return *m.ReadOnly |
|
||||
} |
|
||||
return false |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetReplicaPlacement() uint32 { |
|
||||
if m != nil && m.ReplicaPlacement != nil { |
|
||||
return *m.ReplicaPlacement |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetVersion() uint32 { |
|
||||
if m != nil && m.Version != nil { |
|
||||
return *m.Version |
|
||||
} |
|
||||
return Default_VolumeInformationMessage_Version |
|
||||
} |
|
||||
|
|
||||
func (m *VolumeInformationMessage) GetTtl() uint32 { |
|
||||
if m != nil && m.Ttl != nil { |
|
||||
return *m.Ttl |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
type JoinMessage struct { |
|
||||
IsInit *bool `protobuf:"varint,1,opt,name=is_init" json:"is_init,omitempty"` |
|
||||
Ip *string `protobuf:"bytes,2,req,name=ip" json:"ip,omitempty"` |
|
||||
Port *uint32 `protobuf:"varint,3,req,name=port" json:"port,omitempty"` |
|
||||
PublicUrl *string `protobuf:"bytes,4,opt,name=public_url" json:"public_url,omitempty"` |
|
||||
MaxVolumeCount *uint32 `protobuf:"varint,5,req,name=max_volume_count" json:"max_volume_count,omitempty"` |
|
||||
MaxFileKey *uint64 `protobuf:"varint,6,req,name=max_file_key" json:"max_file_key,omitempty"` |
|
||||
DataCenter *string `protobuf:"bytes,7,opt,name=data_center" json:"data_center,omitempty"` |
|
||||
Rack *string `protobuf:"bytes,8,opt,name=rack" json:"rack,omitempty"` |
|
||||
Volumes []*VolumeInformationMessage `protobuf:"bytes,9,rep,name=volumes" json:"volumes,omitempty"` |
|
||||
AdminPort *uint32 `protobuf:"varint,10,opt,name=admin_port" json:"admin_port,omitempty"` |
|
||||
XXX_unrecognized []byte `json:"-"` |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) Reset() { *m = JoinMessage{} } |
|
||||
func (m *JoinMessage) String() string { return proto.CompactTextString(m) } |
|
||||
func (*JoinMessage) ProtoMessage() {} |
|
||||
|
|
||||
func (m *JoinMessage) GetIsInit() bool { |
|
||||
if m != nil && m.IsInit != nil { |
|
||||
return *m.IsInit |
|
||||
} |
|
||||
return false |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetIp() string { |
|
||||
if m != nil && m.Ip != nil { |
|
||||
return *m.Ip |
|
||||
} |
|
||||
return "" |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetPort() uint32 { |
|
||||
if m != nil && m.Port != nil { |
|
||||
return *m.Port |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetPublicUrl() string { |
|
||||
if m != nil && m.PublicUrl != nil { |
|
||||
return *m.PublicUrl |
|
||||
} |
|
||||
return "" |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetMaxVolumeCount() uint32 { |
|
||||
if m != nil && m.MaxVolumeCount != nil { |
|
||||
return *m.MaxVolumeCount |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetMaxFileKey() uint64 { |
|
||||
if m != nil && m.MaxFileKey != nil { |
|
||||
return *m.MaxFileKey |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetDataCenter() string { |
|
||||
if m != nil && m.DataCenter != nil { |
|
||||
return *m.DataCenter |
|
||||
} |
|
||||
return "" |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetRack() string { |
|
||||
if m != nil && m.Rack != nil { |
|
||||
return *m.Rack |
|
||||
} |
|
||||
return "" |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetVolumes() []*VolumeInformationMessage { |
|
||||
if m != nil { |
|
||||
return m.Volumes |
|
||||
} |
|
||||
return nil |
|
||||
} |
|
||||
|
|
||||
func (m *JoinMessage) GetAdminPort() uint32 { |
|
||||
if m != nil && m.AdminPort != nil { |
|
||||
return *m.AdminPort |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
type CollectionSetting struct { |
|
||||
Collection *string `protobuf:"bytes,1,opt,name=collection" json:"collection,omitempty"` |
|
||||
ReplicaPlacement *string `protobuf:"bytes,2,opt,name=replica_placement" json:"replica_placement,omitempty"` |
|
||||
VacuumGarbageThreshold *float32 `protobuf:"fixed32,3,opt,name=vacuum_garbage_threshold" json:"vacuum_garbage_threshold,omitempty"` |
|
||||
XXX_unrecognized []byte `json:"-"` |
|
||||
} |
|
||||
|
|
||||
func (m *CollectionSetting) Reset() { *m = CollectionSetting{} } |
|
||||
func (m *CollectionSetting) String() string { return proto.CompactTextString(m) } |
|
||||
func (*CollectionSetting) ProtoMessage() {} |
|
||||
|
|
||||
func (m *CollectionSetting) GetCollection() string { |
|
||||
if m != nil && m.Collection != nil { |
|
||||
return *m.Collection |
|
||||
} |
|
||||
return "" |
|
||||
} |
|
||||
|
|
||||
func (m *CollectionSetting) GetReplicaPlacement() string { |
|
||||
if m != nil && m.ReplicaPlacement != nil { |
|
||||
return *m.ReplicaPlacement |
|
||||
} |
|
||||
return "" |
|
||||
} |
|
||||
|
|
||||
func (m *CollectionSetting) GetVacuumGarbageThreshold() float32 { |
|
||||
if m != nil && m.VacuumGarbageThreshold != nil { |
|
||||
return *m.VacuumGarbageThreshold |
|
||||
} |
|
||||
return 0 |
|
||||
} |
|
||||
|
|
||||
type GlobalSetting struct { |
|
||||
Settings []*CollectionSetting `protobuf:"bytes,1,rep,name=settings" json:"settings,omitempty"` |
|
||||
MasterPeers []string `protobuf:"bytes,2,rep,name=master_peers" json:"master_peers,omitempty"` |
|
||||
XXX_unrecognized []byte `json:"-"` |
|
||||
} |
|
||||
|
|
||||
func (m *GlobalSetting) Reset() { *m = GlobalSetting{} } |
|
||||
func (m *GlobalSetting) String() string { return proto.CompactTextString(m) } |
|
||||
func (*GlobalSetting) ProtoMessage() {} |
|
||||
|
|
||||
func (m *GlobalSetting) GetSettings() []*CollectionSetting { |
|
||||
if m != nil { |
|
||||
return m.Settings |
|
||||
} |
|
||||
return nil |
|
||||
} |
|
||||
|
|
||||
func (m *GlobalSetting) GetMasterPeers() []string { |
|
||||
if m != nil { |
|
||||
return m.MasterPeers |
|
||||
} |
|
||||
return nil |
|
||||
} |
|
||||
|
|
||||
type JoinResponse struct { |
|
||||
Settings *GlobalSetting `protobuf:"bytes,1,opt,name=settings" json:"settings,omitempty"` |
|
||||
XXX_unrecognized []byte `json:"-"` |
|
||||
} |
|
||||
|
|
||||
func (m *JoinResponse) Reset() { *m = JoinResponse{} } |
|
||||
func (m *JoinResponse) String() string { return proto.CompactTextString(m) } |
|
||||
func (*JoinResponse) ProtoMessage() {} |
|
||||
|
|
||||
func (m *JoinResponse) GetSettings() *GlobalSetting { |
|
||||
if m != nil { |
|
||||
return m.Settings |
|
||||
} |
|
||||
return nil |
|
||||
} |
|
||||
|
|
||||
func init() { |
|
||||
} |
|
||||
@ -1,45 +0,0 @@ |
|||||
package operation; |
|
||||
|
|
||||
message VolumeInformationMessage { |
|
||||
required uint32 id = 1; |
|
||||
required uint64 size = 2; |
|
||||
optional string collection = 3; |
|
||||
required uint64 file_count = 4; |
|
||||
required uint64 delete_count = 5; |
|
||||
required uint64 deleted_byte_count = 6; |
|
||||
optional bool read_only = 7; |
|
||||
optional uint32 replica_placement = 8; |
|
||||
optional uint32 version = 9 [default=2]; |
|
||||
optional uint32 ttl = 10; |
|
||||
} |
|
||||
|
|
||||
message JoinMessage { |
|
||||
optional bool is_init = 1; |
|
||||
required string ip = 2; |
|
||||
required uint32 port = 3; |
|
||||
optional string public_url = 4; |
|
||||
required uint32 max_volume_count = 5; |
|
||||
required uint64 max_file_key = 6; |
|
||||
optional string data_center = 7; |
|
||||
optional string rack = 8; |
|
||||
repeated VolumeInformationMessage volumes = 9; |
|
||||
optional uint32 admin_port = 10; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
message CollectionSetting { |
|
||||
optional string collection = 1; |
|
||||
optional string replica_placement = 2; |
|
||||
optional float vacuum_garbage_threshold = 3; |
|
||||
} |
|
||||
|
|
||||
message GlobalSetting { |
|
||||
repeated CollectionSetting settings = 1; |
|
||||
repeated string master_peers = 2; |
|
||||
} |
|
||||
|
|
||||
message JoinResponse { |
|
||||
optional GlobalSetting settings = 1; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@ -1,4 +1,4 @@ |
|||||
TARG=../operation |
|
||||
|
TARG=./ |
||||
|
|
||||
all: |
all: |
||||
protoc --go_out=$(TARG) system_message.proto |
protoc --go_out=$(TARG) system_message.proto |
||||
@ -0,0 +1,180 @@ |
|||||
|
// Code generated by protoc-gen-go.
|
||||
|
// source: system_message.proto
|
||||
|
// DO NOT EDIT!
|
||||
|
|
||||
|
/* |
||||
|
Package weedpb is a generated protocol buffer package. |
||||
|
|
||||
|
It is generated from these files: |
||||
|
system_message.proto |
||||
|
|
||||
|
It has these top-level messages: |
||||
|
VolumeInformationMessage |
||||
|
JoinMessage |
||||
|
JoinMessageV2 |
||||
|
CollectionSetting |
||||
|
JoinResponse |
||||
|
*/ |
||||
|
package weedpb |
||||
|
|
||||
|
import proto "github.com/golang/protobuf/proto" |
||||
|
import fmt "fmt" |
||||
|
import math "math" |
||||
|
|
||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
var _ = proto.Marshal |
||||
|
var _ = fmt.Errorf |
||||
|
var _ = math.Inf |
||||
|
|
||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||
|
// is compatible with the proto package it is being compiled against.
|
||||
|
const _ = proto.ProtoPackageIsVersion1 |
||||
|
|
||||
|
type VolumeInformationMessage struct { |
||||
|
Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` |
||||
|
Size uint64 `protobuf:"varint,2,opt,name=size" json:"size,omitempty"` |
||||
|
Collection string `protobuf:"bytes,3,opt,name=collection" json:"collection,omitempty"` |
||||
|
FileCount uint64 `protobuf:"varint,4,opt,name=file_count,json=fileCount" json:"file_count,omitempty"` |
||||
|
DeleteCount uint64 `protobuf:"varint,5,opt,name=delete_count,json=deleteCount" json:"delete_count,omitempty"` |
||||
|
DeletedByteCount uint64 `protobuf:"varint,6,opt,name=deleted_byte_count,json=deletedByteCount" json:"deleted_byte_count,omitempty"` |
||||
|
ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly" json:"read_only,omitempty"` |
||||
|
ReplicaPlacement uint32 `protobuf:"varint,8,opt,name=replica_placement,json=replicaPlacement" json:"replica_placement,omitempty"` |
||||
|
Version uint32 `protobuf:"varint,9,opt,name=version" json:"version,omitempty"` |
||||
|
Ttl uint32 `protobuf:"varint,10,opt,name=ttl" json:"ttl,omitempty"` |
||||
|
} |
||||
|
|
||||
|
func (m *VolumeInformationMessage) Reset() { *m = VolumeInformationMessage{} } |
||||
|
func (m *VolumeInformationMessage) String() string { return proto.CompactTextString(m) } |
||||
|
func (*VolumeInformationMessage) ProtoMessage() {} |
||||
|
func (*VolumeInformationMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } |
||||
|
|
||||
|
// deprecated
|
||||
|
type JoinMessage struct { |
||||
|
IsInit bool `protobuf:"varint,1,opt,name=is_init,json=isInit" json:"is_init,omitempty"` |
||||
|
Ip string `protobuf:"bytes,2,opt,name=ip" json:"ip,omitempty"` |
||||
|
Port uint32 `protobuf:"varint,3,opt,name=port" json:"port,omitempty"` |
||||
|
PublicUrl string `protobuf:"bytes,4,opt,name=public_url,json=publicUrl" json:"public_url,omitempty"` |
||||
|
MaxVolumeCount uint32 `protobuf:"varint,5,opt,name=max_volume_count,json=maxVolumeCount" json:"max_volume_count,omitempty"` |
||||
|
MaxFileKey uint64 `protobuf:"varint,6,opt,name=max_file_key,json=maxFileKey" json:"max_file_key,omitempty"` |
||||
|
DataCenter string `protobuf:"bytes,7,opt,name=data_center,json=dataCenter" json:"data_center,omitempty"` |
||||
|
Rack string `protobuf:"bytes,8,opt,name=rack" json:"rack,omitempty"` |
||||
|
Volumes []*VolumeInformationMessage `protobuf:"bytes,9,rep,name=volumes" json:"volumes,omitempty"` |
||||
|
AdminPort uint32 `protobuf:"varint,10,opt,name=admin_port,json=adminPort" json:"admin_port,omitempty"` |
||||
|
} |
||||
|
|
||||
|
func (m *JoinMessage) Reset() { *m = JoinMessage{} } |
||||
|
func (m *JoinMessage) String() string { return proto.CompactTextString(m) } |
||||
|
func (*JoinMessage) ProtoMessage() {} |
||||
|
func (*JoinMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } |
||||
|
|
||||
|
func (m *JoinMessage) GetVolumes() []*VolumeInformationMessage { |
||||
|
if m != nil { |
||||
|
return m.Volumes |
||||
|
} |
||||
|
return nil |
||||
|
} |
||||
|
|
||||
|
type JoinMessageV2 struct { |
||||
|
JoinKey string `protobuf:"bytes,1,opt,name=join_key,json=joinKey" json:"join_key,omitempty"` |
||||
|
Ip string `protobuf:"bytes,2,opt,name=ip" json:"ip,omitempty"` |
||||
|
Port uint32 `protobuf:"varint,3,opt,name=port" json:"port,omitempty"` |
||||
|
PublicUrl string `protobuf:"bytes,4,opt,name=public_url,json=publicUrl" json:"public_url,omitempty"` |
||||
|
MaxVolumeCount uint32 `protobuf:"varint,5,opt,name=max_volume_count,json=maxVolumeCount" json:"max_volume_count,omitempty"` |
||||
|
MaxFileKey uint64 `protobuf:"varint,6,opt,name=max_file_key,json=maxFileKey" json:"max_file_key,omitempty"` |
||||
|
DataCenter string `protobuf:"bytes,7,opt,name=data_center,json=dataCenter" json:"data_center,omitempty"` |
||||
|
Rack string `protobuf:"bytes,8,opt,name=rack" json:"rack,omitempty"` |
||||
|
Volumes []*VolumeInformationMessage `protobuf:"bytes,9,rep,name=volumes" json:"volumes,omitempty"` |
||||
|
} |
||||
|
|
||||
|
func (m *JoinMessageV2) Reset() { *m = JoinMessageV2{} } |
||||
|
func (m *JoinMessageV2) String() string { return proto.CompactTextString(m) } |
||||
|
func (*JoinMessageV2) ProtoMessage() {} |
||||
|
func (*JoinMessageV2) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } |
||||
|
|
||||
|
func (m *JoinMessageV2) GetVolumes() []*VolumeInformationMessage { |
||||
|
if m != nil { |
||||
|
return m.Volumes |
||||
|
} |
||||
|
return nil |
||||
|
} |
||||
|
|
||||
|
type CollectionSetting struct { |
||||
|
Collection string `protobuf:"bytes,1,opt,name=collection" json:"collection,omitempty"` |
||||
|
ReplicaPlacement string `protobuf:"bytes,2,opt,name=replica_placement,json=replicaPlacement" json:"replica_placement,omitempty"` |
||||
|
} |
||||
|
|
||||
|
func (m *CollectionSetting) Reset() { *m = CollectionSetting{} } |
||||
|
func (m *CollectionSetting) String() string { return proto.CompactTextString(m) } |
||||
|
func (*CollectionSetting) ProtoMessage() {} |
||||
|
func (*CollectionSetting) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } |
||||
|
|
||||
|
type JoinResponse struct { |
||||
|
Error string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` |
||||
|
JoinKey string `protobuf:"bytes,2,opt,name=join_key,json=joinKey" json:"join_key,omitempty"` |
||||
|
JoinIp string `protobuf:"bytes,3,opt,name=join_ip,json=joinIp" json:"join_ip,omitempty"` |
||||
|
VolumeSizeLimit uint64 `protobuf:"varint,4,opt,name=volume_size_limit,json=volumeSizeLimit" json:"volume_size_limit,omitempty"` |
||||
|
CollectionSettings []*CollectionSetting `protobuf:"bytes,5,rep,name=collection_settings,json=collectionSettings" json:"collection_settings,omitempty"` |
||||
|
SecretKey string `protobuf:"bytes,6,opt,name=secret_key,json=secretKey" json:"secret_key,omitempty"` |
||||
|
} |
||||
|
|
||||
|
func (m *JoinResponse) Reset() { *m = JoinResponse{} } |
||||
|
func (m *JoinResponse) String() string { return proto.CompactTextString(m) } |
||||
|
func (*JoinResponse) ProtoMessage() {} |
||||
|
func (*JoinResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } |
||||
|
|
||||
|
func (m *JoinResponse) GetCollectionSettings() []*CollectionSetting { |
||||
|
if m != nil { |
||||
|
return m.CollectionSettings |
||||
|
} |
||||
|
return nil |
||||
|
} |
||||
|
|
||||
|
func init() { |
||||
|
proto.RegisterType((*VolumeInformationMessage)(nil), "weedpb.VolumeInformationMessage") |
||||
|
proto.RegisterType((*JoinMessage)(nil), "weedpb.JoinMessage") |
||||
|
proto.RegisterType((*JoinMessageV2)(nil), "weedpb.JoinMessageV2") |
||||
|
proto.RegisterType((*CollectionSetting)(nil), "weedpb.CollectionSetting") |
||||
|
proto.RegisterType((*JoinResponse)(nil), "weedpb.JoinResponse") |
||||
|
} |
||||
|
|
||||
|
var fileDescriptor0 = []byte{ |
||||
|
// 593 bytes of a gzipped FileDescriptorProto
|
||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe4, 0x94, 0x5d, 0x6e, 0xd3, 0x40, |
||||
|
0x10, 0xc7, 0x15, 0xb7, 0x4d, 0xe2, 0x49, 0x53, 0xd2, 0xa5, 0x12, 0xae, 0x10, 0x50, 0xf2, 0x54, |
||||
|
0x01, 0x2a, 0x52, 0x79, 0xe3, 0xb1, 0x95, 0x90, 0x5a, 0x40, 0x54, 0x5b, 0xd1, 0x57, 0xe3, 0xd8, |
||||
|
0xd3, 0x6a, 0xa9, 0xed, 0xb5, 0x76, 0x37, 0x05, 0x73, 0x24, 0xee, 0x81, 0xc4, 0x6d, 0xb8, 0x02, |
||||
|
0xb3, 0xb3, 0x71, 0xe8, 0x07, 0x9c, 0x80, 0xb7, 0x99, 0xff, 0xcc, 0xda, 0x33, 0xbf, 0xd9, 0x59, |
||||
|
0xd8, 0xb2, 0xad, 0x75, 0x58, 0xa5, 0x15, 0x5a, 0x9b, 0x5d, 0xe0, 0x5e, 0x63, 0xb4, 0xd3, 0xa2, |
||||
|
0xff, 0x05, 0xb1, 0x68, 0x66, 0xd3, 0x9f, 0x11, 0x24, 0x67, 0xba, 0x9c, 0x57, 0x78, 0x54, 0x9f, |
||||
|
0x6b, 0x53, 0x65, 0x4e, 0xe9, 0xfa, 0x7d, 0x48, 0x15, 0x1b, 0x10, 0xa9, 0x22, 0xe9, 0xed, 0xf4, |
||||
|
0x76, 0xc7, 0x92, 0x2c, 0x21, 0x60, 0xd5, 0xaa, 0x6f, 0x98, 0x44, 0xa4, 0xac, 0x4a, 0xb6, 0xc5, |
||||
|
0x63, 0x80, 0x5c, 0x97, 0x25, 0xe6, 0xfe, 0x60, 0xb2, 0x42, 0x91, 0x58, 0x5e, 0x53, 0xc4, 0x23, |
||||
|
0x80, 0x73, 0x55, 0x62, 0x9a, 0xeb, 0x79, 0xed, 0x92, 0x55, 0x3e, 0x19, 0x7b, 0xe5, 0xd0, 0x0b, |
||||
|
0xe2, 0x29, 0xac, 0x17, 0x58, 0xa2, 0xeb, 0x12, 0xd6, 0x38, 0x61, 0x14, 0xb4, 0x90, 0xf2, 0x02, |
||||
|
0x44, 0x70, 0x8b, 0x74, 0xd6, 0x2e, 0x13, 0xfb, 0x9c, 0x38, 0x59, 0x44, 0x0e, 0xda, 0x2e, 0xfb, |
||||
|
0x21, 0xc4, 0x06, 0xb3, 0x22, 0xd5, 0x75, 0xd9, 0x26, 0x03, 0x4a, 0x1a, 0xca, 0xa1, 0x17, 0x3e, |
||||
|
0x90, 0x2f, 0x5e, 0xc2, 0xa6, 0xc1, 0xa6, 0x54, 0x79, 0x96, 0x36, 0x65, 0x96, 0x63, 0x85, 0xf4, |
||||
|
0xa5, 0xa1, 0xef, 0xef, 0x20, 0x4a, 0x7a, 0x72, 0xb2, 0x08, 0x9e, 0x74, 0x31, 0x91, 0xc0, 0xe0, |
||||
|
0x0a, 0x8d, 0xf5, 0xad, 0xc5, 0x8c, 0xa1, 0x73, 0xc5, 0x04, 0x56, 0x9c, 0x2b, 0x13, 0x60, 0xd5, |
||||
|
0x9b, 0xd3, 0x1f, 0x11, 0x8c, 0x8e, 0xb5, 0x5a, 0xd2, 0x7b, 0x00, 0x03, 0x65, 0x53, 0x55, 0x2b, |
||||
|
0xc7, 0x08, 0x87, 0xb2, 0xaf, 0xec, 0x11, 0x79, 0x8c, 0xb5, 0x61, 0x88, 0x31, 0x61, 0x6d, 0x3c, |
||||
|
0xd6, 0x46, 0x1b, 0xc7, 0xf0, 0xc6, 0x92, 0x6d, 0x8f, 0xad, 0x99, 0xcf, 0xa8, 0x98, 0x74, 0x6e, |
||||
|
0x4a, 0xc6, 0x16, 0xcb, 0x38, 0x28, 0x1f, 0x4d, 0x29, 0x76, 0x61, 0x52, 0x65, 0x5f, 0xd3, 0x2b, |
||||
|
0x9e, 0xdc, 0x35, 0x74, 0x63, 0xb9, 0x41, 0x7a, 0x18, 0x68, 0xe0, 0xb1, 0x03, 0xeb, 0x3e, 0x93, |
||||
|
0x67, 0x70, 0x89, 0xed, 0x82, 0x1b, 0x90, 0xf6, 0x86, 0xa4, 0xb7, 0xd8, 0x8a, 0x27, 0x30, 0x2a, |
||||
|
0x32, 0x97, 0xa5, 0x39, 0x35, 0x8c, 0x86, 0x99, 0xd1, 0x08, 0xbd, 0x74, 0xc8, 0x8a, 0xaf, 0xcf, |
||||
|
0x64, 0xf9, 0x25, 0x83, 0x8a, 0x25, 0xdb, 0xe2, 0x35, 0x81, 0xe1, 0xbf, 0x58, 0x02, 0xb3, 0xb2, |
||||
|
0x3b, 0xda, 0xdf, 0xd9, 0x0b, 0x37, 0x6a, 0xef, 0x5f, 0xb7, 0x49, 0x76, 0x07, 0x7c, 0x6f, 0x59, |
||||
|
0x51, 0xa9, 0x3a, 0xe5, 0xae, 0x03, 0xc1, 0x98, 0x95, 0x13, 0x12, 0xa6, 0xdf, 0x23, 0x18, 0x5f, |
||||
|
0xe3, 0x78, 0xb6, 0x2f, 0xb6, 0x61, 0xf8, 0x99, 0x04, 0xae, 0xbf, 0xc7, 0x45, 0x0c, 0xbc, 0xef, |
||||
|
0x8b, 0xff, 0xcf, 0x59, 0x4e, 0x3f, 0xc1, 0xe6, 0xe1, 0x72, 0xd9, 0x4e, 0xd1, 0x39, 0x55, 0x5f, |
||||
|
0xdc, 0xda, 0xc9, 0xde, 0x9d, 0x9d, 0x7c, 0xfe, 0xb7, 0x35, 0x08, 0x0c, 0xef, 0xac, 0xc0, 0xf4, |
||||
|
0x57, 0x0f, 0xd6, 0xfd, 0x38, 0x24, 0xda, 0x46, 0xd7, 0x16, 0xc5, 0x16, 0xac, 0xa1, 0x31, 0xda, |
||||
|
0x2c, 0x3e, 0x1c, 0x9c, 0x1b, 0x33, 0x8a, 0x6e, 0xce, 0x88, 0x16, 0x81, 0x43, 0x34, 0xa8, 0xf0, |
||||
|
0x3e, 0xf4, 0xbd, 0x7b, 0xd4, 0x88, 0x67, 0xb0, 0xb9, 0xa0, 0xee, 0x9f, 0x92, 0xb4, 0x54, 0x95, |
||||
|
0xea, 0x9e, 0x88, 0x7b, 0x21, 0x70, 0x4a, 0xfa, 0x3b, 0x2f, 0x8b, 0x63, 0xb8, 0xff, 0xa7, 0x83, |
||||
|
0xd4, 0x86, 0x4e, 0x2d, 0x0d, 0xca, 0x03, 0xdb, 0xee, 0x80, 0xdd, 0x61, 0x21, 0x45, 0x7e, 0x5b, |
||||
|
0xe2, 0x0b, 0x68, 0x31, 0x37, 0xe8, 0x96, 0x53, 0xa4, 0x0b, 0x11, 0x14, 0xaa, 0x77, 0xd6, 0xe7, |
||||
|
0x27, 0xf2, 0xd5, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x7d, 0xe0, 0x05, 0x3a, 0x05, 0x00, |
||||
|
0x00, |
||||
|
} |
||||
@ -0,0 +1,61 @@ |
|||||
|
syntax = "proto3"; |
||||
|
package weedpb; |
||||
|
|
||||
|
|
||||
|
message VolumeInformationMessage { |
||||
|
uint32 id = 1; |
||||
|
uint64 size = 2; |
||||
|
string collection = 3; |
||||
|
uint64 file_count = 4; |
||||
|
uint64 delete_count = 5; |
||||
|
uint64 deleted_byte_count = 6; |
||||
|
bool read_only = 7; |
||||
|
uint32 replica_placement = 8 [deprecated=true]; |
||||
|
uint32 version = 9; |
||||
|
uint32 ttl = 10; |
||||
|
} |
||||
|
|
||||
|
// deprecated |
||||
|
message JoinMessage { |
||||
|
bool is_init = 1; |
||||
|
string ip = 2; |
||||
|
uint32 port = 3; |
||||
|
string public_url = 4; |
||||
|
uint32 max_volume_count = 5; |
||||
|
uint64 max_file_key = 6; |
||||
|
string data_center = 7; |
||||
|
string rack = 8; |
||||
|
repeated VolumeInformationMessage volumes = 9; |
||||
|
uint32 admin_port = 10; |
||||
|
} |
||||
|
|
||||
|
message JoinMessageV2 { |
||||
|
string join_key = 1; //if data node is init, set join key empty |
||||
|
string ip = 2; |
||||
|
uint32 port = 3; |
||||
|
string public_url = 4; |
||||
|
uint32 max_volume_count = 5; |
||||
|
uint64 max_file_key = 6; |
||||
|
string data_center = 7; |
||||
|
string rack = 8; |
||||
|
repeated VolumeInformationMessage volumes = 9; |
||||
|
} |
||||
|
|
||||
|
message CollectionSetting { |
||||
|
string collection = 1; |
||||
|
string replica_placement = 2; |
||||
|
// float vacuum_garbage_threshold = 3; |
||||
|
} |
||||
|
|
||||
|
message JoinResponse { |
||||
|
string error = 1; |
||||
|
string join_key = 2; |
||||
|
string join_ip = 3; |
||||
|
uint64 volume_size_limit = 4; |
||||
|
repeated CollectionSetting collection_settings = 5; |
||||
|
string secret_key = 6; |
||||
|
// repeated string master_peers = 7; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue