节点配置支持压缩传输

This commit is contained in:
GoEdgeLab
2021-11-11 14:17:45 +08:00
parent 3d8d2438bc
commit 0526b8ff34
4 changed files with 550 additions and 483 deletions

View File

@@ -37,6 +37,8 @@ type NodeTask struct {
IsOk bool `protobuf:"varint,4,opt,name=isOk,proto3" json:"isOk,omitempty"` IsOk bool `protobuf:"varint,4,opt,name=isOk,proto3" json:"isOk,omitempty"`
Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
UpdatedAt int64 `protobuf:"varint,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
Version int64 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
IsPrimary bool `protobuf:"varint,8,opt,name=isPrimary,proto3" json:"isPrimary,omitempty"` // 是否为主节点,非主节点稍等再同步有利于提升同步速度
Node *Node `protobuf:"bytes,30,opt,name=node,proto3" json:"node,omitempty"` Node *Node `protobuf:"bytes,30,opt,name=node,proto3" json:"node,omitempty"`
NodeCluster *NodeCluster `protobuf:"bytes,31,opt,name=nodeCluster,proto3" json:"nodeCluster,omitempty"` NodeCluster *NodeCluster `protobuf:"bytes,31,opt,name=nodeCluster,proto3" json:"nodeCluster,omitempty"`
} }
@@ -115,6 +117,20 @@ func (x *NodeTask) GetUpdatedAt() int64 {
return 0 return 0
} }
func (x *NodeTask) GetVersion() int64 {
if x != nil {
return x.Version
}
return 0
}
func (x *NodeTask) GetIsPrimary() bool {
if x != nil {
return x.IsPrimary
}
return false
}
func (x *NodeTask) GetNode() *Node { func (x *NodeTask) GetNode() *Node {
if x != nil { if x != nil {
return x.Node return x.Node
@@ -137,7 +153,7 @@ var file_models_model_node_task_proto_rawDesc = []byte{
0x70, 0x62, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6d, 0x6f, 0x64, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdf, 0x01, 0x0a, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x02, 0x0a,
0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
@@ -146,13 +162,17 @@ var file_models_model_node_task_proto_rawDesc = []byte{
0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72,
0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12,
0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, 0x20, 0x01, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x18, 0x0a,
0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69,
0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72,
0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x1e, 0x20,
0x72, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0x06, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e,
0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x6f, 0x64, 0x65, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f,
0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,8 @@ message NodeTask {
bool isOk = 4; bool isOk = 4;
string error = 5; string error = 5;
int64 updatedAt = 6; int64 updatedAt = 6;
int64 version = 7;
bool isPrimary = 8; // 是否为主节点,非主节点稍等再同步有利于提升同步速度
Node node = 30; Node node = 30;
NodeCluster nodeCluster = 31; NodeCluster nodeCluster = 31;

View File

@@ -241,11 +241,15 @@ message FindEnabledBasicNodeResponse {
message FindCurrentNodeConfigRequest { message FindCurrentNodeConfigRequest {
// 由于登录信息中已经包含了节点信息所以这里不需要nodeId // 由于登录信息中已经包含了节点信息所以这里不需要nodeId
int64 version = 1; int64 version = 1;
bool compress = 2; // 是否压缩
int64 nodeTaskVersion = 3; // 通知任务版本
} }
message FindCurrentNodeConfigResponse { message FindCurrentNodeConfigResponse {
bytes nodeJSON = 1; bytes nodeJSON = 1;
bool isChanged = 2; bool isChanged = 2;
bool isCompressed = 3;
int64 dataSize = 4;
} }
// 节点stream // 节点stream