From 623bdc1e91ca7a736f7d1ad9f35f8211ac02f7ff Mon Sep 17 00:00:00 2001 From: Anton Kolesnikov Date: Thu, 14 Nov 2024 21:35:01 +0800 Subject: [PATCH 01/37] chore(v2): refactor compaction --- .mockery.yaml | 6 + api/gen/proto/go/metastore/v1/compactor.pb.go | 638 +++-- .../go/metastore/v1/compactor_vtproto.pb.go | 1298 +++++---- api/gen/proto/go/metastore/v1/metastore.pb.go | 379 ++- .../go/metastore/v1/metastore_vtproto.pb.go | 703 ++++- .../metastorev1connect/metastore.connect.go | 36 +- .../metastore.connect.mux.go | 5 + .../go/metastore/v1/raft_log/raft_log.pb.go | 886 +++++- .../v1/raft_log/raft_log_vtproto.pb.go | 2541 ++++++++++++++++- api/metastore/v1/compactor.proto | 96 +- api/metastore/v1/metastore.proto | 15 + api/metastore/v1/raft_log/raft_log.proto | 81 +- api/openapiv2/gen/phlare.swagger.json | 193 +- cmd/profilecli/main.go | 2 +- .../index.md | 2278 --------------- .../ingester/singlereplica/singlereplica.go | 25 - .../metastore/cleaner_raft_handler.go | 116 - pkg/experiment/metastore/cleaner_service.go | 93 - pkg/experiment/metastore/client/methods.go | 6 + .../metastore/client/server_mock_test.go | 4 + pkg/experiment/metastore/compaction/README.md | 291 ++ .../metastore/compaction/compaction.go | 69 + .../compaction/compactor/compaction_queue.go | 349 +++ .../compactor/compaction_queue_bench_test.go | 58 + .../compactor/compaction_queue_test.go | 230 ++ .../compaction/compactor/compactor.go | 124 + .../compactor/compactor_strategy.go | 53 + .../compaction/compactor/compactor_test.go | 119 + .../metastore/compaction/compactor/plan.go | 143 + .../compaction/compactor/plan_test.go | 265 ++ .../compactor/store/block_queue_store.go | 119 + .../compactor/store/block_queue_store_test.go | 103 + .../compaction/scheduler/schedule.go | 201 ++ .../compaction/scheduler/schedule_test.go | 361 +++ .../compaction/scheduler/scheduler.go | 123 + .../compaction/scheduler/scheduler_queue.go | 104 + .../scheduler/scheduler_queue_test.go | 151 + .../compaction/scheduler/scheduler_test.go | 91 + .../compaction/scheduler/store/job_store.go | 132 + .../scheduler/store/job_store_test.go | 84 + .../metastore/compaction_planner.go | 122 - pkg/experiment/metastore/compaction_queue.go | 225 -- .../metastore/compaction_queue_test.go | 71 - .../metastore/compaction_raft_handler.go | 770 +---- .../metastore/compaction_service.go | 100 +- .../metastore/compactionpb/compaction.pb.go | 430 --- .../metastore/compactionpb/compaction.proto | 51 - .../compactionpb/compaction_vtproto.pb.go | 690 ----- pkg/experiment/metastore/dlq/recovery.go | 4 +- pkg/experiment/metastore/index/index.go | 49 +- pkg/experiment/metastore/index/index_test.go | 23 +- pkg/experiment/metastore/index/store.go | 17 +- .../metastore/index_raft_handler.go | 77 +- pkg/experiment/metastore/index_service.go | 46 +- .../metastore/markers/deletion_markers.go | 245 -- .../markers/deletion_markers_test.go | 39 - pkg/experiment/metastore/metastore.go | 66 +- .../metastore/metastore_raft_commands.go | 20 +- pkg/experiment/metastore/store/store.go | 61 + .../metastore/storeutils/storeutils.go | 22 - .../tombstones/store/tombstone_store.go | 38 + .../metastore/tombstones/tombstone_queue.go | 75 + .../metastore/tombstones/tombstones.go | 171 ++ pkg/test/idempotence.go | 34 + .../mockcompactor/mock_block_queue_store.go | 183 ++ .../mocks/mockcompactor/mock_job_store.go | 335 +++ .../mocks/mockcompactor/mock_tombstones.go | 86 + .../mock_index_service_client.go | 74 + .../mock_index_service_server.go | 59 + 69 files changed, 10380 insertions(+), 6374 deletions(-) delete mode 100644 pkg/experiment/ingester/singlereplica/singlereplica.go delete mode 100644 pkg/experiment/metastore/cleaner_raft_handler.go delete mode 100644 pkg/experiment/metastore/cleaner_service.go create mode 100644 pkg/experiment/metastore/compaction/README.md create mode 100644 pkg/experiment/metastore/compaction/compaction.go create mode 100644 pkg/experiment/metastore/compaction/compactor/compaction_queue.go create mode 100644 pkg/experiment/metastore/compaction/compactor/compaction_queue_bench_test.go create mode 100644 pkg/experiment/metastore/compaction/compactor/compaction_queue_test.go create mode 100644 pkg/experiment/metastore/compaction/compactor/compactor.go create mode 100644 pkg/experiment/metastore/compaction/compactor/compactor_strategy.go create mode 100644 pkg/experiment/metastore/compaction/compactor/compactor_test.go create mode 100644 pkg/experiment/metastore/compaction/compactor/plan.go create mode 100644 pkg/experiment/metastore/compaction/compactor/plan_test.go create mode 100644 pkg/experiment/metastore/compaction/compactor/store/block_queue_store.go create mode 100644 pkg/experiment/metastore/compaction/compactor/store/block_queue_store_test.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/schedule.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/schedule_test.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/scheduler.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/scheduler_queue.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/scheduler_queue_test.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/scheduler_test.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/store/job_store.go create mode 100644 pkg/experiment/metastore/compaction/scheduler/store/job_store_test.go delete mode 100644 pkg/experiment/metastore/compaction_planner.go delete mode 100644 pkg/experiment/metastore/compaction_queue.go delete mode 100644 pkg/experiment/metastore/compaction_queue_test.go delete mode 100644 pkg/experiment/metastore/compactionpb/compaction.pb.go delete mode 100644 pkg/experiment/metastore/compactionpb/compaction.proto delete mode 100644 pkg/experiment/metastore/compactionpb/compaction_vtproto.pb.go delete mode 100644 pkg/experiment/metastore/markers/deletion_markers.go delete mode 100644 pkg/experiment/metastore/markers/deletion_markers_test.go create mode 100644 pkg/experiment/metastore/store/store.go delete mode 100644 pkg/experiment/metastore/storeutils/storeutils.go create mode 100644 pkg/experiment/metastore/tombstones/store/tombstone_store.go create mode 100644 pkg/experiment/metastore/tombstones/tombstone_queue.go create mode 100644 pkg/experiment/metastore/tombstones/tombstones.go create mode 100644 pkg/test/idempotence.go create mode 100644 pkg/test/mocks/mockcompactor/mock_block_queue_store.go create mode 100644 pkg/test/mocks/mockcompactor/mock_job_store.go create mode 100644 pkg/test/mocks/mockcompactor/mock_tombstones.go diff --git a/.mockery.yaml b/.mockery.yaml index 6b8a558ff4..56df6058a9 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -42,3 +42,9 @@ packages: interfaces: SegmentWriterClient: IngesterClient: + + github.com/grafana/pyroscope/pkg/experiment/metastore/compaction/compactor: + interfaces: + BlockQueueStore: + Tombstones: + JobStore: diff --git a/api/gen/proto/go/metastore/v1/compactor.pb.go b/api/gen/proto/go/metastore/v1/compactor.pb.go index 43b66c8348..4427a418ce 100644 --- a/api/gen/proto/go/metastore/v1/compactor.pb.go +++ b/api/gen/proto/go/metastore/v1/compactor.pb.go @@ -20,58 +20,52 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type CompactionStatus int32 +type CompactionJobStatus int32 const ( - CompactionStatus_COMPACTION_STATUS_UNSPECIFIED CompactionStatus = 0 - CompactionStatus_COMPACTION_STATUS_IN_PROGRESS CompactionStatus = 1 - CompactionStatus_COMPACTION_STATUS_SUCCESS CompactionStatus = 2 - CompactionStatus_COMPACTION_STATUS_FAILURE CompactionStatus = 3 - CompactionStatus_COMPACTION_STATUS_CANCELLED CompactionStatus = 4 + CompactionJobStatus_COMPACTION_STATUS_UNSPECIFIED CompactionJobStatus = 0 + CompactionJobStatus_COMPACTION_STATUS_IN_PROGRESS CompactionJobStatus = 1 + CompactionJobStatus_COMPACTION_STATUS_SUCCESS CompactionJobStatus = 2 ) -// Enum value maps for CompactionStatus. +// Enum value maps for CompactionJobStatus. var ( - CompactionStatus_name = map[int32]string{ + CompactionJobStatus_name = map[int32]string{ 0: "COMPACTION_STATUS_UNSPECIFIED", 1: "COMPACTION_STATUS_IN_PROGRESS", 2: "COMPACTION_STATUS_SUCCESS", - 3: "COMPACTION_STATUS_FAILURE", - 4: "COMPACTION_STATUS_CANCELLED", } - CompactionStatus_value = map[string]int32{ + CompactionJobStatus_value = map[string]int32{ "COMPACTION_STATUS_UNSPECIFIED": 0, "COMPACTION_STATUS_IN_PROGRESS": 1, "COMPACTION_STATUS_SUCCESS": 2, - "COMPACTION_STATUS_FAILURE": 3, - "COMPACTION_STATUS_CANCELLED": 4, } ) -func (x CompactionStatus) Enum() *CompactionStatus { - p := new(CompactionStatus) +func (x CompactionJobStatus) Enum() *CompactionJobStatus { + p := new(CompactionJobStatus) *p = x return p } -func (x CompactionStatus) String() string { +func (x CompactionJobStatus) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (CompactionStatus) Descriptor() protoreflect.EnumDescriptor { +func (CompactionJobStatus) Descriptor() protoreflect.EnumDescriptor { return file_metastore_v1_compactor_proto_enumTypes[0].Descriptor() } -func (CompactionStatus) Type() protoreflect.EnumType { +func (CompactionJobStatus) Type() protoreflect.EnumType { return &file_metastore_v1_compactor_proto_enumTypes[0] } -func (x CompactionStatus) Number() protoreflect.EnumNumber { +func (x CompactionJobStatus) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use CompactionStatus.Descriptor instead. -func (CompactionStatus) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use CompactionJobStatus.Descriptor instead. +func (CompactionJobStatus) EnumDescriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{0} } @@ -81,7 +75,7 @@ type PollCompactionJobsRequest struct { unknownFields protoimpl.UnknownFields // A batch of status updates for in-progress jobs from a worker. - JobStatusUpdates []*CompactionJobStatus `protobuf:"bytes,1,rep,name=job_status_updates,json=jobStatusUpdates,proto3" json:"job_status_updates,omitempty"` + StatusUpdates []*CompactionJobStatusUpdate `protobuf:"bytes,1,rep,name=status_updates,json=statusUpdates,proto3" json:"status_updates,omitempty"` // How many new jobs a worker can be assigned to. JobCapacity uint32 `protobuf:"varint,2,opt,name=job_capacity,json=jobCapacity,proto3" json:"job_capacity,omitempty"` } @@ -118,9 +112,9 @@ func (*PollCompactionJobsRequest) Descriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{0} } -func (x *PollCompactionJobsRequest) GetJobStatusUpdates() []*CompactionJobStatus { +func (x *PollCompactionJobsRequest) GetStatusUpdates() []*CompactionJobStatusUpdate { if x != nil { - return x.JobStatusUpdates + return x.StatusUpdates } return nil } @@ -137,7 +131,8 @@ type PollCompactionJobsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CompactionJobs []*CompactionJob `protobuf:"bytes,1,rep,name=compaction_jobs,json=compactionJobs,proto3" json:"compaction_jobs,omitempty"` + CompactionJobs []*CompactionJob `protobuf:"bytes,1,rep,name=compaction_jobs,json=compactionJobs,proto3" json:"compaction_jobs,omitempty"` + Assignments []*CompactionJobAssignment `protobuf:"bytes,2,rep,name=assignments,proto3" json:"assignments,omitempty"` } func (x *PollCompactionJobsResponse) Reset() { @@ -179,14 +174,28 @@ func (x *PollCompactionJobsResponse) GetCompactionJobs() []*CompactionJob { return nil } -type GetCompactionRequest struct { +func (x *PollCompactionJobsResponse) GetAssignments() []*CompactionJobAssignment { + if x != nil { + return x.Assignments + } + return nil +} + +type CompactionJob struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Shard uint32 `protobuf:"varint,2,opt,name=shard,proto3" json:"shard,omitempty"` + Tenant string `protobuf:"bytes,3,opt,name=tenant,proto3" json:"tenant,omitempty"` + CompactionLevel uint32 `protobuf:"varint,4,opt,name=compaction_level,json=compactionLevel,proto3" json:"compaction_level,omitempty"` + SourceBlocks []string `protobuf:"bytes,5,rep,name=source_blocks,json=sourceBlocks,proto3" json:"source_blocks,omitempty"` + Tombstones []*Tombstones `protobuf:"bytes,6,rep,name=tombstones,proto3" json:"tombstones,omitempty"` } -func (x *GetCompactionRequest) Reset() { - *x = GetCompactionRequest{} +func (x *CompactionJob) Reset() { + *x = CompactionJob{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_compactor_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -194,13 +203,13 @@ func (x *GetCompactionRequest) Reset() { } } -func (x *GetCompactionRequest) String() string { +func (x *CompactionJob) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetCompactionRequest) ProtoMessage() {} +func (*CompactionJob) ProtoMessage() {} -func (x *GetCompactionRequest) ProtoReflect() protoreflect.Message { +func (x *CompactionJob) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_compactor_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -212,22 +221,64 @@ func (x *GetCompactionRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetCompactionRequest.ProtoReflect.Descriptor instead. -func (*GetCompactionRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CompactionJob.ProtoReflect.Descriptor instead. +func (*CompactionJob) Descriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{2} } -type GetCompactionResponse struct { +func (x *CompactionJob) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CompactionJob) GetShard() uint32 { + if x != nil { + return x.Shard + } + return 0 +} + +func (x *CompactionJob) GetTenant() string { + if x != nil { + return x.Tenant + } + return "" +} + +func (x *CompactionJob) GetCompactionLevel() uint32 { + if x != nil { + return x.CompactionLevel + } + return 0 +} + +func (x *CompactionJob) GetSourceBlocks() []string { + if x != nil { + return x.SourceBlocks + } + return nil +} + +func (x *CompactionJob) GetTombstones() []*Tombstones { + if x != nil { + return x.Tombstones + } + return nil +} + +// Tombstones represent objects removed from the index but still stored. +type Tombstones struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // A list of all compaction jobs - CompactionJobs []*CompactionJob `protobuf:"bytes,1,rep,name=compaction_jobs,json=compactionJobs,proto3" json:"compaction_jobs,omitempty"` + Blocks *BlockTombstones `protobuf:"bytes,1,opt,name=blocks,proto3" json:"blocks,omitempty"` } -func (x *GetCompactionResponse) Reset() { - *x = GetCompactionResponse{} +func (x *Tombstones) Reset() { + *x = Tombstones{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_compactor_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -235,13 +286,13 @@ func (x *GetCompactionResponse) Reset() { } } -func (x *GetCompactionResponse) String() string { +func (x *Tombstones) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetCompactionResponse) ProtoMessage() {} +func (*Tombstones) ProtoMessage() {} -func (x *GetCompactionResponse) ProtoReflect() protoreflect.Message { +func (x *Tombstones) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_compactor_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -253,41 +304,32 @@ func (x *GetCompactionResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetCompactionResponse.ProtoReflect.Descriptor instead. -func (*GetCompactionResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use Tombstones.ProtoReflect.Descriptor instead. +func (*Tombstones) Descriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{3} } -func (x *GetCompactionResponse) GetCompactionJobs() []*CompactionJob { +func (x *Tombstones) GetBlocks() *BlockTombstones { if x != nil { - return x.CompactionJobs + return x.Blocks } return nil } -// One compaction job may result in multiple output blocks. -type CompactionJob struct { +type BlockTombstones struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Unique name of the job. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Options *CompactionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - // List of the input blocks. - Blocks []*BlockMeta `protobuf:"bytes,3,rep,name=blocks,proto3" json:"blocks,omitempty"` - Status *CompactionJobStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - // Fencing token. - RaftLogIndex uint64 `protobuf:"varint,5,opt,name=raft_log_index,json=raftLogIndex,proto3" json:"raft_log_index,omitempty"` - // Shard the blocks belong to. - Shard uint32 `protobuf:"varint,6,opt,name=shard,proto3" json:"shard,omitempty"` - // Optional, empty for compaction level 0. - TenantId string `protobuf:"bytes,7,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - CompactionLevel uint32 `protobuf:"varint,8,opt,name=compaction_level,json=compactionLevel,proto3" json:"compaction_level,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Shard uint32 `protobuf:"varint,2,opt,name=shard,proto3" json:"shard,omitempty"` + Tenant string `protobuf:"bytes,3,opt,name=tenant,proto3" json:"tenant,omitempty"` + CompactionLevel uint32 `protobuf:"varint,4,opt,name=compaction_level,json=compactionLevel,proto3" json:"compaction_level,omitempty"` + Blocks []string `protobuf:"bytes,5,rep,name=blocks,proto3" json:"blocks,omitempty"` } -func (x *CompactionJob) Reset() { - *x = CompactionJob{} +func (x *BlockTombstones) Reset() { + *x = BlockTombstones{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_compactor_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -295,13 +337,13 @@ func (x *CompactionJob) Reset() { } } -func (x *CompactionJob) String() string { +func (x *BlockTombstones) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CompactionJob) ProtoMessage() {} +func (*BlockTombstones) ProtoMessage() {} -func (x *CompactionJob) ProtoReflect() protoreflect.Message { +func (x *BlockTombstones) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_compactor_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -313,80 +355,59 @@ func (x *CompactionJob) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CompactionJob.ProtoReflect.Descriptor instead. -func (*CompactionJob) Descriptor() ([]byte, []int) { +// Deprecated: Use BlockTombstones.ProtoReflect.Descriptor instead. +func (*BlockTombstones) Descriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{4} } -func (x *CompactionJob) GetName() string { +func (x *BlockTombstones) GetName() string { if x != nil { return x.Name } return "" } -func (x *CompactionJob) GetOptions() *CompactionOptions { - if x != nil { - return x.Options - } - return nil -} - -func (x *CompactionJob) GetBlocks() []*BlockMeta { - if x != nil { - return x.Blocks - } - return nil -} - -func (x *CompactionJob) GetStatus() *CompactionJobStatus { - if x != nil { - return x.Status - } - return nil -} - -func (x *CompactionJob) GetRaftLogIndex() uint64 { - if x != nil { - return x.RaftLogIndex - } - return 0 -} - -func (x *CompactionJob) GetShard() uint32 { +func (x *BlockTombstones) GetShard() uint32 { if x != nil { return x.Shard } return 0 } -func (x *CompactionJob) GetTenantId() string { +func (x *BlockTombstones) GetTenant() string { if x != nil { - return x.TenantId + return x.Tenant } return "" } -func (x *CompactionJob) GetCompactionLevel() uint32 { +func (x *BlockTombstones) GetCompactionLevel() uint32 { if x != nil { return x.CompactionLevel } return 0 } -type CompactionOptions struct { +func (x *BlockTombstones) GetBlocks() []string { + if x != nil { + return x.Blocks + } + return nil +} + +type CompactionJobAssignment struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // How often the compaction worker should update - // the job status. If overdue, the job ownership - // is revoked. - StatusUpdateIntervalSeconds uint64 `protobuf:"varint,1,opt,name=status_update_interval_seconds,json=statusUpdateIntervalSeconds,proto3" json:"status_update_interval_seconds,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Token uint64 `protobuf:"varint,2,opt,name=token,proto3" json:"token,omitempty"` + LeaseExpiresAt int64 `protobuf:"varint,3,opt,name=lease_expires_at,json=leaseExpiresAt,proto3" json:"lease_expires_at,omitempty"` + Status CompactionJobStatus `protobuf:"varint,4,opt,name=status,proto3,enum=metastore.v1.CompactionJobStatus" json:"status,omitempty"` } -func (x *CompactionOptions) Reset() { - *x = CompactionOptions{} +func (x *CompactionJobAssignment) Reset() { + *x = CompactionJobAssignment{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_compactor_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -394,13 +415,13 @@ func (x *CompactionOptions) Reset() { } } -func (x *CompactionOptions) String() string { +func (x *CompactionJobAssignment) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CompactionOptions) ProtoMessage() {} +func (*CompactionJobAssignment) ProtoMessage() {} -func (x *CompactionOptions) ProtoReflect() protoreflect.Message { +func (x *CompactionJobAssignment) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_compactor_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -412,49 +433,53 @@ func (x *CompactionOptions) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CompactionOptions.ProtoReflect.Descriptor instead. -func (*CompactionOptions) Descriptor() ([]byte, []int) { +// Deprecated: Use CompactionJobAssignment.ProtoReflect.Descriptor instead. +func (*CompactionJobAssignment) Descriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{5} } -func (x *CompactionOptions) GetStatusUpdateIntervalSeconds() uint64 { +func (x *CompactionJobAssignment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CompactionJobAssignment) GetToken() uint64 { + if x != nil { + return x.Token + } + return 0 +} + +func (x *CompactionJobAssignment) GetLeaseExpiresAt() int64 { if x != nil { - return x.StatusUpdateIntervalSeconds + return x.LeaseExpiresAt } return 0 } -type CompactionJobStatus struct { +func (x *CompactionJobAssignment) GetStatus() CompactionJobStatus { + if x != nil { + return x.Status + } + return CompactionJobStatus_COMPACTION_STATUS_UNSPECIFIED +} + +type CompactionJobStatusUpdate struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - JobName string `protobuf:"bytes,1,opt,name=job_name,json=jobName,proto3" json:"job_name,omitempty"` - // Status update allows the planner to keep - // track of the job ownership and compaction - // progress: - // - If the job status is other than IN_PROGRESS, - // the ownership of the job is revoked. - // - FAILURE must only be sent if the failure is - // persistent and the compaction can't be accomplished. - // - completed_job must be empty if the status is - // other than SUCCESS, and vice-versa. - // - UNSPECIFIED must be sent if the worker rejects - // or cancels the compaction job. - // - // Partial results/status is not allowed. - Status CompactionStatus `protobuf:"varint,2,opt,name=status,proto3,enum=metastore.v1.CompactionStatus" json:"status,omitempty"` - CompletedJob *CompletedJob `protobuf:"bytes,3,opt,name=completed_job,json=completedJob,proto3" json:"completed_job,omitempty"` - // Fencing token. - RaftLogIndex uint64 `protobuf:"varint,4,opt,name=raft_log_index,json=raftLogIndex,proto3" json:"raft_log_index,omitempty"` - // Shard the blocks belong to. - Shard uint32 `protobuf:"varint,5,opt,name=shard,proto3" json:"shard,omitempty"` - // Optional, empty for compaction level 0. - TenantId string `protobuf:"bytes,6,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` -} - -func (x *CompactionJobStatus) Reset() { - *x = CompactionJobStatus{} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Token uint64 `protobuf:"varint,2,opt,name=token,proto3" json:"token,omitempty"` + Status CompactionJobStatus `protobuf:"varint,3,opt,name=status,proto3,enum=metastore.v1.CompactionJobStatus" json:"status,omitempty"` + // Only present if the job completed successfully. + CompactedBlocks *CompactedBlocks `protobuf:"bytes,4,opt,name=compacted_blocks,json=compactedBlocks,proto3" json:"compacted_blocks,omitempty"` +} + +func (x *CompactionJobStatusUpdate) Reset() { + *x = CompactionJobStatusUpdate{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_compactor_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -462,13 +487,13 @@ func (x *CompactionJobStatus) Reset() { } } -func (x *CompactionJobStatus) String() string { +func (x *CompactionJobStatusUpdate) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CompactionJobStatus) ProtoMessage() {} +func (*CompactionJobStatusUpdate) ProtoMessage() {} -func (x *CompactionJobStatus) ProtoReflect() protoreflect.Message { +func (x *CompactionJobStatusUpdate) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_compactor_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -480,63 +505,50 @@ func (x *CompactionJobStatus) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CompactionJobStatus.ProtoReflect.Descriptor instead. -func (*CompactionJobStatus) Descriptor() ([]byte, []int) { +// Deprecated: Use CompactionJobStatusUpdate.ProtoReflect.Descriptor instead. +func (*CompactionJobStatusUpdate) Descriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{6} } -func (x *CompactionJobStatus) GetJobName() string { +func (x *CompactionJobStatusUpdate) GetName() string { if x != nil { - return x.JobName + return x.Name } return "" } -func (x *CompactionJobStatus) GetStatus() CompactionStatus { - if x != nil { - return x.Status - } - return CompactionStatus_COMPACTION_STATUS_UNSPECIFIED -} - -func (x *CompactionJobStatus) GetCompletedJob() *CompletedJob { +func (x *CompactionJobStatusUpdate) GetToken() uint64 { if x != nil { - return x.CompletedJob - } - return nil -} - -func (x *CompactionJobStatus) GetRaftLogIndex() uint64 { - if x != nil { - return x.RaftLogIndex + return x.Token } return 0 } -func (x *CompactionJobStatus) GetShard() uint32 { +func (x *CompactionJobStatusUpdate) GetStatus() CompactionJobStatus { if x != nil { - return x.Shard + return x.Status } - return 0 + return CompactionJobStatus_COMPACTION_STATUS_UNSPECIFIED } -func (x *CompactionJobStatus) GetTenantId() string { +func (x *CompactionJobStatusUpdate) GetCompactedBlocks() *CompactedBlocks { if x != nil { - return x.TenantId + return x.CompactedBlocks } - return "" + return nil } -type CompletedJob struct { +type CompactedBlocks struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Blocks []*BlockMeta `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` + SourceBlocks *BlockList `protobuf:"bytes,1,opt,name=source_blocks,json=sourceBlocks,proto3" json:"source_blocks,omitempty"` + CompactedBlocks []*BlockMeta `protobuf:"bytes,2,rep,name=compacted_blocks,json=compactedBlocks,proto3" json:"compacted_blocks,omitempty"` } -func (x *CompletedJob) Reset() { - *x = CompletedJob{} +func (x *CompactedBlocks) Reset() { + *x = CompactedBlocks{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_compactor_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -544,13 +556,13 @@ func (x *CompletedJob) Reset() { } } -func (x *CompletedJob) String() string { +func (x *CompactedBlocks) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CompletedJob) ProtoMessage() {} +func (*CompactedBlocks) ProtoMessage() {} -func (x *CompletedJob) ProtoReflect() protoreflect.Message { +func (x *CompactedBlocks) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_compactor_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -562,14 +574,21 @@ func (x *CompletedJob) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CompletedJob.ProtoReflect.Descriptor instead. -func (*CompletedJob) Descriptor() ([]byte, []int) { +// Deprecated: Use CompactedBlocks.ProtoReflect.Descriptor instead. +func (*CompactedBlocks) Descriptor() ([]byte, []int) { return file_metastore_v1_compactor_proto_rawDescGZIP(), []int{7} } -func (x *CompletedJob) GetBlocks() []*BlockMeta { +func (x *CompactedBlocks) GetSourceBlocks() *BlockList { if x != nil { - return x.Blocks + return x.SourceBlocks + } + return nil +} + +func (x *CompactedBlocks) GetCompactedBlocks() []*BlockMeta { + if x != nil { + return x.CompactedBlocks } return nil } @@ -581,109 +600,116 @@ var file_metastore_v1_compactor_proto_rawDesc = []byte{ 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x01, 0x0a, 0x19, 0x50, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x19, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x12, 0x6a, 0x6f, 0x62, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, - 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x6a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6a, 0x6f, 0x62, - 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0b, 0x6a, 0x6f, 0x62, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x62, 0x0a, 0x1a, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6a, 0x6f, 0x62, 0x5f, + 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, + 0x6a, 0x6f, 0x62, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0xab, 0x01, 0x0a, 0x1a, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, - 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x74, - 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x22, 0xce, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x65, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, 0x61, - 0x66, 0x74, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, - 0x61, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, - 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x29, 0x0a, + 0x12, 0x47, 0x0a, 0x0b, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, + 0x6f, 0x62, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x73, + 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xdb, 0x01, 0x0a, 0x0d, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x58, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x43, 0x0a, - 0x1e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x6f, 0x6e, - 0x64, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, - 0x62, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x6f, - 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3f, 0x0a, - 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, - 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x12, 0x24, - 0x0a, 0x0e, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, 0x61, 0x66, 0x74, 0x4c, 0x6f, 0x67, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, - 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, - 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, - 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2a, 0xb7, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6d, - 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x38, 0x0a, + 0x0a, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x52, 0x0a, 0x74, 0x6f, 0x6d, + 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x0a, 0x54, 0x6f, 0x6d, 0x62, 0x73, + 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, + 0x6f, 0x6e, 0x65, 0x73, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x96, 0x01, 0x0a, + 0x0f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, + 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0xa8, 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x45, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, + 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x22, 0xca, 0x01, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, + 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x0f, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x93, 0x01, + 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, + 0x42, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, + 0x74, 0x61, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x2a, 0x7a, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, + 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, - 0x53, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, - 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, - 0x03, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, - 0x10, 0x04, 0x32, 0x7e, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x12, 0x50, 0x6f, 0x6c, 0x6c, 0x43, - 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x27, 0x2e, - 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, - 0x6c, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0xbb, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, - 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x01, + 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x02, 0x32, + 0x7e, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x12, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0xbb, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, + 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -701,34 +727,36 @@ func file_metastore_v1_compactor_proto_rawDescGZIP() []byte { var file_metastore_v1_compactor_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_metastore_v1_compactor_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_metastore_v1_compactor_proto_goTypes = []any{ - (CompactionStatus)(0), // 0: metastore.v1.CompactionStatus + (CompactionJobStatus)(0), // 0: metastore.v1.CompactionJobStatus (*PollCompactionJobsRequest)(nil), // 1: metastore.v1.PollCompactionJobsRequest (*PollCompactionJobsResponse)(nil), // 2: metastore.v1.PollCompactionJobsResponse - (*GetCompactionRequest)(nil), // 3: metastore.v1.GetCompactionRequest - (*GetCompactionResponse)(nil), // 4: metastore.v1.GetCompactionResponse - (*CompactionJob)(nil), // 5: metastore.v1.CompactionJob - (*CompactionOptions)(nil), // 6: metastore.v1.CompactionOptions - (*CompactionJobStatus)(nil), // 7: metastore.v1.CompactionJobStatus - (*CompletedJob)(nil), // 8: metastore.v1.CompletedJob - (*BlockMeta)(nil), // 9: metastore.v1.BlockMeta + (*CompactionJob)(nil), // 3: metastore.v1.CompactionJob + (*Tombstones)(nil), // 4: metastore.v1.Tombstones + (*BlockTombstones)(nil), // 5: metastore.v1.BlockTombstones + (*CompactionJobAssignment)(nil), // 6: metastore.v1.CompactionJobAssignment + (*CompactionJobStatusUpdate)(nil), // 7: metastore.v1.CompactionJobStatusUpdate + (*CompactedBlocks)(nil), // 8: metastore.v1.CompactedBlocks + (*BlockList)(nil), // 9: metastore.v1.BlockList + (*BlockMeta)(nil), // 10: metastore.v1.BlockMeta } var file_metastore_v1_compactor_proto_depIdxs = []int32{ - 7, // 0: metastore.v1.PollCompactionJobsRequest.job_status_updates:type_name -> metastore.v1.CompactionJobStatus - 5, // 1: metastore.v1.PollCompactionJobsResponse.compaction_jobs:type_name -> metastore.v1.CompactionJob - 5, // 2: metastore.v1.GetCompactionResponse.compaction_jobs:type_name -> metastore.v1.CompactionJob - 6, // 3: metastore.v1.CompactionJob.options:type_name -> metastore.v1.CompactionOptions - 9, // 4: metastore.v1.CompactionJob.blocks:type_name -> metastore.v1.BlockMeta - 7, // 5: metastore.v1.CompactionJob.status:type_name -> metastore.v1.CompactionJobStatus - 0, // 6: metastore.v1.CompactionJobStatus.status:type_name -> metastore.v1.CompactionStatus - 8, // 7: metastore.v1.CompactionJobStatus.completed_job:type_name -> metastore.v1.CompletedJob - 9, // 8: metastore.v1.CompletedJob.blocks:type_name -> metastore.v1.BlockMeta - 1, // 9: metastore.v1.CompactionService.PollCompactionJobs:input_type -> metastore.v1.PollCompactionJobsRequest - 2, // 10: metastore.v1.CompactionService.PollCompactionJobs:output_type -> metastore.v1.PollCompactionJobsResponse - 10, // [10:11] is the sub-list for method output_type - 9, // [9:10] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 7, // 0: metastore.v1.PollCompactionJobsRequest.status_updates:type_name -> metastore.v1.CompactionJobStatusUpdate + 3, // 1: metastore.v1.PollCompactionJobsResponse.compaction_jobs:type_name -> metastore.v1.CompactionJob + 6, // 2: metastore.v1.PollCompactionJobsResponse.assignments:type_name -> metastore.v1.CompactionJobAssignment + 4, // 3: metastore.v1.CompactionJob.tombstones:type_name -> metastore.v1.Tombstones + 5, // 4: metastore.v1.Tombstones.blocks:type_name -> metastore.v1.BlockTombstones + 0, // 5: metastore.v1.CompactionJobAssignment.status:type_name -> metastore.v1.CompactionJobStatus + 0, // 6: metastore.v1.CompactionJobStatusUpdate.status:type_name -> metastore.v1.CompactionJobStatus + 8, // 7: metastore.v1.CompactionJobStatusUpdate.compacted_blocks:type_name -> metastore.v1.CompactedBlocks + 9, // 8: metastore.v1.CompactedBlocks.source_blocks:type_name -> metastore.v1.BlockList + 10, // 9: metastore.v1.CompactedBlocks.compacted_blocks:type_name -> metastore.v1.BlockMeta + 1, // 10: metastore.v1.CompactionService.PollCompactionJobs:input_type -> metastore.v1.PollCompactionJobsRequest + 2, // 11: metastore.v1.CompactionService.PollCompactionJobs:output_type -> metastore.v1.PollCompactionJobsResponse + 11, // [11:12] is the sub-list for method output_type + 10, // [10:11] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_metastore_v1_compactor_proto_init() } @@ -763,7 +791,7 @@ func file_metastore_v1_compactor_proto_init() { } } file_metastore_v1_compactor_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetCompactionRequest); i { + switch v := v.(*CompactionJob); i { case 0: return &v.state case 1: @@ -775,7 +803,7 @@ func file_metastore_v1_compactor_proto_init() { } } file_metastore_v1_compactor_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetCompactionResponse); i { + switch v := v.(*Tombstones); i { case 0: return &v.state case 1: @@ -787,7 +815,7 @@ func file_metastore_v1_compactor_proto_init() { } } file_metastore_v1_compactor_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*CompactionJob); i { + switch v := v.(*BlockTombstones); i { case 0: return &v.state case 1: @@ -799,7 +827,7 @@ func file_metastore_v1_compactor_proto_init() { } } file_metastore_v1_compactor_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*CompactionOptions); i { + switch v := v.(*CompactionJobAssignment); i { case 0: return &v.state case 1: @@ -811,7 +839,7 @@ func file_metastore_v1_compactor_proto_init() { } } file_metastore_v1_compactor_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*CompactionJobStatus); i { + switch v := v.(*CompactionJobStatusUpdate); i { case 0: return &v.state case 1: @@ -823,7 +851,7 @@ func file_metastore_v1_compactor_proto_init() { } } file_metastore_v1_compactor_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*CompletedJob); i { + switch v := v.(*CompactedBlocks); i { case 0: return &v.state case 1: diff --git a/api/gen/proto/go/metastore/v1/compactor_vtproto.pb.go b/api/gen/proto/go/metastore/v1/compactor_vtproto.pb.go index dcacf95790..1171af0bd7 100644 --- a/api/gen/proto/go/metastore/v1/compactor_vtproto.pb.go +++ b/api/gen/proto/go/metastore/v1/compactor_vtproto.pb.go @@ -29,12 +29,12 @@ func (m *PollCompactionJobsRequest) CloneVT() *PollCompactionJobsRequest { } r := new(PollCompactionJobsRequest) r.JobCapacity = m.JobCapacity - if rhs := m.JobStatusUpdates; rhs != nil { - tmpContainer := make([]*CompactionJobStatus, len(rhs)) + if rhs := m.StatusUpdates; rhs != nil { + tmpContainer := make([]*CompactionJobStatusUpdate, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } - r.JobStatusUpdates = tmpContainer + r.StatusUpdates = tmpContainer } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -59,6 +59,13 @@ func (m *PollCompactionJobsResponse) CloneVT() *PollCompactionJobsResponse { } r.CompactionJobs = tmpContainer } + if rhs := m.Assignments; rhs != nil { + tmpContainer := make([]*CompactionJobAssignment, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Assignments = tmpContainer + } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -70,11 +77,27 @@ func (m *PollCompactionJobsResponse) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *GetCompactionRequest) CloneVT() *GetCompactionRequest { +func (m *CompactionJob) CloneVT() *CompactionJob { if m == nil { - return (*GetCompactionRequest)(nil) + return (*CompactionJob)(nil) + } + r := new(CompactionJob) + r.Name = m.Name + r.Shard = m.Shard + r.Tenant = m.Tenant + r.CompactionLevel = m.CompactionLevel + if rhs := m.SourceBlocks; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.SourceBlocks = tmpContainer + } + if rhs := m.Tombstones; rhs != nil { + tmpContainer := make([]*Tombstones, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Tombstones = tmpContainer } - r := new(GetCompactionRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -82,22 +105,16 @@ func (m *GetCompactionRequest) CloneVT() *GetCompactionRequest { return r } -func (m *GetCompactionRequest) CloneMessageVT() proto.Message { +func (m *CompactionJob) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *GetCompactionResponse) CloneVT() *GetCompactionResponse { +func (m *Tombstones) CloneVT() *Tombstones { if m == nil { - return (*GetCompactionResponse)(nil) - } - r := new(GetCompactionResponse) - if rhs := m.CompactionJobs; rhs != nil { - tmpContainer := make([]*CompactionJob, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } - r.CompactionJobs = tmpContainer + return (*Tombstones)(nil) } + r := new(Tombstones) + r.Blocks = m.Blocks.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -105,27 +122,22 @@ func (m *GetCompactionResponse) CloneVT() *GetCompactionResponse { return r } -func (m *GetCompactionResponse) CloneMessageVT() proto.Message { +func (m *Tombstones) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *CompactionJob) CloneVT() *CompactionJob { +func (m *BlockTombstones) CloneVT() *BlockTombstones { if m == nil { - return (*CompactionJob)(nil) + return (*BlockTombstones)(nil) } - r := new(CompactionJob) + r := new(BlockTombstones) r.Name = m.Name - r.Options = m.Options.CloneVT() - r.Status = m.Status.CloneVT() - r.RaftLogIndex = m.RaftLogIndex r.Shard = m.Shard - r.TenantId = m.TenantId + r.Tenant = m.Tenant r.CompactionLevel = m.CompactionLevel if rhs := m.Blocks; rhs != nil { - tmpContainer := make([]*BlockMeta, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) r.Blocks = tmpContainer } if len(m.unknownFields) > 0 { @@ -135,16 +147,19 @@ func (m *CompactionJob) CloneVT() *CompactionJob { return r } -func (m *CompactionJob) CloneMessageVT() proto.Message { +func (m *BlockTombstones) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *CompactionOptions) CloneVT() *CompactionOptions { +func (m *CompactionJobAssignment) CloneVT() *CompactionJobAssignment { if m == nil { - return (*CompactionOptions)(nil) + return (*CompactionJobAssignment)(nil) } - r := new(CompactionOptions) - r.StatusUpdateIntervalSeconds = m.StatusUpdateIntervalSeconds + r := new(CompactionJobAssignment) + r.Name = m.Name + r.Token = m.Token + r.LeaseExpiresAt = m.LeaseExpiresAt + r.Status = m.Status if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -152,21 +167,19 @@ func (m *CompactionOptions) CloneVT() *CompactionOptions { return r } -func (m *CompactionOptions) CloneMessageVT() proto.Message { +func (m *CompactionJobAssignment) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *CompactionJobStatus) CloneVT() *CompactionJobStatus { +func (m *CompactionJobStatusUpdate) CloneVT() *CompactionJobStatusUpdate { if m == nil { - return (*CompactionJobStatus)(nil) + return (*CompactionJobStatusUpdate)(nil) } - r := new(CompactionJobStatus) - r.JobName = m.JobName + r := new(CompactionJobStatusUpdate) + r.Name = m.Name + r.Token = m.Token r.Status = m.Status - r.CompletedJob = m.CompletedJob.CloneVT() - r.RaftLogIndex = m.RaftLogIndex - r.Shard = m.Shard - r.TenantId = m.TenantId + r.CompactedBlocks = m.CompactedBlocks.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -174,21 +187,22 @@ func (m *CompactionJobStatus) CloneVT() *CompactionJobStatus { return r } -func (m *CompactionJobStatus) CloneMessageVT() proto.Message { +func (m *CompactionJobStatusUpdate) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *CompletedJob) CloneVT() *CompletedJob { +func (m *CompactedBlocks) CloneVT() *CompactedBlocks { if m == nil { - return (*CompletedJob)(nil) + return (*CompactedBlocks)(nil) } - r := new(CompletedJob) - if rhs := m.Blocks; rhs != nil { + r := new(CompactedBlocks) + r.SourceBlocks = m.SourceBlocks.CloneVT() + if rhs := m.CompactedBlocks; rhs != nil { tmpContainer := make([]*BlockMeta, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } - r.Blocks = tmpContainer + r.CompactedBlocks = tmpContainer } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -197,7 +211,7 @@ func (m *CompletedJob) CloneVT() *CompletedJob { return r } -func (m *CompletedJob) CloneMessageVT() proto.Message { +func (m *CompactedBlocks) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -207,17 +221,17 @@ func (this *PollCompactionJobsRequest) EqualVT(that *PollCompactionJobsRequest) } else if this == nil || that == nil { return false } - if len(this.JobStatusUpdates) != len(that.JobStatusUpdates) { + if len(this.StatusUpdates) != len(that.StatusUpdates) { return false } - for i, vx := range this.JobStatusUpdates { - vy := that.JobStatusUpdates[i] + for i, vx := range this.StatusUpdates { + vy := that.StatusUpdates[i] if p, q := vx, vy; p != q { if p == nil { - p = &CompactionJobStatus{} + p = &CompactionJobStatusUpdate{} } if q == nil { - q = &CompactionJobStatus{} + q = &CompactionJobStatusUpdate{} } if !p.EqualVT(q) { return false @@ -260,6 +274,23 @@ func (this *PollCompactionJobsResponse) EqualVT(that *PollCompactionJobsResponse } } } + if len(this.Assignments) != len(that.Assignments) { + return false + } + for i, vx := range this.Assignments { + vy := that.Assignments[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &CompactionJobAssignment{} + } + if q == nil { + q = &CompactionJobAssignment{} + } + if !p.EqualVT(q) { + return false + } + } + } return string(this.unknownFields) == string(that.unknownFields) } @@ -270,39 +301,44 @@ func (this *PollCompactionJobsResponse) EqualMessageVT(thatMsg proto.Message) bo } return this.EqualVT(that) } -func (this *GetCompactionRequest) EqualVT(that *GetCompactionRequest) bool { +func (this *CompactionJob) EqualVT(that *CompactionJob) bool { if this == that { return true } else if this == nil || that == nil { return false } - return string(this.unknownFields) == string(that.unknownFields) -} - -func (this *GetCompactionRequest) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*GetCompactionRequest) - if !ok { + if this.Name != that.Name { return false } - return this.EqualVT(that) -} -func (this *GetCompactionResponse) EqualVT(that *GetCompactionResponse) bool { - if this == that { - return true - } else if this == nil || that == nil { + if this.Shard != that.Shard { return false } - if len(this.CompactionJobs) != len(that.CompactionJobs) { + if this.Tenant != that.Tenant { return false } - for i, vx := range this.CompactionJobs { - vy := that.CompactionJobs[i] + if this.CompactionLevel != that.CompactionLevel { + return false + } + if len(this.SourceBlocks) != len(that.SourceBlocks) { + return false + } + for i, vx := range this.SourceBlocks { + vy := that.SourceBlocks[i] + if vx != vy { + return false + } + } + if len(this.Tombstones) != len(that.Tombstones) { + return false + } + for i, vx := range this.Tombstones { + vy := that.Tombstones[i] if p, q := vx, vy; p != q { if p == nil { - p = &CompactionJob{} + p = &Tombstones{} } if q == nil { - q = &CompactionJob{} + q = &Tombstones{} } if !p.EqualVT(q) { return false @@ -312,131 +348,139 @@ func (this *GetCompactionResponse) EqualVT(that *GetCompactionResponse) bool { return string(this.unknownFields) == string(that.unknownFields) } -func (this *GetCompactionResponse) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*GetCompactionResponse) +func (this *CompactionJob) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactionJob) if !ok { return false } return this.EqualVT(that) } -func (this *CompactionJob) EqualVT(that *CompactionJob) bool { +func (this *Tombstones) EqualVT(that *Tombstones) bool { if this == that { return true } else if this == nil || that == nil { return false } - if this.Name != that.Name { - return false - } - if !this.Options.EqualVT(that.Options) { + if !this.Blocks.EqualVT(that.Blocks) { return false } - if len(this.Blocks) != len(that.Blocks) { + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Tombstones) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Tombstones) + if !ok { return false } - for i, vx := range this.Blocks { - vy := that.Blocks[i] - if p, q := vx, vy; p != q { - if p == nil { - p = &BlockMeta{} - } - if q == nil { - q = &BlockMeta{} - } - if !p.EqualVT(q) { - return false - } - } - } - if !this.Status.EqualVT(that.Status) { + return this.EqualVT(that) +} +func (this *BlockTombstones) EqualVT(that *BlockTombstones) bool { + if this == that { + return true + } else if this == nil || that == nil { return false } - if this.RaftLogIndex != that.RaftLogIndex { + if this.Name != that.Name { return false } if this.Shard != that.Shard { return false } - if this.TenantId != that.TenantId { + if this.Tenant != that.Tenant { return false } if this.CompactionLevel != that.CompactionLevel { return false } + if len(this.Blocks) != len(that.Blocks) { + return false + } + for i, vx := range this.Blocks { + vy := that.Blocks[i] + if vx != vy { + return false + } + } return string(this.unknownFields) == string(that.unknownFields) } -func (this *CompactionJob) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*CompactionJob) +func (this *BlockTombstones) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockTombstones) if !ok { return false } return this.EqualVT(that) } -func (this *CompactionOptions) EqualVT(that *CompactionOptions) bool { +func (this *CompactionJobAssignment) EqualVT(that *CompactionJobAssignment) bool { if this == that { return true } else if this == nil || that == nil { return false } - if this.StatusUpdateIntervalSeconds != that.StatusUpdateIntervalSeconds { + if this.Name != that.Name { + return false + } + if this.Token != that.Token { + return false + } + if this.LeaseExpiresAt != that.LeaseExpiresAt { + return false + } + if this.Status != that.Status { return false } return string(this.unknownFields) == string(that.unknownFields) } -func (this *CompactionOptions) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*CompactionOptions) +func (this *CompactionJobAssignment) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactionJobAssignment) if !ok { return false } return this.EqualVT(that) } -func (this *CompactionJobStatus) EqualVT(that *CompactionJobStatus) bool { +func (this *CompactionJobStatusUpdate) EqualVT(that *CompactionJobStatusUpdate) bool { if this == that { return true } else if this == nil || that == nil { return false } - if this.JobName != that.JobName { - return false - } - if this.Status != that.Status { - return false - } - if !this.CompletedJob.EqualVT(that.CompletedJob) { + if this.Name != that.Name { return false } - if this.RaftLogIndex != that.RaftLogIndex { + if this.Token != that.Token { return false } - if this.Shard != that.Shard { + if this.Status != that.Status { return false } - if this.TenantId != that.TenantId { + if !this.CompactedBlocks.EqualVT(that.CompactedBlocks) { return false } return string(this.unknownFields) == string(that.unknownFields) } -func (this *CompactionJobStatus) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*CompactionJobStatus) +func (this *CompactionJobStatusUpdate) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactionJobStatusUpdate) if !ok { return false } return this.EqualVT(that) } -func (this *CompletedJob) EqualVT(that *CompletedJob) bool { +func (this *CompactedBlocks) EqualVT(that *CompactedBlocks) bool { if this == that { return true } else if this == nil || that == nil { return false } - if len(this.Blocks) != len(that.Blocks) { + if !this.SourceBlocks.EqualVT(that.SourceBlocks) { return false } - for i, vx := range this.Blocks { - vy := that.Blocks[i] + if len(this.CompactedBlocks) != len(that.CompactedBlocks) { + return false + } + for i, vx := range this.CompactedBlocks { + vy := that.CompactedBlocks[i] if p, q := vx, vy; p != q { if p == nil { p = &BlockMeta{} @@ -452,8 +496,8 @@ func (this *CompletedJob) EqualVT(that *CompletedJob) bool { return string(this.unknownFields) == string(that.unknownFields) } -func (this *CompletedJob) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*CompletedJob) +func (this *CompactedBlocks) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactedBlocks) if !ok { return false } @@ -588,9 +632,9 @@ func (m *PollCompactionJobsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er i-- dAtA[i] = 0x10 } - if len(m.JobStatusUpdates) > 0 { - for iNdEx := len(m.JobStatusUpdates) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.JobStatusUpdates[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if len(m.StatusUpdates) > 0 { + for iNdEx := len(m.StatusUpdates) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.StatusUpdates[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -633,6 +677,18 @@ func (m *PollCompactionJobsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, e i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Assignments) > 0 { + for iNdEx := len(m.Assignments) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Assignments[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } if len(m.CompactionJobs) > 0 { for iNdEx := len(m.CompactionJobs) - 1; iNdEx >= 0; iNdEx-- { size, err := m.CompactionJobs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) @@ -648,7 +704,7 @@ func (m *PollCompactionJobsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *GetCompactionRequest) MarshalVT() (dAtA []byte, err error) { +func (m *CompactionJob) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -661,12 +717,12 @@ func (m *GetCompactionRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetCompactionRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *CompactionJob) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *GetCompactionRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *CompactionJob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -678,10 +734,55 @@ func (m *GetCompactionRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Tombstones) > 0 { + for iNdEx := len(m.Tombstones) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Tombstones[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.SourceBlocks) > 0 { + for iNdEx := len(m.SourceBlocks) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SourceBlocks[iNdEx]) + copy(dAtA[i:], m.SourceBlocks[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SourceBlocks[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.CompactionLevel != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.CompactionLevel)) + i-- + dAtA[i] = 0x20 + } + if len(m.Tenant) > 0 { + i -= len(m.Tenant) + copy(dAtA[i:], m.Tenant) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Tenant))) + i-- + dAtA[i] = 0x1a + } + if m.Shard != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Shard)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *GetCompactionResponse) MarshalVT() (dAtA []byte, err error) { +func (m *Tombstones) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -694,12 +795,12 @@ func (m *GetCompactionResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetCompactionResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *Tombstones) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *GetCompactionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *Tombstones) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -711,22 +812,20 @@ func (m *GetCompactionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.CompactionJobs) > 0 { - for iNdEx := len(m.CompactionJobs) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.CompactionJobs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa + if m.Blocks != nil { + size, err := m.Blocks.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *CompactionJob) MarshalVT() (dAtA []byte, err error) { +func (m *BlockTombstones) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -739,12 +838,12 @@ func (m *CompactionJob) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CompactionJob) MarshalToVT(dAtA []byte) (int, error) { +func (m *BlockTombstones) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *CompactionJob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *BlockTombstones) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -756,59 +855,31 @@ func (m *CompactionJob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Blocks) > 0 { + for iNdEx := len(m.Blocks) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Blocks[iNdEx]) + copy(dAtA[i:], m.Blocks[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Blocks[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } if m.CompactionLevel != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.CompactionLevel)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x20 } - if len(m.TenantId) > 0 { - i -= len(m.TenantId) - copy(dAtA[i:], m.TenantId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TenantId))) + if len(m.Tenant) > 0 { + i -= len(m.Tenant) + copy(dAtA[i:], m.Tenant) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Tenant))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x1a } if m.Shard != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Shard)) i-- - dAtA[i] = 0x30 - } - if m.RaftLogIndex != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RaftLogIndex)) - i-- - dAtA[i] = 0x28 - } - if m.Status != nil { - size, err := m.Status.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - if len(m.Blocks) > 0 { - for iNdEx := len(m.Blocks) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Blocks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - } - if m.Options != nil { - size, err := m.Options.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } if len(m.Name) > 0 { i -= len(m.Name) @@ -820,7 +891,7 @@ func (m *CompactionJob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *CompactionOptions) MarshalVT() (dAtA []byte, err error) { +func (m *CompactionJobAssignment) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -833,12 +904,12 @@ func (m *CompactionOptions) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CompactionOptions) MarshalToVT(dAtA []byte) (int, error) { +func (m *CompactionJobAssignment) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *CompactionOptions) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *CompactionJobAssignment) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -850,15 +921,32 @@ func (m *CompactionOptions) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.StatusUpdateIntervalSeconds != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StatusUpdateIntervalSeconds)) + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x20 + } + if m.LeaseExpiresAt != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LeaseExpiresAt)) + i-- + dAtA[i] = 0x18 + } + if m.Token != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Token)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *CompactionJobStatus) MarshalVT() (dAtA []byte, err error) { +func (m *CompactionJobStatusUpdate) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -871,12 +959,12 @@ func (m *CompactionJobStatus) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CompactionJobStatus) MarshalToVT(dAtA []byte) (int, error) { +func (m *CompactionJobStatusUpdate) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *CompactionJobStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *CompactionJobStatusUpdate) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -888,49 +976,37 @@ func (m *CompactionJobStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.TenantId) > 0 { - i -= len(m.TenantId) - copy(dAtA[i:], m.TenantId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TenantId))) - i-- - dAtA[i] = 0x32 - } - if m.Shard != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Shard)) - i-- - dAtA[i] = 0x28 - } - if m.RaftLogIndex != 0 { - i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RaftLogIndex)) - i-- - dAtA[i] = 0x20 - } - if m.CompletedJob != nil { - size, err := m.CompletedJob.MarshalToSizedBufferVT(dAtA[:i]) + if m.CompactedBlocks != nil { + size, err := m.CompactedBlocks.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if m.Status != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) i-- + dAtA[i] = 0x18 + } + if m.Token != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Token)) + i-- dAtA[i] = 0x10 } - if len(m.JobName) > 0 { - i -= len(m.JobName) - copy(dAtA[i:], m.JobName) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.JobName))) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *CompletedJob) MarshalVT() (dAtA []byte, err error) { +func (m *CompactedBlocks) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -943,12 +1019,12 @@ func (m *CompletedJob) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CompletedJob) MarshalToVT(dAtA []byte) (int, error) { +func (m *CompactedBlocks) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *CompletedJob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *CompactedBlocks) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -960,17 +1036,27 @@ func (m *CompletedJob) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Blocks) > 0 { - for iNdEx := len(m.Blocks) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Blocks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if len(m.CompactedBlocks) > 0 { + for iNdEx := len(m.CompactedBlocks) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.CompactedBlocks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + } + if m.SourceBlocks != nil { + size, err := m.SourceBlocks.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -981,8 +1067,8 @@ func (m *PollCompactionJobsRequest) SizeVT() (n int) { } var l int _ = l - if len(m.JobStatusUpdates) > 0 { - for _, e := range m.JobStatusUpdates { + if len(m.StatusUpdates) > 0 { + for _, e := range m.StatusUpdates { l = e.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } @@ -1006,37 +1092,67 @@ func (m *PollCompactionJobsResponse) SizeVT() (n int) { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } + if len(m.Assignments) > 0 { + for _, e := range m.Assignments { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } -func (m *GetCompactionRequest) SizeVT() (n int) { +func (m *CompactionJob) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Shard != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Shard)) + } + l = len(m.Tenant) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.CompactionLevel != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.CompactionLevel)) + } + if len(m.SourceBlocks) > 0 { + for _, s := range m.SourceBlocks { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Tombstones) > 0 { + for _, e := range m.Tombstones { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } -func (m *GetCompactionResponse) SizeVT() (n int) { +func (m *Tombstones) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.CompactionJobs) > 0 { - for _, e := range m.CompactionJobs { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } + if m.Blocks != nil { + l = m.Blocks.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n } -func (m *CompactionJob) SizeVT() (n int) { +func (m *BlockTombstones) SizeVT() (n int) { if m == nil { return 0 } @@ -1046,89 +1162,85 @@ func (m *CompactionJob) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.Options != nil { - l = m.Options.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if len(m.Blocks) > 0 { - for _, e := range m.Blocks { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - } - if m.Status != nil { - l = m.Status.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.RaftLogIndex != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.RaftLogIndex)) - } if m.Shard != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.Shard)) } - l = len(m.TenantId) + l = len(m.Tenant) if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.CompactionLevel != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.CompactionLevel)) } + if len(m.Blocks) > 0 { + for _, s := range m.Blocks { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } -func (m *CompactionOptions) SizeVT() (n int) { +func (m *CompactionJobAssignment) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.StatusUpdateIntervalSeconds != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.StatusUpdateIntervalSeconds)) + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Token != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Token)) + } + if m.LeaseExpiresAt != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LeaseExpiresAt)) + } + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) } n += len(m.unknownFields) return n } -func (m *CompactionJobStatus) SizeVT() (n int) { +func (m *CompactionJobStatusUpdate) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.JobName) + l = len(m.Name) if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Token != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Token)) + } if m.Status != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) } - if m.CompletedJob != nil { - l = m.CompletedJob.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.RaftLogIndex != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.RaftLogIndex)) - } - if m.Shard != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.Shard)) - } - l = len(m.TenantId) - if l > 0 { + if m.CompactedBlocks != nil { + l = m.CompactedBlocks.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n } -func (m *CompletedJob) SizeVT() (n int) { +func (m *CompactedBlocks) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Blocks) > 0 { - for _, e := range m.Blocks { + if m.SourceBlocks != nil { + l = m.SourceBlocks.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.CompactedBlocks) > 0 { + for _, e := range m.CompactedBlocks { l = e.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } @@ -1168,7 +1280,7 @@ func (m *PollCompactionJobsRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JobStatusUpdates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StatusUpdates", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1195,8 +1307,8 @@ func (m *PollCompactionJobsRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.JobStatusUpdates = append(m.JobStatusUpdates, &CompactionJobStatus{}) - if err := m.JobStatusUpdates[len(m.JobStatusUpdates)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.StatusUpdates = append(m.StatusUpdates, &CompactionJobStatusUpdate{}) + if err := m.StatusUpdates[len(m.StatusUpdates)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1304,111 +1416,9 @@ func (m *PollCompactionJobsResponse) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCompactionRequest) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetCompactionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCompactionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCompactionResponse) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetCompactionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCompactionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompactionJobs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Assignments", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1435,8 +1445,8 @@ func (m *GetCompactionResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CompactionJobs = append(m.CompactionJobs, &CompactionJob{}) - if err := m.CompactionJobs[len(m.CompactionJobs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Assignments = append(m.Assignments, &CompactionJobAssignment{}) + if err := m.Assignments[len(m.Assignments)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1524,10 +1534,29 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + m.Shard = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Shard |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -1537,33 +1566,48 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Options == nil { - m.Options = &CompactionOptions{} + m.Tenant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactionLevel", wireType) } - if err := m.Options.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + m.CompactionLevel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CompactionLevel |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceBlocks", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -1573,29 +1617,27 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Blocks = append(m.Blocks, &BlockMeta{}) - if err := m.Blocks[len(m.Blocks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SourceBlocks = append(m.SourceBlocks, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tombstones", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1622,19 +1664,68 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Status == nil { - m.Status = &CompactionJobStatus{} - } - if err := m.Status.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Tombstones = append(m.Tombstones, &Tombstones{}) + if err := m.Tombstones[len(m.Tombstones)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftLogIndex", wireType) - } - m.RaftLogIndex = 0 - for shift := uint(0); ; shift += 7 { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Tombstones) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Tombstones: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Tombstones: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow } @@ -1643,12 +1734,112 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RaftLogIndex |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Blocks == nil { + m.Blocks = &BlockTombstones{} + } + if err := m.Blocks.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockTombstones) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockTombstones: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockTombstones: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } @@ -1667,9 +1858,9 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { break } } - case 7: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TenantId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1697,9 +1888,9 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TenantId = string(dAtA[iNdEx:postIndex]) + m.Tenant = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CompactionLevel", wireType) } @@ -1718,6 +1909,38 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { break } } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocks = append(m.Blocks, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -1740,7 +1963,7 @@ func (m *CompactionJob) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *CompactionOptions) UnmarshalVT(dAtA []byte) error { +func (m *CompactionJobAssignment) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1763,17 +1986,49 @@ func (m *CompactionOptions) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CompactionOptions: wiretype end group for non-group") + return fmt.Errorf("proto: CompactionJobAssignment: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CompactionOptions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CompactionJobAssignment: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusUpdateIntervalSeconds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - m.StatusUpdateIntervalSeconds = 0 + m.Token = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -1783,7 +2038,45 @@ func (m *CompactionOptions) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.StatusUpdateIntervalSeconds |= uint64(b&0x7F) << shift + m.Token |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LeaseExpiresAt", wireType) + } + m.LeaseExpiresAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LeaseExpiresAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= CompactionJobStatus(b&0x7F) << shift if b < 0x80 { break } @@ -1810,7 +2103,7 @@ func (m *CompactionOptions) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *CompactionJobStatus) UnmarshalVT(dAtA []byte) error { +func (m *CompactionJobStatusUpdate) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1833,15 +2126,15 @@ func (m *CompactionJobStatus) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CompactionJobStatus: wiretype end group for non-group") + return fmt.Errorf("proto: CompactionJobStatusUpdate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CompactionJobStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CompactionJobStatusUpdate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field JobName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1869,13 +2162,13 @@ func (m *CompactionJobStatus) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.JobName = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - m.Status = 0 + m.Token = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -1885,71 +2178,16 @@ func (m *CompactionJobStatus) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= CompactionStatus(b&0x7F) << shift + m.Token |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompletedJob", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CompletedJob == nil { - m.CompletedJob = &CompletedJob{} - } - if err := m.CompletedJob.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftLogIndex", wireType) - } - m.RaftLogIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftLogIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - m.Shard = 0 + m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -1959,16 +2197,16 @@ func (m *CompactionJobStatus) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Shard |= uint32(b&0x7F) << shift + m.Status |= CompactionJobStatus(b&0x7F) << shift if b < 0x80 { break } } - case 6: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TenantId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CompactedBlocks", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -1978,23 +2216,27 @@ func (m *CompactionJobStatus) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.TenantId = string(dAtA[iNdEx:postIndex]) + if m.CompactedBlocks == nil { + m.CompactedBlocks = &CompactedBlocks{} + } + if err := m.CompactedBlocks.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2018,7 +2260,7 @@ func (m *CompactionJobStatus) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *CompletedJob) UnmarshalVT(dAtA []byte) error { +func (m *CompactedBlocks) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2041,15 +2283,51 @@ func (m *CompletedJob) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CompletedJob: wiretype end group for non-group") + return fmt.Errorf("proto: CompactedBlocks: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CompletedJob: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CompactedBlocks: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceBlocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SourceBlocks == nil { + m.SourceBlocks = &BlockList{} + } + if err := m.SourceBlocks.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactedBlocks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2076,8 +2354,8 @@ func (m *CompletedJob) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Blocks = append(m.Blocks, &BlockMeta{}) - if err := m.Blocks[len(m.Blocks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.CompactedBlocks = append(m.CompactedBlocks, &BlockMeta{}) + if err := m.CompactedBlocks[len(m.CompactedBlocks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/api/gen/proto/go/metastore/v1/metastore.pb.go b/api/gen/proto/go/metastore/v1/metastore.pb.go index 4ffee7d92b..eee4b8ccc8 100644 --- a/api/gen/proto/go/metastore/v1/metastore.pb.go +++ b/api/gen/proto/go/metastore/v1/metastore.pb.go @@ -106,6 +106,163 @@ func (*AddBlockResponse) Descriptor() ([]byte, []int) { return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{1} } +type GetBlockMetadataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks *BlockList `protobuf:"bytes,1,opt,name=blocks,proto3" json:"blocks,omitempty"` +} + +func (x *GetBlockMetadataRequest) Reset() { + *x = GetBlockMetadataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_metastore_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlockMetadataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockMetadataRequest) ProtoMessage() {} + +func (x *GetBlockMetadataRequest) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_metastore_proto_msgTypes[2] + 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 GetBlockMetadataRequest.ProtoReflect.Descriptor instead. +func (*GetBlockMetadataRequest) Descriptor() ([]byte, []int) { + return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{2} +} + +func (x *GetBlockMetadataRequest) GetBlocks() *BlockList { + if x != nil { + return x.Blocks + } + return nil +} + +type GetBlockMetadataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks []*BlockMeta `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +func (x *GetBlockMetadataResponse) Reset() { + *x = GetBlockMetadataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_metastore_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlockMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockMetadataResponse) ProtoMessage() {} + +func (x *GetBlockMetadataResponse) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_metastore_proto_msgTypes[3] + 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 GetBlockMetadataResponse.ProtoReflect.Descriptor instead. +func (*GetBlockMetadataResponse) Descriptor() ([]byte, []int) { + return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{3} +} + +func (x *GetBlockMetadataResponse) GetBlocks() []*BlockMeta { + if x != nil { + return x.Blocks + } + return nil +} + +type BlockList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tenant string `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` + Shard uint32 `protobuf:"varint,2,opt,name=shard,proto3" json:"shard,omitempty"` + Blocks []string `protobuf:"bytes,3,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +func (x *BlockList) Reset() { + *x = BlockList{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_metastore_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockList) ProtoMessage() {} + +func (x *BlockList) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_metastore_proto_msgTypes[4] + 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 BlockList.ProtoReflect.Descriptor instead. +func (*BlockList) Descriptor() ([]byte, []int) { + return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{4} +} + +func (x *BlockList) GetTenant() string { + if x != nil { + return x.Tenant + } + return "" +} + +func (x *BlockList) GetShard() uint32 { + if x != nil { + return x.Shard + } + return 0 +} + +func (x *BlockList) GetBlocks() []string { + if x != nil { + return x.Blocks + } + return nil +} + type BlockMeta struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -127,7 +284,7 @@ type BlockMeta struct { func (x *BlockMeta) Reset() { *x = BlockMeta{} if protoimpl.UnsafeEnabled { - mi := &file_metastore_v1_metastore_proto_msgTypes[2] + mi := &file_metastore_v1_metastore_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -140,7 +297,7 @@ func (x *BlockMeta) String() string { func (*BlockMeta) ProtoMessage() {} func (x *BlockMeta) ProtoReflect() protoreflect.Message { - mi := &file_metastore_v1_metastore_proto_msgTypes[2] + mi := &file_metastore_v1_metastore_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -153,7 +310,7 @@ func (x *BlockMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockMeta.ProtoReflect.Descriptor instead. func (*BlockMeta) Descriptor() ([]byte, []int) { - return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{2} + return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{5} } func (x *BlockMeta) GetFormatVersion() uint64 { @@ -255,7 +412,7 @@ type Dataset struct { func (x *Dataset) Reset() { *x = Dataset{} if protoimpl.UnsafeEnabled { - mi := &file_metastore_v1_metastore_proto_msgTypes[3] + mi := &file_metastore_v1_metastore_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -268,7 +425,7 @@ func (x *Dataset) String() string { func (*Dataset) ProtoMessage() {} func (x *Dataset) ProtoReflect() protoreflect.Message { - mi := &file_metastore_v1_metastore_proto_msgTypes[3] + mi := &file_metastore_v1_metastore_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -281,7 +438,7 @@ func (x *Dataset) ProtoReflect() protoreflect.Message { // Deprecated: Use Dataset.ProtoReflect.Descriptor instead. func (*Dataset) Descriptor() ([]byte, []int) { - return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{3} + return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{6} } func (x *Dataset) GetTenantId() string { @@ -352,61 +509,82 @@ var file_metastore_v1_metastore_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x12, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbc, 0x02, 0x0a, 0x09, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, - 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x31, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, - 0x73, 0x65, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x22, 0xff, 0x01, 0x0a, 0x07, 0x44, 0x61, 0x74, 0x61, - 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x66, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, - 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x32, 0x5b, 0x0a, 0x0c, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x41, 0x64, 0x64, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xbb, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, - 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x4d, 0x65, 0x74, - 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, - 0x61, 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x74, - 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, - 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x74, - 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x06, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x4b, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x22, 0x51, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x22, 0xbc, 0x02, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, + 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x31, 0x0a, + 0x08, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x62, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x42, 0x79, 0x22, 0xff, 0x01, 0x0a, 0x07, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, + 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, + 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x6f, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x04, 0x52, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x66, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x32, 0xc0, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xbb, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x4d, + 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, + 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, + 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0c, + 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, + 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -421,25 +599,32 @@ func file_metastore_v1_metastore_proto_rawDescGZIP() []byte { return file_metastore_v1_metastore_proto_rawDescData } -var file_metastore_v1_metastore_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_metastore_v1_metastore_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_metastore_v1_metastore_proto_goTypes = []any{ - (*AddBlockRequest)(nil), // 0: metastore.v1.AddBlockRequest - (*AddBlockResponse)(nil), // 1: metastore.v1.AddBlockResponse - (*BlockMeta)(nil), // 2: metastore.v1.BlockMeta - (*Dataset)(nil), // 3: metastore.v1.Dataset - (*v1.Labels)(nil), // 4: types.v1.Labels + (*AddBlockRequest)(nil), // 0: metastore.v1.AddBlockRequest + (*AddBlockResponse)(nil), // 1: metastore.v1.AddBlockResponse + (*GetBlockMetadataRequest)(nil), // 2: metastore.v1.GetBlockMetadataRequest + (*GetBlockMetadataResponse)(nil), // 3: metastore.v1.GetBlockMetadataResponse + (*BlockList)(nil), // 4: metastore.v1.BlockList + (*BlockMeta)(nil), // 5: metastore.v1.BlockMeta + (*Dataset)(nil), // 6: metastore.v1.Dataset + (*v1.Labels)(nil), // 7: types.v1.Labels } var file_metastore_v1_metastore_proto_depIdxs = []int32{ - 2, // 0: metastore.v1.AddBlockRequest.block:type_name -> metastore.v1.BlockMeta - 3, // 1: metastore.v1.BlockMeta.datasets:type_name -> metastore.v1.Dataset - 4, // 2: metastore.v1.Dataset.labels:type_name -> types.v1.Labels - 0, // 3: metastore.v1.IndexService.AddBlock:input_type -> metastore.v1.AddBlockRequest - 1, // 4: metastore.v1.IndexService.AddBlock:output_type -> metastore.v1.AddBlockResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 5, // 0: metastore.v1.AddBlockRequest.block:type_name -> metastore.v1.BlockMeta + 4, // 1: metastore.v1.GetBlockMetadataRequest.blocks:type_name -> metastore.v1.BlockList + 5, // 2: metastore.v1.GetBlockMetadataResponse.blocks:type_name -> metastore.v1.BlockMeta + 6, // 3: metastore.v1.BlockMeta.datasets:type_name -> metastore.v1.Dataset + 7, // 4: metastore.v1.Dataset.labels:type_name -> types.v1.Labels + 0, // 5: metastore.v1.IndexService.AddBlock:input_type -> metastore.v1.AddBlockRequest + 2, // 6: metastore.v1.IndexService.GetBlockMetadata:input_type -> metastore.v1.GetBlockMetadataRequest + 1, // 7: metastore.v1.IndexService.AddBlock:output_type -> metastore.v1.AddBlockResponse + 3, // 8: metastore.v1.IndexService.GetBlockMetadata:output_type -> metastore.v1.GetBlockMetadataResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_metastore_v1_metastore_proto_init() } @@ -473,7 +658,7 @@ func file_metastore_v1_metastore_proto_init() { } } file_metastore_v1_metastore_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*BlockMeta); i { + switch v := v.(*GetBlockMetadataRequest); i { case 0: return &v.state case 1: @@ -485,6 +670,42 @@ func file_metastore_v1_metastore_proto_init() { } } file_metastore_v1_metastore_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*GetBlockMetadataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_metastore_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*BlockList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_metastore_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*BlockMeta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_metastore_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*Dataset); i { case 0: return &v.state @@ -503,7 +724,7 @@ func file_metastore_v1_metastore_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_metastore_v1_metastore_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go b/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go index 24d2ad40e7..9696531b58 100644 --- a/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go +++ b/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go @@ -57,6 +57,69 @@ func (m *AddBlockResponse) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *GetBlockMetadataRequest) CloneVT() *GetBlockMetadataRequest { + if m == nil { + return (*GetBlockMetadataRequest)(nil) + } + r := new(GetBlockMetadataRequest) + r.Blocks = m.Blocks.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetBlockMetadataRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *GetBlockMetadataResponse) CloneVT() *GetBlockMetadataResponse { + if m == nil { + return (*GetBlockMetadataResponse)(nil) + } + r := new(GetBlockMetadataResponse) + if rhs := m.Blocks; rhs != nil { + tmpContainer := make([]*BlockMeta, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Blocks = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetBlockMetadataResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BlockList) CloneVT() *BlockList { + if m == nil { + return (*BlockList)(nil) + } + r := new(BlockList) + r.Tenant = m.Tenant + r.Shard = m.Shard + if rhs := m.Blocks; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Blocks = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockList) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *BlockMeta) CloneVT() *BlockMeta { if m == nil { return (*BlockMeta)(nil) @@ -166,6 +229,89 @@ func (this *AddBlockResponse) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *GetBlockMetadataRequest) EqualVT(that *GetBlockMetadataRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.Blocks.EqualVT(that.Blocks) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetBlockMetadataRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*GetBlockMetadataRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *GetBlockMetadataResponse) EqualVT(that *GetBlockMetadataResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Blocks) != len(that.Blocks) { + return false + } + for i, vx := range this.Blocks { + vy := that.Blocks[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &BlockMeta{} + } + if q == nil { + q = &BlockMeta{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetBlockMetadataResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*GetBlockMetadataResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *BlockList) EqualVT(that *BlockList) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Tenant != that.Tenant { + return false + } + if this.Shard != that.Shard { + return false + } + if len(this.Blocks) != len(that.Blocks) { + return false + } + for i, vx := range this.Blocks { + vy := that.Blocks[i] + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockList) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockList) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *BlockMeta) EqualVT(that *BlockMeta) bool { if this == that { return true @@ -307,6 +453,7 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type IndexServiceClient interface { AddBlock(ctx context.Context, in *AddBlockRequest, opts ...grpc.CallOption) (*AddBlockResponse, error) + GetBlockMetadata(ctx context.Context, in *GetBlockMetadataRequest, opts ...grpc.CallOption) (*GetBlockMetadataResponse, error) } type indexServiceClient struct { @@ -326,11 +473,21 @@ func (c *indexServiceClient) AddBlock(ctx context.Context, in *AddBlockRequest, return out, nil } +func (c *indexServiceClient) GetBlockMetadata(ctx context.Context, in *GetBlockMetadataRequest, opts ...grpc.CallOption) (*GetBlockMetadataResponse, error) { + out := new(GetBlockMetadataResponse) + err := c.cc.Invoke(ctx, "/metastore.v1.IndexService/GetBlockMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // IndexServiceServer is the server API for IndexService service. // All implementations must embed UnimplementedIndexServiceServer // for forward compatibility type IndexServiceServer interface { AddBlock(context.Context, *AddBlockRequest) (*AddBlockResponse, error) + GetBlockMetadata(context.Context, *GetBlockMetadataRequest) (*GetBlockMetadataResponse, error) mustEmbedUnimplementedIndexServiceServer() } @@ -341,6 +498,9 @@ type UnimplementedIndexServiceServer struct { func (UnimplementedIndexServiceServer) AddBlock(context.Context, *AddBlockRequest) (*AddBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddBlock not implemented") } +func (UnimplementedIndexServiceServer) GetBlockMetadata(context.Context, *GetBlockMetadataRequest) (*GetBlockMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockMetadata not implemented") +} func (UnimplementedIndexServiceServer) mustEmbedUnimplementedIndexServiceServer() {} // UnsafeIndexServiceServer may be embedded to opt out of forward compatibility for this service. @@ -372,6 +532,24 @@ func _IndexService_AddBlock_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _IndexService_GetBlockMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlockMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IndexServiceServer).GetBlockMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/metastore.v1.IndexService/GetBlockMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IndexServiceServer).GetBlockMetadata(ctx, req.(*GetBlockMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + // IndexService_ServiceDesc is the grpc.ServiceDesc for IndexService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -383,6 +561,10 @@ var IndexService_ServiceDesc = grpc.ServiceDesc{ MethodName: "AddBlock", Handler: _IndexService_AddBlock_Handler, }, + { + MethodName: "GetBlockMetadata", + Handler: _IndexService_GetBlockMetadata_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "metastore/v1/metastore.proto", @@ -464,6 +646,148 @@ func (m *AddBlockResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GetBlockMetadataRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetBlockMetadataRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetBlockMetadataRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Blocks != nil { + size, err := m.Blocks.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetBlockMetadataResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetBlockMetadataResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetBlockMetadataResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Blocks) > 0 { + for iNdEx := len(m.Blocks) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Blocks[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *BlockList) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockList) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockList) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Blocks) > 0 { + for iNdEx := len(m.Blocks) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Blocks[iNdEx]) + copy(dAtA[i:], m.Blocks[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Blocks[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.Shard != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Shard)) + i-- + dAtA[i] = 0x10 + } + if len(m.Tenant) > 0 { + i -= len(m.Tenant) + copy(dAtA[i:], m.Tenant) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Tenant))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *BlockMeta) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -699,23 +1023,76 @@ func (m *AddBlockResponse) SizeVT() (n int) { return n } -func (m *BlockMeta) SizeVT() (n int) { +func (m *GetBlockMetadataRequest) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.FormatVersion != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.FormatVersion)) - } - l = len(m.Id) - if l > 0 { + if m.Blocks != nil { + l = m.Blocks.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.MinTime != 0 { - n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) - } - if m.MaxTime != 0 { + n += len(m.unknownFields) + return n +} + +func (m *GetBlockMetadataResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Blocks) > 0 { + for _, e := range m.Blocks { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BlockList) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tenant) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Shard != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Shard)) + } + if len(m.Blocks) > 0 { + for _, s := range m.Blocks { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BlockMeta) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FormatVersion != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FormatVersion)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MinTime != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) + } + if m.MaxTime != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTime)) } if m.Shard != 0 { @@ -935,6 +1312,312 @@ func (m *AddBlockResponse) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *GetBlockMetadataRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetBlockMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBlockMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Blocks == nil { + m.Blocks = &BlockList{} + } + if err := m.Blocks.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetBlockMetadataResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetBlockMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBlockMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocks = append(m.Blocks, &BlockMeta{}) + if err := m.Blocks[len(m.Blocks)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockList) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tenant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + m.Shard = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Shard |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocks = append(m.Blocks, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *BlockMeta) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go index 9d000ba40c..eab467e9d7 100644 --- a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go +++ b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go @@ -35,17 +35,22 @@ const ( const ( // IndexServiceAddBlockProcedure is the fully-qualified name of the IndexService's AddBlock RPC. IndexServiceAddBlockProcedure = "/metastore.v1.IndexService/AddBlock" + // IndexServiceGetBlockMetadataProcedure is the fully-qualified name of the IndexService's + // GetBlockMetadata RPC. + IndexServiceGetBlockMetadataProcedure = "/metastore.v1.IndexService/GetBlockMetadata" ) // These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. var ( - indexServiceServiceDescriptor = v1.File_metastore_v1_metastore_proto.Services().ByName("IndexService") - indexServiceAddBlockMethodDescriptor = indexServiceServiceDescriptor.Methods().ByName("AddBlock") + indexServiceServiceDescriptor = v1.File_metastore_v1_metastore_proto.Services().ByName("IndexService") + indexServiceAddBlockMethodDescriptor = indexServiceServiceDescriptor.Methods().ByName("AddBlock") + indexServiceGetBlockMetadataMethodDescriptor = indexServiceServiceDescriptor.Methods().ByName("GetBlockMetadata") ) // IndexServiceClient is a client for the metastore.v1.IndexService service. type IndexServiceClient interface { AddBlock(context.Context, *connect.Request[v1.AddBlockRequest]) (*connect.Response[v1.AddBlockResponse], error) + GetBlockMetadata(context.Context, *connect.Request[v1.GetBlockMetadataRequest]) (*connect.Response[v1.GetBlockMetadataResponse], error) } // NewIndexServiceClient constructs a client for the metastore.v1.IndexService service. By default, @@ -64,12 +69,19 @@ func NewIndexServiceClient(httpClient connect.HTTPClient, baseURL string, opts . connect.WithSchema(indexServiceAddBlockMethodDescriptor), connect.WithClientOptions(opts...), ), + getBlockMetadata: connect.NewClient[v1.GetBlockMetadataRequest, v1.GetBlockMetadataResponse]( + httpClient, + baseURL+IndexServiceGetBlockMetadataProcedure, + connect.WithSchema(indexServiceGetBlockMetadataMethodDescriptor), + connect.WithClientOptions(opts...), + ), } } // indexServiceClient implements IndexServiceClient. type indexServiceClient struct { - addBlock *connect.Client[v1.AddBlockRequest, v1.AddBlockResponse] + addBlock *connect.Client[v1.AddBlockRequest, v1.AddBlockResponse] + getBlockMetadata *connect.Client[v1.GetBlockMetadataRequest, v1.GetBlockMetadataResponse] } // AddBlock calls metastore.v1.IndexService.AddBlock. @@ -77,9 +89,15 @@ func (c *indexServiceClient) AddBlock(ctx context.Context, req *connect.Request[ return c.addBlock.CallUnary(ctx, req) } +// GetBlockMetadata calls metastore.v1.IndexService.GetBlockMetadata. +func (c *indexServiceClient) GetBlockMetadata(ctx context.Context, req *connect.Request[v1.GetBlockMetadataRequest]) (*connect.Response[v1.GetBlockMetadataResponse], error) { + return c.getBlockMetadata.CallUnary(ctx, req) +} + // IndexServiceHandler is an implementation of the metastore.v1.IndexService service. type IndexServiceHandler interface { AddBlock(context.Context, *connect.Request[v1.AddBlockRequest]) (*connect.Response[v1.AddBlockResponse], error) + GetBlockMetadata(context.Context, *connect.Request[v1.GetBlockMetadataRequest]) (*connect.Response[v1.GetBlockMetadataResponse], error) } // NewIndexServiceHandler builds an HTTP handler from the service implementation. It returns the @@ -94,10 +112,18 @@ func NewIndexServiceHandler(svc IndexServiceHandler, opts ...connect.HandlerOpti connect.WithSchema(indexServiceAddBlockMethodDescriptor), connect.WithHandlerOptions(opts...), ) + indexServiceGetBlockMetadataHandler := connect.NewUnaryHandler( + IndexServiceGetBlockMetadataProcedure, + svc.GetBlockMetadata, + connect.WithSchema(indexServiceGetBlockMetadataMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) return "/metastore.v1.IndexService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case IndexServiceAddBlockProcedure: indexServiceAddBlockHandler.ServeHTTP(w, r) + case IndexServiceGetBlockMetadataProcedure: + indexServiceGetBlockMetadataHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -110,3 +136,7 @@ type UnimplementedIndexServiceHandler struct{} func (UnimplementedIndexServiceHandler) AddBlock(context.Context, *connect.Request[v1.AddBlockRequest]) (*connect.Response[v1.AddBlockResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metastore.v1.IndexService.AddBlock is not implemented")) } + +func (UnimplementedIndexServiceHandler) GetBlockMetadata(context.Context, *connect.Request[v1.GetBlockMetadataRequest]) (*connect.Response[v1.GetBlockMetadataResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metastore.v1.IndexService.GetBlockMetadata is not implemented")) +} diff --git a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go index b48c6ae4db..6348296c48 100644 --- a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go +++ b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go @@ -24,4 +24,9 @@ func RegisterIndexServiceHandler(mux *mux.Router, svc IndexServiceHandler, opts svc.AddBlock, opts..., )) + mux.Handle("/metastore.v1.IndexService/GetBlockMetadata", connect.NewUnaryHandler( + "/metastore.v1.IndexService/GetBlockMetadata", + svc.GetBlockMetadata, + opts..., + )) } diff --git a/api/gen/proto/go/metastore/v1/raft_log/raft_log.pb.go b/api/gen/proto/go/metastore/v1/raft_log/raft_log.pb.go index d2b8859794..0fe8876fe5 100644 --- a/api/gen/proto/go/metastore/v1/raft_log/raft_log.pb.go +++ b/api/gen/proto/go/metastore/v1/raft_log/raft_log.pb.go @@ -7,6 +7,7 @@ package raft_log import ( + v1 "github.com/grafana/pyroscope/api/gen/proto/go/metastore/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -23,25 +24,25 @@ const ( type RaftCommand int32 const ( - RaftCommand_RAFT_COMMAND_UNKNOWN RaftCommand = 0 - RaftCommand_RAFT_COMMAND_ADD_BLOCK RaftCommand = 1 - RaftCommand_RAFT_COMMAND_POLL_COMPACTION_JOBS RaftCommand = 2 - RaftCommand_RAFT_COMMAND_CLEAN_BLOCKS RaftCommand = 3 + RaftCommand_RAFT_COMMAND_UNKNOWN RaftCommand = 0 + RaftCommand_RAFT_COMMAND_ADD_BLOCK_METADATA RaftCommand = 1 + RaftCommand_RAFT_COMMAND_GET_COMPACTION_PLAN_UPDATE RaftCommand = 2 + RaftCommand_RAFT_COMMAND_UPDATE_COMPACTION_PLAN RaftCommand = 3 ) // Enum value maps for RaftCommand. var ( RaftCommand_name = map[int32]string{ 0: "RAFT_COMMAND_UNKNOWN", - 1: "RAFT_COMMAND_ADD_BLOCK", - 2: "RAFT_COMMAND_POLL_COMPACTION_JOBS", - 3: "RAFT_COMMAND_CLEAN_BLOCKS", + 1: "RAFT_COMMAND_ADD_BLOCK_METADATA", + 2: "RAFT_COMMAND_GET_COMPACTION_PLAN_UPDATE", + 3: "RAFT_COMMAND_UPDATE_COMPACTION_PLAN", } RaftCommand_value = map[string]int32{ - "RAFT_COMMAND_UNKNOWN": 0, - "RAFT_COMMAND_ADD_BLOCK": 1, - "RAFT_COMMAND_POLL_COMPACTION_JOBS": 2, - "RAFT_COMMAND_CLEAN_BLOCKS": 3, + "RAFT_COMMAND_UNKNOWN": 0, + "RAFT_COMMAND_ADD_BLOCK_METADATA": 1, + "RAFT_COMMAND_GET_COMPACTION_PLAN_UPDATE": 2, + "RAFT_COMMAND_UPDATE_COMPACTION_PLAN": 3, } ) @@ -72,16 +73,16 @@ func (RaftCommand) EnumDescriptor() ([]byte, []int) { return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{0} } -type CleanBlocksRequest struct { +type AddBlockMetadataRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + Metadata *v1.BlockMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (x *CleanBlocksRequest) Reset() { - *x = CleanBlocksRequest{} +func (x *AddBlockMetadataRequest) Reset() { + *x = AddBlockMetadataRequest{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -89,13 +90,13 @@ func (x *CleanBlocksRequest) Reset() { } } -func (x *CleanBlocksRequest) String() string { +func (x *AddBlockMetadataRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CleanBlocksRequest) ProtoMessage() {} +func (*AddBlockMetadataRequest) ProtoMessage() {} -func (x *CleanBlocksRequest) ProtoReflect() protoreflect.Message { +func (x *AddBlockMetadataRequest) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -107,47 +108,688 @@ func (x *CleanBlocksRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CleanBlocksRequest.ProtoReflect.Descriptor instead. -func (*CleanBlocksRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use AddBlockMetadataRequest.ProtoReflect.Descriptor instead. +func (*AddBlockMetadataRequest) Descriptor() ([]byte, []int) { return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{0} } -func (x *CleanBlocksRequest) GetRequestId() string { +func (x *AddBlockMetadataRequest) GetMetadata() *v1.BlockMeta { if x != nil { - return x.RequestId + return x.Metadata + } + return nil +} + +type AddBlockMetadataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AddBlockMetadataResponse) Reset() { + *x = AddBlockMetadataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddBlockMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddBlockMetadataResponse) ProtoMessage() {} + +func (x *AddBlockMetadataResponse) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[1] + 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 AddBlockMetadataResponse.ProtoReflect.Descriptor instead. +func (*AddBlockMetadataResponse) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{1} +} + +// GetCompactionPlanUpdateRequest requests CompactionPlanUpdate. +// The resulting plan should be proposed to the raft members. +// This is a read-only operation: it MUST NOT alter the state. +type GetCompactionPlanUpdateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // CompactionJobStatusUpdate is a change + // requested by the compaction worker. + StatusUpdates []*v1.CompactionJobStatusUpdate `protobuf:"bytes,1,rep,name=status_updates,json=statusUpdates,proto3" json:"status_updates,omitempty"` + AssignJobsMax uint32 `protobuf:"varint,2,opt,name=assign_jobs_max,json=assignJobsMax,proto3" json:"assign_jobs_max,omitempty"` +} + +func (x *GetCompactionPlanUpdateRequest) Reset() { + *x = GetCompactionPlanUpdateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCompactionPlanUpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCompactionPlanUpdateRequest) ProtoMessage() {} + +func (x *GetCompactionPlanUpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[2] + 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 GetCompactionPlanUpdateRequest.ProtoReflect.Descriptor instead. +func (*GetCompactionPlanUpdateRequest) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{2} +} + +func (x *GetCompactionPlanUpdateRequest) GetStatusUpdates() []*v1.CompactionJobStatusUpdate { + if x != nil { + return x.StatusUpdates + } + return nil +} + +func (x *GetCompactionPlanUpdateRequest) GetAssignJobsMax() uint32 { + if x != nil { + return x.AssignJobsMax + } + return 0 +} + +// GetCompactionPlanUpdateResponse includes the planned change. +// The plan should be proposed to the raft members. +type GetCompactionPlanUpdateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlanUpdate *CompactionPlanUpdate `protobuf:"bytes,1,opt,name=plan_update,json=planUpdate,proto3" json:"plan_update,omitempty"` +} + +func (x *GetCompactionPlanUpdateResponse) Reset() { + *x = GetCompactionPlanUpdateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCompactionPlanUpdateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCompactionPlanUpdateResponse) ProtoMessage() {} + +func (x *GetCompactionPlanUpdateResponse) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[3] + 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 GetCompactionPlanUpdateResponse.ProtoReflect.Descriptor instead. +func (*GetCompactionPlanUpdateResponse) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{3} +} + +func (x *GetCompactionPlanUpdateResponse) GetPlanUpdate() *CompactionPlanUpdate { + if x != nil { + return x.PlanUpdate + } + return nil +} + +type CompactionPlanUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewJobs []*CompactionJobUpdate `protobuf:"bytes,1,rep,name=new_jobs,json=newJobs,proto3" json:"new_jobs,omitempty"` + AssignedJobs []*CompactionJobUpdate `protobuf:"bytes,2,rep,name=assigned_jobs,json=assignedJobs,proto3" json:"assigned_jobs,omitempty"` + CompletedJobs []*CompactionJobUpdate `protobuf:"bytes,3,rep,name=completed_jobs,json=completedJobs,proto3" json:"completed_jobs,omitempty"` +} + +func (x *CompactionPlanUpdate) Reset() { + *x = CompactionPlanUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompactionPlanUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompactionPlanUpdate) ProtoMessage() {} + +func (x *CompactionPlanUpdate) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[4] + 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 CompactionPlanUpdate.ProtoReflect.Descriptor instead. +func (*CompactionPlanUpdate) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{4} +} + +func (x *CompactionPlanUpdate) GetNewJobs() []*CompactionJobUpdate { + if x != nil { + return x.NewJobs + } + return nil +} + +func (x *CompactionPlanUpdate) GetAssignedJobs() []*CompactionJobUpdate { + if x != nil { + return x.AssignedJobs + } + return nil +} + +func (x *CompactionPlanUpdate) GetCompletedJobs() []*CompactionJobUpdate { + if x != nil { + return x.CompletedJobs + } + return nil +} + +type CompactionJobUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State *CompactionJobState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Plan *CompactionJobPlan `protobuf:"bytes,2,opt,name=plan,proto3" json:"plan,omitempty"` +} + +func (x *CompactionJobUpdate) Reset() { + *x = CompactionJobUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompactionJobUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompactionJobUpdate) ProtoMessage() {} + +func (x *CompactionJobUpdate) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[5] + 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 CompactionJobUpdate.ProtoReflect.Descriptor instead. +func (*CompactionJobUpdate) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{5} +} + +func (x *CompactionJobUpdate) GetState() *CompactionJobState { + if x != nil { + return x.State + } + return nil +} + +func (x *CompactionJobUpdate) GetPlan() *CompactionJobPlan { + if x != nil { + return x.Plan + } + return nil +} + +// CompactionJobState is produced in response to +// the compaction worker status update request. +// +// Compaction level and other attributes that +// affect the scheduling order or status update +// handling should be included into the message. +type CompactionJobState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CompactionLevel uint32 `protobuf:"varint,2,opt,name=compaction_level,json=compactionLevel,proto3" json:"compaction_level,omitempty"` + Status v1.CompactionJobStatus `protobuf:"varint,3,opt,name=status,proto3,enum=metastore.v1.CompactionJobStatus" json:"status,omitempty"` + Token uint64 `protobuf:"varint,4,opt,name=token,proto3" json:"token,omitempty"` + LeaseExpiresAt int64 `protobuf:"varint,5,opt,name=lease_expires_at,json=leaseExpiresAt,proto3" json:"lease_expires_at,omitempty"` + AddedAt int64 `protobuf:"varint,6,opt,name=added_at,json=addedAt,proto3" json:"added_at,omitempty"` + Failures uint32 `protobuf:"varint,7,opt,name=failures,proto3" json:"failures,omitempty"` +} + +func (x *CompactionJobState) Reset() { + *x = CompactionJobState{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompactionJobState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompactionJobState) ProtoMessage() {} + +func (x *CompactionJobState) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[6] + 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 CompactionJobState.ProtoReflect.Descriptor instead. +func (*CompactionJobState) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{6} +} + +func (x *CompactionJobState) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CompactionJobState) GetCompactionLevel() uint32 { + if x != nil { + return x.CompactionLevel + } + return 0 +} + +func (x *CompactionJobState) GetStatus() v1.CompactionJobStatus { + if x != nil { + return x.Status + } + return v1.CompactionJobStatus(0) +} + +func (x *CompactionJobState) GetToken() uint64 { + if x != nil { + return x.Token + } + return 0 +} + +func (x *CompactionJobState) GetLeaseExpiresAt() int64 { + if x != nil { + return x.LeaseExpiresAt + } + return 0 +} + +func (x *CompactionJobState) GetAddedAt() int64 { + if x != nil { + return x.AddedAt + } + return 0 +} + +func (x *CompactionJobState) GetFailures() uint32 { + if x != nil { + return x.Failures + } + return 0 +} + +type CompactionJobPlan struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Blocks to be compacted. + Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` + Shard uint32 `protobuf:"varint,3,opt,name=shard,proto3" json:"shard,omitempty"` + CompactionLevel uint32 `protobuf:"varint,4,opt,name=compaction_level,json=compactionLevel,proto3" json:"compaction_level,omitempty"` + SourceBlocks []string `protobuf:"bytes,5,rep,name=source_blocks,json=sourceBlocks,proto3" json:"source_blocks,omitempty"` + // Objects to be deleted. + Tombstones []*v1.Tombstones `protobuf:"bytes,6,rep,name=tombstones,proto3" json:"tombstones,omitempty"` + // Only present if the job completed successfully. + // Never stored in the metastore. + CompactedBlocks *v1.CompactedBlocks `protobuf:"bytes,7,opt,name=compacted_blocks,json=compactedBlocks,proto3" json:"compacted_blocks,omitempty"` +} + +func (x *CompactionJobPlan) Reset() { + *x = CompactionJobPlan{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompactionJobPlan) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompactionJobPlan) ProtoMessage() {} + +func (x *CompactionJobPlan) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[7] + 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 CompactionJobPlan.ProtoReflect.Descriptor instead. +func (*CompactionJobPlan) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{7} +} + +func (x *CompactionJobPlan) GetName() string { + if x != nil { + return x.Name } return "" } +func (x *CompactionJobPlan) GetTenant() string { + if x != nil { + return x.Tenant + } + return "" +} + +func (x *CompactionJobPlan) GetShard() uint32 { + if x != nil { + return x.Shard + } + return 0 +} + +func (x *CompactionJobPlan) GetCompactionLevel() uint32 { + if x != nil { + return x.CompactionLevel + } + return 0 +} + +func (x *CompactionJobPlan) GetSourceBlocks() []string { + if x != nil { + return x.SourceBlocks + } + return nil +} + +func (x *CompactionJobPlan) GetTombstones() []*v1.Tombstones { + if x != nil { + return x.Tombstones + } + return nil +} + +func (x *CompactionJobPlan) GetCompactedBlocks() *v1.CompactedBlocks { + if x != nil { + return x.CompactedBlocks + } + return nil +} + +// UpdateCompactionPlanRequest proposes compaction plan changes. +type UpdateCompactionPlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlanUpdate *CompactionPlanUpdate `protobuf:"bytes,1,opt,name=plan_update,json=planUpdate,proto3" json:"plan_update,omitempty"` +} + +func (x *UpdateCompactionPlanRequest) Reset() { + *x = UpdateCompactionPlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCompactionPlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCompactionPlanRequest) ProtoMessage() {} + +func (x *UpdateCompactionPlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_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 UpdateCompactionPlanRequest.ProtoReflect.Descriptor instead. +func (*UpdateCompactionPlanRequest) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateCompactionPlanRequest) GetPlanUpdate() *CompactionPlanUpdate { + if x != nil { + return x.PlanUpdate + } + return nil +} + +type UpdateCompactionPlanResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateCompactionPlanResponse) Reset() { + *x = UpdateCompactionPlanResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCompactionPlanResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCompactionPlanResponse) ProtoMessage() {} + +func (x *UpdateCompactionPlanResponse) ProtoReflect() protoreflect.Message { + mi := &file_metastore_v1_raft_log_raft_log_proto_msgTypes[9] + 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 UpdateCompactionPlanResponse.ProtoReflect.Descriptor instead. +func (*UpdateCompactionPlanResponse) Descriptor() ([]byte, []int) { + return file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP(), []int{9} +} + var File_metastore_v1_raft_log_raft_log_proto protoreflect.FileDescriptor var file_metastore_v1_raft_log_raft_log_proto_rawDesc = []byte{ 0x0a, 0x24, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2f, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, - 0x22, 0x33, 0x0a, 0x12, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x64, 0x2a, 0x89, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x66, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, - 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x1a, 0x0a, 0x16, 0x52, 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, - 0x41, 0x44, 0x44, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x52, - 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x50, 0x4f, 0x4c, 0x4c, - 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4a, 0x4f, 0x42, 0x53, - 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x43, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x53, 0x10, - 0x03, 0x42, 0x9d, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, - 0x6f, 0x67, 0x42, 0x0c, 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, - 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0xa2, 0x02, 0x03, 0x52, 0x58, 0x58, 0xaa, 0x02, 0x07, - 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, 0x67, 0xca, 0x02, 0x07, 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, - 0x67, 0xe2, 0x02, 0x13, 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, 0x67, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, - 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x1c, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, + 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x17, + 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, + 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1a, 0x0a, 0x18, + 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x61, 0x6e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0e, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x61, + 0x73, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x4a, 0x6f, 0x62, 0x73, + 0x4d, 0x61, 0x78, 0x22, 0x62, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, + 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x6c, 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x70, 0x6c, 0x61, + 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x38, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x42, 0x0a, 0x0d, 0x61, 0x73, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6a, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x0c, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x44, + 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6a, 0x6f, 0x62, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, + 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x4a, 0x6f, 0x62, 0x73, 0x22, 0x7a, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x61, 0x66, + 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x2f, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, + 0x22, 0x85, 0x02, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, + 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0e, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x64, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, + 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x11, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x6f, 0x62, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, + 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, + 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x12, 0x38, 0x0a, 0x0a, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x52, 0x0a, + 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x10, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x65, 0x64, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x5e, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x61, 0x66, 0x74, 0x5f, + 0x6c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, + 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x6e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xa2, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, 0x4d, + 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x23, + 0x0a, 0x1f, 0x52, 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x41, + 0x44, 0x44, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, + 0x41, 0x10, 0x01, 0x12, 0x2b, 0x0a, 0x27, 0x52, 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, + 0x41, 0x4e, 0x44, 0x5f, 0x47, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, + 0x12, 0x27, 0x0a, 0x23, 0x52, 0x41, 0x46, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, + 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, 0x03, 0x42, 0x9d, 0x01, 0x0a, 0x0c, 0x63, 0x6f, + 0x6d, 0x2e, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x42, 0x0c, 0x52, 0x61, 0x66, 0x74, + 0x4c, 0x6f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, + 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0xa2, + 0x02, 0x03, 0x52, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, 0x67, 0xca, + 0x02, 0x07, 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, 0x67, 0xe2, 0x02, 0x13, 0x52, 0x61, 0x66, 0x74, + 0x4c, 0x6f, 0x67, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x07, 0x52, 0x61, 0x66, 0x74, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -163,17 +805,43 @@ func file_metastore_v1_raft_log_raft_log_proto_rawDescGZIP() []byte { } var file_metastore_v1_raft_log_raft_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_metastore_v1_raft_log_raft_log_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_metastore_v1_raft_log_raft_log_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_metastore_v1_raft_log_raft_log_proto_goTypes = []any{ - (RaftCommand)(0), // 0: raft_log.RaftCommand - (*CleanBlocksRequest)(nil), // 1: raft_log.CleanBlocksRequest + (RaftCommand)(0), // 0: raft_log.RaftCommand + (*AddBlockMetadataRequest)(nil), // 1: raft_log.AddBlockMetadataRequest + (*AddBlockMetadataResponse)(nil), // 2: raft_log.AddBlockMetadataResponse + (*GetCompactionPlanUpdateRequest)(nil), // 3: raft_log.GetCompactionPlanUpdateRequest + (*GetCompactionPlanUpdateResponse)(nil), // 4: raft_log.GetCompactionPlanUpdateResponse + (*CompactionPlanUpdate)(nil), // 5: raft_log.CompactionPlanUpdate + (*CompactionJobUpdate)(nil), // 6: raft_log.CompactionJobUpdate + (*CompactionJobState)(nil), // 7: raft_log.CompactionJobState + (*CompactionJobPlan)(nil), // 8: raft_log.CompactionJobPlan + (*UpdateCompactionPlanRequest)(nil), // 9: raft_log.UpdateCompactionPlanRequest + (*UpdateCompactionPlanResponse)(nil), // 10: raft_log.UpdateCompactionPlanResponse + (*v1.BlockMeta)(nil), // 11: metastore.v1.BlockMeta + (*v1.CompactionJobStatusUpdate)(nil), // 12: metastore.v1.CompactionJobStatusUpdate + (v1.CompactionJobStatus)(0), // 13: metastore.v1.CompactionJobStatus + (*v1.Tombstones)(nil), // 14: metastore.v1.Tombstones + (*v1.CompactedBlocks)(nil), // 15: metastore.v1.CompactedBlocks } var file_metastore_v1_raft_log_raft_log_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 11, // 0: raft_log.AddBlockMetadataRequest.metadata:type_name -> metastore.v1.BlockMeta + 12, // 1: raft_log.GetCompactionPlanUpdateRequest.status_updates:type_name -> metastore.v1.CompactionJobStatusUpdate + 5, // 2: raft_log.GetCompactionPlanUpdateResponse.plan_update:type_name -> raft_log.CompactionPlanUpdate + 6, // 3: raft_log.CompactionPlanUpdate.new_jobs:type_name -> raft_log.CompactionJobUpdate + 6, // 4: raft_log.CompactionPlanUpdate.assigned_jobs:type_name -> raft_log.CompactionJobUpdate + 6, // 5: raft_log.CompactionPlanUpdate.completed_jobs:type_name -> raft_log.CompactionJobUpdate + 7, // 6: raft_log.CompactionJobUpdate.state:type_name -> raft_log.CompactionJobState + 8, // 7: raft_log.CompactionJobUpdate.plan:type_name -> raft_log.CompactionJobPlan + 13, // 8: raft_log.CompactionJobState.status:type_name -> metastore.v1.CompactionJobStatus + 14, // 9: raft_log.CompactionJobPlan.tombstones:type_name -> metastore.v1.Tombstones + 15, // 10: raft_log.CompactionJobPlan.compacted_blocks:type_name -> metastore.v1.CompactedBlocks + 5, // 11: raft_log.UpdateCompactionPlanRequest.plan_update:type_name -> raft_log.CompactionPlanUpdate + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_metastore_v1_raft_log_raft_log_proto_init() } @@ -183,7 +851,115 @@ func file_metastore_v1_raft_log_raft_log_proto_init() { } if !protoimpl.UnsafeEnabled { file_metastore_v1_raft_log_raft_log_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*CleanBlocksRequest); i { + switch v := v.(*AddBlockMetadataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*AddBlockMetadataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*GetCompactionPlanUpdateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*GetCompactionPlanUpdateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*CompactionPlanUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*CompactionJobUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*CompactionJobState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*CompactionJobPlan); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*UpdateCompactionPlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metastore_v1_raft_log_raft_log_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*UpdateCompactionPlanResponse); i { case 0: return &v.state case 1: @@ -201,7 +977,7 @@ func file_metastore_v1_raft_log_raft_log_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_metastore_v1_raft_log_raft_log_proto_rawDesc, NumEnums: 1, - NumMessages: 1, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/api/gen/proto/go/metastore/v1/raft_log/raft_log_vtproto.pb.go b/api/gen/proto/go/metastore/v1/raft_log/raft_log_vtproto.pb.go index 936eea6456..43beb85746 100644 --- a/api/gen/proto/go/metastore/v1/raft_log/raft_log_vtproto.pb.go +++ b/api/gen/proto/go/metastore/v1/raft_log/raft_log_vtproto.pb.go @@ -6,6 +6,7 @@ package raft_log import ( fmt "fmt" + v1 "github.com/grafana/pyroscope/api/gen/proto/go/metastore/v1" protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -19,12 +20,235 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -func (m *CleanBlocksRequest) CloneVT() *CleanBlocksRequest { +func (m *AddBlockMetadataRequest) CloneVT() *AddBlockMetadataRequest { if m == nil { - return (*CleanBlocksRequest)(nil) + return (*AddBlockMetadataRequest)(nil) } - r := new(CleanBlocksRequest) - r.RequestId = m.RequestId + r := new(AddBlockMetadataRequest) + if rhs := m.Metadata; rhs != nil { + if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *v1.BlockMeta }); ok { + r.Metadata = vtpb.CloneVT() + } else { + r.Metadata = proto.Clone(rhs).(*v1.BlockMeta) + } + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *AddBlockMetadataRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *AddBlockMetadataResponse) CloneVT() *AddBlockMetadataResponse { + if m == nil { + return (*AddBlockMetadataResponse)(nil) + } + r := new(AddBlockMetadataResponse) + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *AddBlockMetadataResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *GetCompactionPlanUpdateRequest) CloneVT() *GetCompactionPlanUpdateRequest { + if m == nil { + return (*GetCompactionPlanUpdateRequest)(nil) + } + r := new(GetCompactionPlanUpdateRequest) + r.AssignJobsMax = m.AssignJobsMax + if rhs := m.StatusUpdates; rhs != nil { + tmpContainer := make([]*v1.CompactionJobStatusUpdate, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface { + CloneVT() *v1.CompactionJobStatusUpdate + }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*v1.CompactionJobStatusUpdate) + } + } + r.StatusUpdates = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetCompactionPlanUpdateRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *GetCompactionPlanUpdateResponse) CloneVT() *GetCompactionPlanUpdateResponse { + if m == nil { + return (*GetCompactionPlanUpdateResponse)(nil) + } + r := new(GetCompactionPlanUpdateResponse) + r.PlanUpdate = m.PlanUpdate.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetCompactionPlanUpdateResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *CompactionPlanUpdate) CloneVT() *CompactionPlanUpdate { + if m == nil { + return (*CompactionPlanUpdate)(nil) + } + r := new(CompactionPlanUpdate) + if rhs := m.NewJobs; rhs != nil { + tmpContainer := make([]*CompactionJobUpdate, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.NewJobs = tmpContainer + } + if rhs := m.AssignedJobs; rhs != nil { + tmpContainer := make([]*CompactionJobUpdate, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.AssignedJobs = tmpContainer + } + if rhs := m.CompletedJobs; rhs != nil { + tmpContainer := make([]*CompactionJobUpdate, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.CompletedJobs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *CompactionPlanUpdate) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *CompactionJobUpdate) CloneVT() *CompactionJobUpdate { + if m == nil { + return (*CompactionJobUpdate)(nil) + } + r := new(CompactionJobUpdate) + r.State = m.State.CloneVT() + r.Plan = m.Plan.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *CompactionJobUpdate) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *CompactionJobState) CloneVT() *CompactionJobState { + if m == nil { + return (*CompactionJobState)(nil) + } + r := new(CompactionJobState) + r.Name = m.Name + r.CompactionLevel = m.CompactionLevel + r.Status = m.Status + r.Token = m.Token + r.LeaseExpiresAt = m.LeaseExpiresAt + r.AddedAt = m.AddedAt + r.Failures = m.Failures + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *CompactionJobState) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *CompactionJobPlan) CloneVT() *CompactionJobPlan { + if m == nil { + return (*CompactionJobPlan)(nil) + } + r := new(CompactionJobPlan) + r.Name = m.Name + r.Tenant = m.Tenant + r.Shard = m.Shard + r.CompactionLevel = m.CompactionLevel + if rhs := m.SourceBlocks; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.SourceBlocks = tmpContainer + } + if rhs := m.Tombstones; rhs != nil { + tmpContainer := make([]*v1.Tombstones, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *v1.Tombstones }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*v1.Tombstones) + } + } + r.Tombstones = tmpContainer + } + if rhs := m.CompactedBlocks; rhs != nil { + if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *v1.CompactedBlocks }); ok { + r.CompactedBlocks = vtpb.CloneVT() + } else { + r.CompactedBlocks = proto.Clone(rhs).(*v1.CompactedBlocks) + } + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *CompactionJobPlan) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UpdateCompactionPlanRequest) CloneVT() *UpdateCompactionPlanRequest { + if m == nil { + return (*UpdateCompactionPlanRequest)(nil) + } + r := new(UpdateCompactionPlanRequest) + r.PlanUpdate = m.PlanUpdate.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UpdateCompactionPlanRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UpdateCompactionPlanResponse) CloneVT() *UpdateCompactionPlanResponse { + if m == nil { + return (*UpdateCompactionPlanResponse)(nil) + } + r := new(UpdateCompactionPlanResponse) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -32,84 +256,2224 @@ func (m *CleanBlocksRequest) CloneVT() *CleanBlocksRequest { return r } -func (m *CleanBlocksRequest) CloneMessageVT() proto.Message { +func (m *UpdateCompactionPlanResponse) CloneMessageVT() proto.Message { return m.CloneVT() } -func (this *CleanBlocksRequest) EqualVT(that *CleanBlocksRequest) bool { +func (this *AddBlockMetadataRequest) EqualVT(that *AddBlockMetadataRequest) bool { if this == that { return true } else if this == nil || that == nil { return false } - if this.RequestId != that.RequestId { + if equal, ok := interface{}(this.Metadata).(interface{ EqualVT(*v1.BlockMeta) bool }); ok { + if !equal.EqualVT(that.Metadata) { + return false + } + } else if !proto.Equal(this.Metadata, that.Metadata) { return false } return string(this.unknownFields) == string(that.unknownFields) } -func (this *CleanBlocksRequest) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*CleanBlocksRequest) +func (this *AddBlockMetadataRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*AddBlockMetadataRequest) if !ok { return false } return this.EqualVT(that) } -func (m *CleanBlocksRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil +func (this *AddBlockMetadataResponse) EqualVT(that *AddBlockMetadataResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *AddBlockMetadataResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*AddBlockMetadataResponse) + if !ok { + return false } - return dAtA[:n], nil + return this.EqualVT(that) +} +func (this *GetCompactionPlanUpdateRequest) EqualVT(that *GetCompactionPlanUpdateRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.StatusUpdates) != len(that.StatusUpdates) { + return false + } + for i, vx := range this.StatusUpdates { + vy := that.StatusUpdates[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &v1.CompactionJobStatusUpdate{} + } + if q == nil { + q = &v1.CompactionJobStatusUpdate{} + } + if equal, ok := interface{}(p).(interface { + EqualVT(*v1.CompactionJobStatusUpdate) bool + }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if this.AssignJobsMax != that.AssignJobsMax { + return false + } + return string(this.unknownFields) == string(that.unknownFields) } -func (m *CleanBlocksRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +func (this *GetCompactionPlanUpdateRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*GetCompactionPlanUpdateRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *GetCompactionPlanUpdateResponse) EqualVT(that *GetCompactionPlanUpdateResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.PlanUpdate.EqualVT(that.PlanUpdate) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) } -func (m *CleanBlocksRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil +func (this *GetCompactionPlanUpdateResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*GetCompactionPlanUpdateResponse) + if !ok { + return false } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) + return this.EqualVT(that) +} +func (this *CompactionPlanUpdate) EqualVT(that *CompactionPlanUpdate) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false } - if len(m.RequestId) > 0 { - i -= len(m.RequestId) - copy(dAtA[i:], m.RequestId) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequestId))) - i-- - dAtA[i] = 0xa + if len(this.NewJobs) != len(that.NewJobs) { + return false + } + for i, vx := range this.NewJobs { + vy := that.NewJobs[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &CompactionJobUpdate{} + } + if q == nil { + q = &CompactionJobUpdate{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.AssignedJobs) != len(that.AssignedJobs) { + return false + } + for i, vx := range this.AssignedJobs { + vy := that.AssignedJobs[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &CompactionJobUpdate{} + } + if q == nil { + q = &CompactionJobUpdate{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.CompletedJobs) != len(that.CompletedJobs) { + return false + } + for i, vx := range this.CompletedJobs { + vy := that.CompletedJobs[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &CompactionJobUpdate{} + } + if q == nil { + q = &CompactionJobUpdate{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *CompactionPlanUpdate) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactionPlanUpdate) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *CompactionJobUpdate) EqualVT(that *CompactionJobUpdate) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.State.EqualVT(that.State) { + return false + } + if !this.Plan.EqualVT(that.Plan) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *CompactionJobUpdate) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactionJobUpdate) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *CompactionJobState) EqualVT(that *CompactionJobState) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.CompactionLevel != that.CompactionLevel { + return false + } + if this.Status != that.Status { + return false + } + if this.Token != that.Token { + return false + } + if this.LeaseExpiresAt != that.LeaseExpiresAt { + return false + } + if this.AddedAt != that.AddedAt { + return false + } + if this.Failures != that.Failures { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *CompactionJobState) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactionJobState) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *CompactionJobPlan) EqualVT(that *CompactionJobPlan) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Tenant != that.Tenant { + return false + } + if this.Shard != that.Shard { + return false + } + if this.CompactionLevel != that.CompactionLevel { + return false + } + if len(this.SourceBlocks) != len(that.SourceBlocks) { + return false + } + for i, vx := range this.SourceBlocks { + vy := that.SourceBlocks[i] + if vx != vy { + return false + } + } + if len(this.Tombstones) != len(that.Tombstones) { + return false + } + for i, vx := range this.Tombstones { + vy := that.Tombstones[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &v1.Tombstones{} + } + if q == nil { + q = &v1.Tombstones{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*v1.Tombstones) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if equal, ok := interface{}(this.CompactedBlocks).(interface { + EqualVT(*v1.CompactedBlocks) bool + }); ok { + if !equal.EqualVT(that.CompactedBlocks) { + return false + } + } else if !proto.Equal(this.CompactedBlocks, that.CompactedBlocks) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *CompactionJobPlan) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CompactionJobPlan) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UpdateCompactionPlanRequest) EqualVT(that *UpdateCompactionPlanRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.PlanUpdate.EqualVT(that.PlanUpdate) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UpdateCompactionPlanRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UpdateCompactionPlanRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UpdateCompactionPlanResponse) EqualVT(that *UpdateCompactionPlanResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UpdateCompactionPlanResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UpdateCompactionPlanResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *AddBlockMetadataRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddBlockMetadataRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *AddBlockMetadataRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Metadata != nil { + if vtmsg, ok := interface{}(m.Metadata).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Metadata) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddBlockMetadataResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddBlockMetadataResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *AddBlockMetadataResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *GetCompactionPlanUpdateRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetCompactionPlanUpdateRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetCompactionPlanUpdateRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.AssignJobsMax != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.AssignJobsMax)) + i-- + dAtA[i] = 0x10 + } + if len(m.StatusUpdates) > 0 { + for iNdEx := len(m.StatusUpdates) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.StatusUpdates[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.StatusUpdates[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GetCompactionPlanUpdateResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetCompactionPlanUpdateResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetCompactionPlanUpdateResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.PlanUpdate != nil { + size, err := m.PlanUpdate.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompactionPlanUpdate) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompactionPlanUpdate) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CompactionPlanUpdate) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.CompletedJobs) > 0 { + for iNdEx := len(m.CompletedJobs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.CompletedJobs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.AssignedJobs) > 0 { + for iNdEx := len(m.AssignedJobs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.AssignedJobs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.NewJobs) > 0 { + for iNdEx := len(m.NewJobs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.NewJobs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *CompactionJobUpdate) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompactionJobUpdate) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CompactionJobUpdate) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Plan != nil { + size, err := m.Plan.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.State != nil { + size, err := m.State.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompactionJobState) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompactionJobState) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CompactionJobState) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Failures != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Failures)) + i-- + dAtA[i] = 0x38 + } + if m.AddedAt != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.AddedAt)) + i-- + dAtA[i] = 0x30 + } + if m.LeaseExpiresAt != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LeaseExpiresAt)) + i-- + dAtA[i] = 0x28 + } + if m.Token != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Token)) + i-- + dAtA[i] = 0x20 + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x18 + } + if m.CompactionLevel != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.CompactionLevel)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompactionJobPlan) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompactionJobPlan) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CompactionJobPlan) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.CompactedBlocks != nil { + if vtmsg, ok := interface{}(m.CompactedBlocks).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.CompactedBlocks) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Tombstones) > 0 { + for iNdEx := len(m.Tombstones) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Tombstones[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Tombstones[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.SourceBlocks) > 0 { + for iNdEx := len(m.SourceBlocks) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SourceBlocks[iNdEx]) + copy(dAtA[i:], m.SourceBlocks[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SourceBlocks[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if m.CompactionLevel != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.CompactionLevel)) + i-- + dAtA[i] = 0x20 + } + if m.Shard != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Shard)) + i-- + dAtA[i] = 0x18 + } + if len(m.Tenant) > 0 { + i -= len(m.Tenant) + copy(dAtA[i:], m.Tenant) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Tenant))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateCompactionPlanRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateCompactionPlanRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateCompactionPlanRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.PlanUpdate != nil { + size, err := m.PlanUpdate.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateCompactionPlanResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateCompactionPlanResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateCompactionPlanResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *AddBlockMetadataRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + if size, ok := interface{}(m.Metadata).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Metadata) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *AddBlockMetadataResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *GetCompactionPlanUpdateRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.StatusUpdates) > 0 { + for _, e := range m.StatusUpdates { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.AssignJobsMax != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.AssignJobsMax)) + } + n += len(m.unknownFields) + return n +} + +func (m *GetCompactionPlanUpdateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PlanUpdate != nil { + l = m.PlanUpdate.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CompactionPlanUpdate) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.NewJobs) > 0 { + for _, e := range m.NewJobs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.AssignedJobs) > 0 { + for _, e := range m.AssignedJobs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.CompletedJobs) > 0 { + for _, e := range m.CompletedJobs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *CompactionJobUpdate) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != nil { + l = m.State.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Plan != nil { + l = m.Plan.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CompactionJobState) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.CompactionLevel != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.CompactionLevel)) + } + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + if m.Token != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Token)) + } + if m.LeaseExpiresAt != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LeaseExpiresAt)) + } + if m.AddedAt != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.AddedAt)) + } + if m.Failures != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Failures)) + } + n += len(m.unknownFields) + return n +} + +func (m *CompactionJobPlan) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Tenant) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Shard != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Shard)) + } + if m.CompactionLevel != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.CompactionLevel)) + } + if len(m.SourceBlocks) > 0 { + for _, s := range m.SourceBlocks { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Tombstones) > 0 { + for _, e := range m.Tombstones { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.CompactedBlocks != nil { + if size, ok := interface{}(m.CompactedBlocks).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.CompactedBlocks) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateCompactionPlanRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PlanUpdate != nil { + l = m.PlanUpdate.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateCompactionPlanResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *AddBlockMetadataRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddBlockMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddBlockMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &v1.BlockMeta{} + } + if unmarshal, ok := interface{}(m.Metadata).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Metadata); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddBlockMetadataResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddBlockMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddBlockMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCompactionPlanUpdateRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCompactionPlanUpdateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCompactionPlanUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StatusUpdates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StatusUpdates = append(m.StatusUpdates, &v1.CompactionJobStatusUpdate{}) + if unmarshal, ok := interface{}(m.StatusUpdates[len(m.StatusUpdates)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.StatusUpdates[len(m.StatusUpdates)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssignJobsMax", wireType) + } + m.AssignJobsMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssignJobsMax |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCompactionPlanUpdateResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCompactionPlanUpdateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCompactionPlanUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PlanUpdate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PlanUpdate == nil { + m.PlanUpdate = &CompactionPlanUpdate{} + } + if err := m.PlanUpdate.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactionPlanUpdate) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactionPlanUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactionPlanUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewJobs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewJobs = append(m.NewJobs, &CompactionJobUpdate{}) + if err := m.NewJobs[len(m.NewJobs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssignedJobs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssignedJobs = append(m.AssignedJobs, &CompactionJobUpdate{}) + if err := m.AssignedJobs[len(m.AssignedJobs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletedJobs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompletedJobs = append(m.CompletedJobs, &CompactionJobUpdate{}) + if err := m.CompletedJobs[len(m.CompletedJobs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactionJobUpdate) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactionJobUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactionJobUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.State == nil { + m.State = &CompactionJobState{} + } + if err := m.State.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Plan == nil { + m.Plan = &CompactionJobPlan{} + } + if err := m.Plan.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactionJobState) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactionJobState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactionJobState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactionLevel", wireType) + } + m.CompactionLevel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CompactionLevel |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= v1.CompactionJobStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + m.Token = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Token |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LeaseExpiresAt", wireType) + } + m.LeaseExpiresAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LeaseExpiresAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AddedAt", wireType) + } + m.AddedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AddedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Failures", wireType) + } + m.Failures = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Failures |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactionJobPlan) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactionJobPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactionJobPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tenant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + m.Shard = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Shard |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactionLevel", wireType) + } + m.CompactionLevel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CompactionLevel |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceBlocks", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceBlocks = append(m.SourceBlocks, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tombstones", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tombstones = append(m.Tombstones, &v1.Tombstones{}) + if unmarshal, ok := interface{}(m.Tombstones[len(m.Tombstones)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Tombstones[len(m.Tombstones)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactedBlocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CompactedBlocks == nil { + m.CompactedBlocks = &v1.CompactedBlocks{} + } + if unmarshal, ok := interface{}(m.CompactedBlocks).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.CompactedBlocks); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } } - return len(dAtA) - i, nil -} -func (m *CleanBlocksRequest) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RequestId) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if iNdEx > l { + return io.ErrUnexpectedEOF } - n += len(m.unknownFields) - return n + return nil } - -func (m *CleanBlocksRequest) UnmarshalVT(dAtA []byte) error { +func (m *UpdateCompactionPlanRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -132,17 +2496,17 @@ func (m *CleanBlocksRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CleanBlocksRequest: wiretype end group for non-group") + return fmt.Errorf("proto: UpdateCompactionPlanRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CleanBlocksRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UpdateCompactionPlanRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PlanUpdate", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -152,23 +2516,27 @@ func (m *CleanBlocksRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.RequestId = string(dAtA[iNdEx:postIndex]) + if m.PlanUpdate == nil { + m.PlanUpdate = &CompactionPlanUpdate{} + } + if err := m.PlanUpdate.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -192,3 +2560,54 @@ func (m *CleanBlocksRequest) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *UpdateCompactionPlanResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateCompactionPlanResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateCompactionPlanResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/api/metastore/v1/compactor.proto b/api/metastore/v1/compactor.proto index 5e1ce5a90c..52fbc663fa 100644 --- a/api/metastore/v1/compactor.proto +++ b/api/metastore/v1/compactor.proto @@ -11,84 +11,64 @@ service CompactionService { message PollCompactionJobsRequest { // A batch of status updates for in-progress jobs from a worker. - repeated CompactionJobStatus job_status_updates = 1; + repeated CompactionJobStatusUpdate status_updates = 1; // How many new jobs a worker can be assigned to. uint32 job_capacity = 2; } message PollCompactionJobsResponse { repeated CompactionJob compaction_jobs = 1; + repeated CompactionJobAssignment assignments = 2; } -message GetCompactionRequest {} +message CompactionJob { + string name = 1; + uint32 shard = 2; + string tenant = 3; + uint32 compaction_level = 4; + repeated string source_blocks = 5; + repeated Tombstones tombstones = 6; +} -message GetCompactionResponse { - // A list of all compaction jobs - repeated CompactionJob compaction_jobs = 1; +// Tombstones represent objects removed from the index but still stored. +message Tombstones { + BlockTombstones blocks = 1; + // For now, we only have block tombstones created due to the + // compaction process. Later, we may add more types of tombstones, + // e.g, deleted tenant (shard), partition, dataset, series etc. + // Exactly one member of Tombstones should be present. } -// One compaction job may result in multiple output blocks. -message CompactionJob { - // Unique name of the job. +message BlockTombstones { string name = 1; - CompactionOptions options = 2; - // List of the input blocks. - repeated metastore.v1.BlockMeta blocks = 3; - CompactionJobStatus status = 4; - // Fencing token. - uint64 raft_log_index = 5; - // Shard the blocks belong to. - uint32 shard = 6; - // Optional, empty for compaction level 0. - string tenant_id = 7; - uint32 compaction_level = 8; + uint32 shard = 2; + string tenant = 3; + uint32 compaction_level = 4; + repeated string blocks = 5; } -message CompactionOptions { - // Compaction planner should instruct the compactor - // worker how to compact the blocks: - // - Limits and tenant overrides. - // - Feature flags. +message CompactionJobAssignment { + string name = 1; + uint64 token = 2; + int64 lease_expires_at = 3; + CompactionJobStatus status = 4; +} - // How often the compaction worker should update - // the job status. If overdue, the job ownership - // is revoked. - uint64 status_update_interval_seconds = 1; +message CompactionJobStatusUpdate { + string name = 1; + uint64 token = 2; + CompactionJobStatus status = 3; + // Only present if the job completed successfully. + CompactedBlocks compacted_blocks = 4; } -message CompactionJobStatus { - string job_name = 1; - // Status update allows the planner to keep - // track of the job ownership and compaction - // progress: - // - If the job status is other than IN_PROGRESS, - // the ownership of the job is revoked. - // - FAILURE must only be sent if the failure is - // persistent and the compaction can't be accomplished. - // - completed_job must be empty if the status is - // other than SUCCESS, and vice-versa. - // - UNSPECIFIED must be sent if the worker rejects - // or cancels the compaction job. - // - // Partial results/status is not allowed. - CompactionStatus status = 2; - CompletedJob completed_job = 3; - // Fencing token. - uint64 raft_log_index = 4; - // Shard the blocks belong to. - uint32 shard = 5; - // Optional, empty for compaction level 0. - string tenant_id = 6; +message CompactedBlocks { + metastore.v1.BlockList source_blocks = 1; + repeated metastore.v1.BlockMeta compacted_blocks = 2; } -enum CompactionStatus { +enum CompactionJobStatus { COMPACTION_STATUS_UNSPECIFIED = 0; COMPACTION_STATUS_IN_PROGRESS = 1; COMPACTION_STATUS_SUCCESS = 2; - COMPACTION_STATUS_FAILURE = 3; - COMPACTION_STATUS_CANCELLED = 4; -} - -message CompletedJob { - repeated metastore.v1.BlockMeta blocks = 1; } diff --git a/api/metastore/v1/metastore.proto b/api/metastore/v1/metastore.proto index c2b4d4612a..6b63c17a91 100644 --- a/api/metastore/v1/metastore.proto +++ b/api/metastore/v1/metastore.proto @@ -6,6 +6,7 @@ import "types/v1/types.proto"; service IndexService { rpc AddBlock(AddBlockRequest) returns (AddBlockResponse) {} + rpc GetBlockMetadata(GetBlockMetadataRequest) returns (GetBlockMetadataResponse) {} } message AddBlockRequest { @@ -14,6 +15,20 @@ message AddBlockRequest { message AddBlockResponse {} +message GetBlockMetadataRequest { + BlockList blocks = 1; +} + +message GetBlockMetadataResponse { + repeated BlockMeta blocks = 1; +} + +message BlockList { + string tenant = 1; + uint32 shard = 2; + repeated string blocks = 3; +} + message BlockMeta { uint64 format_version = 1; string id = 2; diff --git a/api/metastore/v1/raft_log/raft_log.proto b/api/metastore/v1/raft_log/raft_log.proto index 56436bbd8e..c0b77b0dfd 100644 --- a/api/metastore/v1/raft_log/raft_log.proto +++ b/api/metastore/v1/raft_log/raft_log.proto @@ -2,13 +2,84 @@ syntax = "proto3"; package raft_log; +import "metastore/v1/metastore.proto"; +import "metastore/v1/compactor.proto"; + enum RaftCommand { RAFT_COMMAND_UNKNOWN = 0; - RAFT_COMMAND_ADD_BLOCK = 1; - RAFT_COMMAND_POLL_COMPACTION_JOBS = 2; - RAFT_COMMAND_CLEAN_BLOCKS = 3; + + RAFT_COMMAND_ADD_BLOCK_METADATA = 1; + + RAFT_COMMAND_GET_COMPACTION_PLAN_UPDATE = 2; + RAFT_COMMAND_UPDATE_COMPACTION_PLAN = 3; +} + +message AddBlockMetadataRequest { + metastore.v1.BlockMeta metadata = 1; +} + +message AddBlockMetadataResponse {} + +// GetCompactionPlanUpdateRequest requests CompactionPlanUpdate. +// The resulting plan should be proposed to the raft members. +// This is a read-only operation: it MUST NOT alter the state. +message GetCompactionPlanUpdateRequest { + // CompactionJobStatusUpdate is a change + // requested by the compaction worker. + repeated metastore.v1.CompactionJobStatusUpdate status_updates = 1; + uint32 assign_jobs_max = 2; +} + +// GetCompactionPlanUpdateResponse includes the planned change. +// The plan should be proposed to the raft members. +message GetCompactionPlanUpdateResponse { + CompactionPlanUpdate plan_update = 1; } -message CleanBlocksRequest { - string request_id = 1; +message CompactionPlanUpdate { + repeated CompactionJobUpdate new_jobs = 1; + repeated CompactionJobUpdate assigned_jobs = 2; + repeated CompactionJobUpdate completed_jobs = 3; } + +message CompactionJobUpdate { + CompactionJobState state = 1; + CompactionJobPlan plan = 2; +} + +// CompactionJobState is produced in response to +// the compaction worker status update request. +// +// Compaction level and other attributes that +// affect the scheduling order or status update +// handling should be included into the message. +message CompactionJobState { + string name = 1; + uint32 compaction_level = 2; + metastore.v1.CompactionJobStatus status = 3; + uint64 token = 4; + int64 lease_expires_at = 5; + int64 added_at = 6; + uint32 failures = 7; +} + +message CompactionJobPlan { + string name = 1; + // Blocks to be compacted. + string tenant = 2; + uint32 shard = 3; + uint32 compaction_level = 4; + repeated string source_blocks = 5; + // Objects to be deleted. + repeated metastore.v1.Tombstones tombstones = 6; + // Only present if the job completed successfully. + // Never stored in the metastore. + metastore.v1.CompactedBlocks compacted_blocks = 7; +} + +// UpdateCompactionPlanRequest proposes compaction plan changes. +message UpdateCompactionPlanRequest { + CompactionPlanUpdate plan_update = 1; +} + +message UpdateCompactionPlanResponse {} diff --git a/api/openapiv2/gen/phlare.swagger.json b/api/openapiv2/gen/phlare.swagger.json index 34d3261bdc..18d8de3820 100644 --- a/api/openapiv2/gen/phlare.swagger.json +++ b/api/openapiv2/gen/phlare.swagger.json @@ -567,6 +567,24 @@ } } }, + "v1BlockList": { + "type": "object", + "properties": { + "tenant": { + "type": "string" + }, + "shard": { + "type": "integer", + "format": "int64" + }, + "blocks": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "v1BlockMeta": { "type": "object", "properties": { @@ -655,6 +673,31 @@ } } }, + "v1BlockTombstones": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "shard": { + "type": "integer", + "format": "int64" + }, + "tenant": { + "type": "string" + }, + "compactionLevel": { + "type": "integer", + "format": "int64" + }, + "blocks": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "v1CommitAuthor": { "type": "object", "properties": { @@ -693,108 +736,97 @@ } } }, - "v1CompactionJob": { + "v1CompactedBlocks": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "Unique name of the job." + "sourceBlocks": { + "$ref": "#/definitions/v1BlockList" }, - "options": { - "$ref": "#/definitions/v1CompactionOptions" - }, - "blocks": { + "compactedBlocks": { "type": "array", "items": { "type": "object", "$ref": "#/definitions/v1BlockMeta" - }, - "description": "List of the input blocks." - }, - "status": { - "$ref": "#/definitions/v1CompactionJobStatus" - }, - "raftLogIndex": { - "type": "string", - "format": "uint64", - "description": "Fencing token." + } + } + } + }, + "v1CompactionJob": { + "type": "object", + "properties": { + "name": { + "type": "string" }, "shard": { "type": "integer", - "format": "int64", - "description": "Shard the blocks belong to." + "format": "int64" }, - "tenantId": { - "type": "string", - "description": "Optional, empty for compaction level 0." + "tenant": { + "type": "string" }, "compactionLevel": { "type": "integer", "format": "int64" + }, + "sourceBlocks": { + "type": "array", + "items": { + "type": "string" + } + }, + "tombstones": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Tombstones" + } } - }, - "description": "One compaction job may result in multiple output blocks." + } }, - "v1CompactionJobStatus": { + "v1CompactionJobAssignment": { "type": "object", "properties": { - "jobName": { + "name": { "type": "string" }, - "status": { - "$ref": "#/definitions/v1CompactionStatus", - "description": "Status update allows the planner to keep\ntrack of the job ownership and compaction\nprogress:\n- If the job status is other than IN_PROGRESS,\n the ownership of the job is revoked.\n- FAILURE must only be sent if the failure is\n persistent and the compaction can't be accomplished.\n- completed_job must be empty if the status is\n other than SUCCESS, and vice-versa.\n- UNSPECIFIED must be sent if the worker rejects\n or cancels the compaction job.\n\nPartial results/status is not allowed." - }, - "completedJob": { - "$ref": "#/definitions/v1CompletedJob" - }, - "raftLogIndex": { + "token": { "type": "string", - "format": "uint64", - "description": "Fencing token." - }, - "shard": { - "type": "integer", - "format": "int64", - "description": "Shard the blocks belong to." + "format": "uint64" }, - "tenantId": { + "leaseExpiresAt": { "type": "string", - "description": "Optional, empty for compaction level 0." + "format": "int64" + }, + "status": { + "$ref": "#/definitions/v1CompactionJobStatus" } } }, - "v1CompactionOptions": { - "type": "object", - "properties": { - "statusUpdateIntervalSeconds": { - "type": "string", - "format": "uint64", - "description": "How often the compaction worker should update\nthe job status. If overdue, the job ownership\nis revoked." - } - }, - "description": "Compaction planner should instruct the compactor\n worker how to compact the blocks:\n - Limits and tenant overrides.\n - Feature flags." - }, - "v1CompactionStatus": { + "v1CompactionJobStatus": { "type": "string", "enum": [ "COMPACTION_STATUS_UNSPECIFIED", "COMPACTION_STATUS_IN_PROGRESS", - "COMPACTION_STATUS_SUCCESS", - "COMPACTION_STATUS_FAILURE", - "COMPACTION_STATUS_CANCELLED" + "COMPACTION_STATUS_SUCCESS" ], "default": "COMPACTION_STATUS_UNSPECIFIED" }, - "v1CompletedJob": { + "v1CompactionJobStatusUpdate": { "type": "object", "properties": { - "blocks": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1BlockMeta" - } + "name": { + "type": "string" + }, + "token": { + "type": "string", + "format": "uint64" + }, + "status": { + "$ref": "#/definitions/v1CompactionJobStatus" + }, + "compactedBlocks": { + "$ref": "#/definitions/v1CompactedBlocks", + "description": "Only present if the job completed successfully." } } }, @@ -957,6 +989,18 @@ } } }, + "v1GetBlockMetadataResponse": { + "type": "object", + "properties": { + "blocks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1BlockMeta" + } + } + } + }, "v1GetBlockStatsResponse": { "type": "object", "properties": { @@ -1545,6 +1589,13 @@ "type": "object", "$ref": "#/definitions/v1CompactionJob" } + }, + "assignments": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1CompactionJobAssignment" + } } } }, @@ -2286,6 +2337,16 @@ } } }, + "v1Tombstones": { + "type": "object", + "properties": { + "blocks": { + "$ref": "#/definitions/v1BlockTombstones", + "description": "For now, we only have block tombstones created due to the\n compaction process. Later, we may add more types of tombstones,\n e.g, deleted tenant (shard), partition, dataset, series etc.\n Exactly one member of Tombstones should be present." + } + }, + "description": "Tombstones represent objects removed from the index but still stored." + }, "v1TreeQuery": { "type": "object", "properties": { diff --git a/cmd/profilecli/main.go b/cmd/profilecli/main.go index d0fe5d3e5a..a742feb9f8 100644 --- a/cmd/profilecli/main.go +++ b/cmd/profilecli/main.go @@ -98,7 +98,7 @@ func main() { readyCmd := app.Command("ready", "Check Pyroscope health.") readyParams := addReadyParams(readyCmd) - raftCmd := adminCmd.Command("raft", "Operate on Raft cluster.") + raftCmd := adminCmd.Command("raft", "Operate on Raft cluster.").Hidden() raftInfoCmd := raftCmd.Command("info", "Print info about a Raft node.") raftInfoParams := addRaftInfoParams(raftInfoCmd) diff --git a/docs/sources/configure-server/reference-configuration-parameters/index.md b/docs/sources/configure-server/reference-configuration-parameters/index.md index 69cedaaa66..e69de29bb2 100644 --- a/docs/sources/configure-server/reference-configuration-parameters/index.md +++ b/docs/sources/configure-server/reference-configuration-parameters/index.md @@ -1,2278 +0,0 @@ ---- -description: Describes parameters used to configure Pyroscope. -menuTitle: Configuration parameters -title: Pyroscope configuration parameters -weight: 70 -aliases: - - /docs/phlare/latest/operators-guide/configuring/reference-configuration-parameters/ - - /docs/phlare/latest/configure-server/reference-configuration-parameters/ ---- - -# Pyroscope configuration parameters - - - -You can configure Pyroscope by using a YAML file or via command-line flags -that represent configuration parameters. -To specify the YAML file, use the `-config.file` command-line option. -If you specify both the command-line flags and YAML configuration parameters, -the command-line flags take precedence over values in a YAML file. - -To see the current configuration of any component, -go to the `/config` HTTP API endpoint. -Passwords are filtered out of this endpoint. - -Parameters are -written in [YAML format](https://en.wikipedia.org/wiki/YAML), and -brackets indicate that a parameter is optional. - -## Generic placeholders - -- ``: a boolean that can take the values `true` or `false` -- ``: any integer matching the regular expression `[1-9]+[0-9]*` -- ``: a duration matching the regular expression `[0-9]+(ns|us|µs|ms|s|m|h|d|w|y)` where y = 365 days -- ``: a string -- ``: a URL -- ``: a string containing an absolute or relative path and filename to a file on disk -- ``: a CLI flag prefix based on the context (look at the parent configuration block to see which CLI flags prefix should be used) -- ``: a [Prometheus relabeling configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config) -- `