1
0
Fork 0

Integrate chunking - WIP

I need more sophisticated dechunker management.
master
Philip O'Toole 1 year ago
parent eed503bf02
commit 1c6f691ff8

@ -34,21 +34,23 @@ const (
Command_COMMAND_TYPE_NOTIFY Command_Type = 7
Command_COMMAND_TYPE_JOIN Command_Type = 8
Command_COMMAND_TYPE_REQUEST Command_Type = 9
Command_COMMAND_TYPE_LOAD_CHUNK Command_Type = 10
)
// Enum value maps for Command_Type.
var (
Command_Type_name = map[int32]string{
0: "COMMAND_TYPE_UNKNOWN",
1: "COMMAND_TYPE_GET_NODE_API_URL",
2: "COMMAND_TYPE_EXECUTE",
3: "COMMAND_TYPE_QUERY",
4: "COMMAND_TYPE_BACKUP",
5: "COMMAND_TYPE_LOAD",
6: "COMMAND_TYPE_REMOVE_NODE",
7: "COMMAND_TYPE_NOTIFY",
8: "COMMAND_TYPE_JOIN",
9: "COMMAND_TYPE_REQUEST",
0: "COMMAND_TYPE_UNKNOWN",
1: "COMMAND_TYPE_GET_NODE_API_URL",
2: "COMMAND_TYPE_EXECUTE",
3: "COMMAND_TYPE_QUERY",
4: "COMMAND_TYPE_BACKUP",
5: "COMMAND_TYPE_LOAD",
6: "COMMAND_TYPE_REMOVE_NODE",
7: "COMMAND_TYPE_NOTIFY",
8: "COMMAND_TYPE_JOIN",
9: "COMMAND_TYPE_REQUEST",
10: "COMMAND_TYPE_LOAD_CHUNK",
}
Command_Type_value = map[string]int32{
"COMMAND_TYPE_UNKNOWN": 0,
@ -61,6 +63,7 @@ var (
"COMMAND_TYPE_NOTIFY": 7,
"COMMAND_TYPE_JOIN": 8,
"COMMAND_TYPE_REQUEST": 9,
"COMMAND_TYPE_LOAD_CHUNK": 10,
}
)
@ -209,6 +212,7 @@ type Command struct {
// *Command_NotifyRequest
// *Command_JoinRequest
// *Command_ExecuteQueryRequest
// *Command_LoadChunkRequest
Request isCommand_Request `protobuf_oneof:"request"`
Credentials *Credentials `protobuf:"bytes,4,opt,name=credentials,proto3" json:"credentials,omitempty"`
}
@ -315,6 +319,13 @@ func (x *Command) GetExecuteQueryRequest() *command.ExecuteQueryRequest {
return nil
}
func (x *Command) GetLoadChunkRequest() *command.LoadChunkRequest {
if x, ok := x.GetRequest().(*Command_LoadChunkRequest); ok {
return x.LoadChunkRequest
}
return nil
}
func (x *Command) GetCredentials() *Credentials {
if x != nil {
return x.Credentials
@ -358,6 +369,10 @@ type Command_ExecuteQueryRequest struct {
ExecuteQueryRequest *command.ExecuteQueryRequest `protobuf:"bytes,10,opt,name=execute_query_request,json=executeQueryRequest,proto3,oneof"`
}
type Command_LoadChunkRequest struct {
LoadChunkRequest *command.LoadChunkRequest `protobuf:"bytes,11,opt,name=load_chunk_request,json=loadChunkRequest,proto3,oneof"`
}
func (*Command_ExecuteRequest) isCommand_Request() {}
func (*Command_QueryRequest) isCommand_Request() {}
@ -374,6 +389,8 @@ func (*Command_JoinRequest) isCommand_Request() {}
func (*Command_ExecuteQueryRequest) isCommand_Request() {}
func (*Command_LoadChunkRequest) isCommand_Request() {}
type CommandExecuteResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -641,6 +658,53 @@ func (x *CommandLoadResponse) GetError() string {
return ""
}
type CommandLoadChunkResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
}
func (x *CommandLoadChunkResponse) Reset() {
*x = CommandLoadChunkResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CommandLoadChunkResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommandLoadChunkResponse) ProtoMessage() {}
func (x *CommandLoadChunkResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CommandLoadChunkResponse.ProtoReflect.Descriptor instead.
func (*CommandLoadChunkResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{8}
}
func (x *CommandLoadChunkResponse) GetError() string {
if x != nil {
return x.Error
}
return ""
}
type CommandRemoveNodeResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -652,7 +716,7 @@ type CommandRemoveNodeResponse struct {
func (x *CommandRemoveNodeResponse) Reset() {
*x = CommandRemoveNodeResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[8]
mi := &file_message_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -665,7 +729,7 @@ func (x *CommandRemoveNodeResponse) String() string {
func (*CommandRemoveNodeResponse) ProtoMessage() {}
func (x *CommandRemoveNodeResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[8]
mi := &file_message_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -678,7 +742,7 @@ func (x *CommandRemoveNodeResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandRemoveNodeResponse.ProtoReflect.Descriptor instead.
func (*CommandRemoveNodeResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{8}
return file_message_proto_rawDescGZIP(), []int{9}
}
func (x *CommandRemoveNodeResponse) GetError() string {
@ -699,7 +763,7 @@ type CommandNotifyResponse struct {
func (x *CommandNotifyResponse) Reset() {
*x = CommandNotifyResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[9]
mi := &file_message_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -712,7 +776,7 @@ func (x *CommandNotifyResponse) String() string {
func (*CommandNotifyResponse) ProtoMessage() {}
func (x *CommandNotifyResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[9]
mi := &file_message_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -725,7 +789,7 @@ func (x *CommandNotifyResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandNotifyResponse.ProtoReflect.Descriptor instead.
func (*CommandNotifyResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{9}
return file_message_proto_rawDescGZIP(), []int{10}
}
func (x *CommandNotifyResponse) GetError() string {
@ -746,7 +810,7 @@ type CommandJoinResponse struct {
func (x *CommandJoinResponse) Reset() {
*x = CommandJoinResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[10]
mi := &file_message_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -759,7 +823,7 @@ func (x *CommandJoinResponse) String() string {
func (*CommandJoinResponse) ProtoMessage() {}
func (x *CommandJoinResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[10]
mi := &file_message_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -772,7 +836,7 @@ func (x *CommandJoinResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandJoinResponse.ProtoReflect.Descriptor instead.
func (*CommandJoinResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{10}
return file_message_proto_rawDescGZIP(), []int{11}
}
func (x *CommandJoinResponse) GetError() string {
@ -794,7 +858,7 @@ var file_message_proto_rawDesc = []byte{
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61,
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x1b, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x72, 0x6c, 0x22, 0xa3, 0x07, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12,
0x75, 0x72, 0x6c, 0x22, 0x8b, 0x08, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12,
0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e,
0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e,
0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x65, 0x78,
@ -831,65 +895,75 @@ var file_message_proto_rawDesc = []byte{
0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48,
0x00, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e,
0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c,
0x73, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0x8d,
0x02, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41,
0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10,
0x00, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x50, 0x49, 0x5f, 0x55,
0x52, 0x4c, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x10, 0x02, 0x12, 0x16,
0x0a, 0x12, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x51,
0x55, 0x45, 0x52, 0x59, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e,
0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x10, 0x04, 0x12,
0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x4c, 0x4f, 0x41, 0x44, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e,
0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x4e, 0x4f,
0x44, 0x45, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x07, 0x12, 0x15, 0x0a,
0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f,
0x49, 0x4e, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x09, 0x42, 0x09,
0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x60, 0x0a, 0x16, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x12, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63,
0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4c, 0x6f, 0x61,
0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52,
0x10, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x36, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x0b, 0x63, 0x72,
0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0xaa, 0x02, 0x0a, 0x04, 0x54, 0x79,
0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d,
0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x45, 0x54,
0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x50, 0x49, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x01, 0x12,
0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d,
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10,
0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f,
0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10,
0x05, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x06, 0x12,
0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d,
0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x08, 0x12,
0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x09, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4d,
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43,
0x48, 0x55, 0x4e, 0x4b, 0x10, 0x0a, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x22, 0x60, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65,
0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75,
0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
0x6f, 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x69, 0x0a, 0x16, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x14, 0x43,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65,
0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42,
0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x22, 0x30, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c,
0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x31, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x6f, 0x77,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77,
0x73, 0x22, 0x69, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78,
0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x0a, 0x15,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
0x2b, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x31, 0x0a, 0x19,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72,
0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22,
0x2d, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2b,
0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x22, 0x5a, 0x20, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65,
0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2b, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d,
0x61, 0x6e, 0x64, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74,
0x65, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@ -905,7 +979,7 @@ func file_message_proto_rawDescGZIP() []byte {
}
var file_message_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_message_proto_goTypes = []interface{}{
(Command_Type)(0), // 0: cluster.Command.Type
(*Credentials)(nil), // 1: cluster.Credentials
@ -916,40 +990,43 @@ var file_message_proto_goTypes = []interface{}{
(*CommandRequestResponse)(nil), // 6: cluster.CommandRequestResponse
(*CommandBackupResponse)(nil), // 7: cluster.CommandBackupResponse
(*CommandLoadResponse)(nil), // 8: cluster.CommandLoadResponse
(*CommandRemoveNodeResponse)(nil), // 9: cluster.CommandRemoveNodeResponse
(*CommandNotifyResponse)(nil), // 10: cluster.CommandNotifyResponse
(*CommandJoinResponse)(nil), // 11: cluster.CommandJoinResponse
(*command.ExecuteRequest)(nil), // 12: command.ExecuteRequest
(*command.QueryRequest)(nil), // 13: command.QueryRequest
(*command.BackupRequest)(nil), // 14: command.BackupRequest
(*command.LoadRequest)(nil), // 15: command.LoadRequest
(*command.RemoveNodeRequest)(nil), // 16: command.RemoveNodeRequest
(*command.NotifyRequest)(nil), // 17: command.NotifyRequest
(*command.JoinRequest)(nil), // 18: command.JoinRequest
(*command.ExecuteQueryRequest)(nil), // 19: command.ExecuteQueryRequest
(*command.ExecuteResult)(nil), // 20: command.ExecuteResult
(*command.QueryRows)(nil), // 21: command.QueryRows
(*command.ExecuteQueryResponse)(nil), // 22: command.ExecuteQueryResponse
(*CommandLoadChunkResponse)(nil), // 9: cluster.CommandLoadChunkResponse
(*CommandRemoveNodeResponse)(nil), // 10: cluster.CommandRemoveNodeResponse
(*CommandNotifyResponse)(nil), // 11: cluster.CommandNotifyResponse
(*CommandJoinResponse)(nil), // 12: cluster.CommandJoinResponse
(*command.ExecuteRequest)(nil), // 13: command.ExecuteRequest
(*command.QueryRequest)(nil), // 14: command.QueryRequest
(*command.BackupRequest)(nil), // 15: command.BackupRequest
(*command.LoadRequest)(nil), // 16: command.LoadRequest
(*command.RemoveNodeRequest)(nil), // 17: command.RemoveNodeRequest
(*command.NotifyRequest)(nil), // 18: command.NotifyRequest
(*command.JoinRequest)(nil), // 19: command.JoinRequest
(*command.ExecuteQueryRequest)(nil), // 20: command.ExecuteQueryRequest
(*command.LoadChunkRequest)(nil), // 21: command.LoadChunkRequest
(*command.ExecuteResult)(nil), // 22: command.ExecuteResult
(*command.QueryRows)(nil), // 23: command.QueryRows
(*command.ExecuteQueryResponse)(nil), // 24: command.ExecuteQueryResponse
}
var file_message_proto_depIdxs = []int32{
0, // 0: cluster.Command.type:type_name -> cluster.Command.Type
12, // 1: cluster.Command.execute_request:type_name -> command.ExecuteRequest
13, // 2: cluster.Command.query_request:type_name -> command.QueryRequest
14, // 3: cluster.Command.backup_request:type_name -> command.BackupRequest
15, // 4: cluster.Command.load_request:type_name -> command.LoadRequest
16, // 5: cluster.Command.remove_node_request:type_name -> command.RemoveNodeRequest
17, // 6: cluster.Command.notify_request:type_name -> command.NotifyRequest
18, // 7: cluster.Command.join_request:type_name -> command.JoinRequest
19, // 8: cluster.Command.execute_query_request:type_name -> command.ExecuteQueryRequest
1, // 9: cluster.Command.credentials:type_name -> cluster.Credentials
20, // 10: cluster.CommandExecuteResponse.results:type_name -> command.ExecuteResult
21, // 11: cluster.CommandQueryResponse.rows:type_name -> command.QueryRows
22, // 12: cluster.CommandRequestResponse.response:type_name -> command.ExecuteQueryResponse
13, // [13:13] is the sub-list for method output_type
13, // [13:13] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
13, // [13:13] is the sub-list for extension extendee
0, // [0:13] is the sub-list for field type_name
13, // 1: cluster.Command.execute_request:type_name -> command.ExecuteRequest
14, // 2: cluster.Command.query_request:type_name -> command.QueryRequest
15, // 3: cluster.Command.backup_request:type_name -> command.BackupRequest
16, // 4: cluster.Command.load_request:type_name -> command.LoadRequest
17, // 5: cluster.Command.remove_node_request:type_name -> command.RemoveNodeRequest
18, // 6: cluster.Command.notify_request:type_name -> command.NotifyRequest
19, // 7: cluster.Command.join_request:type_name -> command.JoinRequest
20, // 8: cluster.Command.execute_query_request:type_name -> command.ExecuteQueryRequest
21, // 9: cluster.Command.load_chunk_request:type_name -> command.LoadChunkRequest
1, // 10: cluster.Command.credentials:type_name -> cluster.Credentials
22, // 11: cluster.CommandExecuteResponse.results:type_name -> command.ExecuteResult
23, // 12: cluster.CommandQueryResponse.rows:type_name -> command.QueryRows
24, // 13: cluster.CommandRequestResponse.response:type_name -> command.ExecuteQueryResponse
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
}
func init() { file_message_proto_init() }
@ -1055,7 +1132,7 @@ func file_message_proto_init() {
}
}
file_message_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandRemoveNodeResponse); i {
switch v := v.(*CommandLoadChunkResponse); i {
case 0:
return &v.state
case 1:
@ -1067,7 +1144,7 @@ func file_message_proto_init() {
}
}
file_message_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandNotifyResponse); i {
switch v := v.(*CommandRemoveNodeResponse); i {
case 0:
return &v.state
case 1:
@ -1079,6 +1156,18 @@ func file_message_proto_init() {
}
}
file_message_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandNotifyResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_message_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandJoinResponse); i {
case 0:
return &v.state
@ -1100,6 +1189,7 @@ func file_message_proto_init() {
(*Command_NotifyRequest)(nil),
(*Command_JoinRequest)(nil),
(*Command_ExecuteQueryRequest)(nil),
(*Command_LoadChunkRequest)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -1107,7 +1197,7 @@ func file_message_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_message_proto_rawDesc,
NumEnums: 1,
NumMessages: 11,
NumMessages: 12,
NumExtensions: 0,
NumServices: 0,
},

@ -26,6 +26,7 @@ message Command {
COMMAND_TYPE_NOTIFY = 7;
COMMAND_TYPE_JOIN = 8;
COMMAND_TYPE_REQUEST = 9;
COMMAND_TYPE_LOAD_CHUNK = 10;
}
Type type = 1;
@ -38,6 +39,7 @@ message Command {
command.NotifyRequest notify_request = 8;
command.JoinRequest join_request = 9;
command.ExecuteQueryRequest execute_query_request = 10;
command.LoadChunkRequest load_chunk_request = 11;
}
Credentials credentials = 4;
@ -67,6 +69,10 @@ message CommandLoadResponse {
string error = 1;
}
message CommandLoadChunkResponse {
string error = 1;
}
message CommandRemoveNodeResponse {
string error = 1;
}

@ -128,6 +128,7 @@ const (
Command_COMMAND_TYPE_LOAD Command_Type = 4
Command_COMMAND_TYPE_JOIN Command_Type = 5
Command_COMMAND_TYPE_EXECUTE_QUERY Command_Type = 6
Command_COMMAND_TYPE_LOAD_CHUNK Command_Type = 7
)
// Enum value maps for Command_Type.
@ -140,6 +141,7 @@ var (
4: "COMMAND_TYPE_LOAD",
5: "COMMAND_TYPE_JOIN",
6: "COMMAND_TYPE_EXECUTE_QUERY",
7: "COMMAND_TYPE_LOAD_CHUNK",
}
Command_Type_value = map[string]int32{
"COMMAND_TYPE_UNKNOWN": 0,
@ -149,6 +151,7 @@ var (
"COMMAND_TYPE_LOAD": 4,
"COMMAND_TYPE_JOIN": 5,
"COMMAND_TYPE_EXECUTE_QUERY": 6,
"COMMAND_TYPE_LOAD_CHUNK": 7,
}
)
@ -1478,7 +1481,7 @@ var file_command_proto_rawDesc = []byte{
0x73, 0x22, 0x23, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x16, 0x0a, 0x04, 0x4e, 0x6f, 0x6f, 0x70, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaf,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcc,
0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52,
@ -1486,7 +1489,7 @@ var file_command_proto_rawDesc = []byte{
0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x43,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65,
0x73, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70,
0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0xb7, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0xd4, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d,
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10,
@ -1498,9 +1501,11 @@ var file_command_proto_rawDesc = []byte{
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x05,
0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x06,
0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72,
0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x10, 0x07, 0x42, 0x22, 0x5a,
0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69,
0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

@ -124,6 +124,7 @@ message Command {
COMMAND_TYPE_LOAD = 4;
COMMAND_TYPE_JOIN = 5;
COMMAND_TYPE_EXECUTE_QUERY = 6;
COMMAND_TYPE_LOAD_CHUNK = 7;
}
Type type = 1;
bytes sub_command = 2;

@ -161,6 +161,16 @@ func UnmarshalLoadRequest(b []byte, lr *LoadRequest) error {
return proto.Unmarshal(u, lr)
}
// MarshalLoadChunkRequest marshals a LoadChunkRequest command
func MarshalLoadChunkRequest(lr *LoadChunkRequest) ([]byte, error) {
return proto.Marshal(lr)
}
// UnmarshalLoadChunkRequest unmarshals a LoadChunkRequest command
func UnmarshalLoadChunkRequest(b []byte, lr *LoadChunkRequest) error {
return proto.Unmarshal(b, lr)
}
// UnmarshalSubCommand unmarshalls a sub command m. It assumes that
// m is the correct type.
func UnmarshalSubCommand(c *Command, m proto.Message) error {

@ -22,6 +22,7 @@ import (
"github.com/hashicorp/raft"
"github.com/rqlite/rqlite/command"
"github.com/rqlite/rqlite/command/chunking"
sql "github.com/rqlite/rqlite/db"
rlog "github.com/rqlite/rqlite/log"
"github.com/rqlite/rqlite/snapshot"
@ -1143,8 +1144,8 @@ func (s *Store) Provide(path string) error {
return nil
}
// LoadFromReader loads SQLite data, as read from r, into the database, sending the
// request through the Raft log.
// LoadFromReader reads data from r chunk-by-chunk, and loads it into the
// database.
func (s *Store) LoadFromReader(r io.Reader) error {
if !s.open {
return ErrNotOpen
@ -1154,14 +1155,44 @@ func (s *Store) LoadFromReader(r io.Reader) error {
return ErrNotReady
}
b, err := io.ReadAll(r)
if err != nil {
return err
}
lr := &command.LoadRequest{
Data: b,
chunker := chunking.NewChunker(r, 1024*1024)
for {
chunk, err := chunker.Next()
if err != nil {
return err
}
b, err := command.MarshalLoadChunkRequest(chunk)
if err != nil {
return err
}
c := &command.Command{
Type: command.Command_COMMAND_TYPE_LOAD_CHUNK,
SubCommand: b,
}
b, err = command.Marshal(c)
if err != nil {
return err
}
af := s.raft.Apply(b, s.ApplyTimeout)
if af.Error() != nil {
if af.Error() == raft.ErrNotLeader {
return ErrNotLeader
}
return af.Error()
}
s.dbAppliedIndexMu.Lock()
s.dbAppliedIndex = af.Index()
s.dbAppliedIndexMu.Unlock()
if chunk.IsLast {
break
}
}
return s.load(lr)
return nil
}
// Loads an entire SQLite file into the database, sending the request
@ -1949,6 +1980,13 @@ func applyCommand(data []byte, pDB **sql.DB) (command.Command_Type, interface{})
return c.Type, &fsmGenericResponse{error: fmt.Errorf("failed to close post-load database: %s", err)}
}
*pDB = newDB
return c.Type, &fsmGenericResponse{}
case command.Command_COMMAND_TYPE_LOAD_CHUNK:
var lr command.LoadChunkRequest
if err := command.UnmarshalLoadChunkRequest(c.SubCommand, &lr); err != nil {
panic(fmt.Sprintf("failed to unmarshal load-chunk subcommand: %s", err.Error()))
}
return c.Type, &fsmGenericResponse{}
case command.Command_COMMAND_TYPE_NOOP:
return c.Type, &fsmGenericResponse{}

Loading…
Cancel
Save