From de7dddbe5907e053744a80100542c361db5dcd3a Mon Sep 17 00:00:00 2001 From: Michal Niewrzal Date: Tue, 6 Aug 2019 16:56:23 +0200 Subject: [PATCH] metainfo: Batch request (#2694) --- pkg/pb/metainfo.pb.go | 1807 ++++++++++++++++++++++++--- pkg/pb/metainfo.proto | 64 + proto.lock | 217 ++++ satellite/metainfo/batch.go | 215 ++++ satellite/metainfo/metainfo_test.go | 122 +- uplink/metainfo/batch.go | 142 +++ uplink/metainfo/client.go | 747 ++++++++--- uplink/storage/buckets/store.go | 24 +- 8 files changed, 2988 insertions(+), 350 deletions(-) create mode 100644 satellite/metainfo/batch.go create mode 100644 uplink/metainfo/batch.go diff --git a/pkg/pb/metainfo.pb.go b/pkg/pb/metainfo.pb.go index 381f0ae4f..4118fd740 100644 --- a/pkg/pb/metainfo.pb.go +++ b/pkg/pb/metainfo.pb.go @@ -3450,6 +3450,1360 @@ func (m *SegmentDownloadResponse) GetNext() *SegmentPosition { return nil } +type BatchRequest struct { + Requests []*BatchRequestItem `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchRequest) Reset() { *m = BatchRequest{} } +func (m *BatchRequest) String() string { return proto.CompactTextString(m) } +func (*BatchRequest) ProtoMessage() {} +func (*BatchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{66} +} +func (m *BatchRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchRequest.Unmarshal(m, b) +} +func (m *BatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchRequest.Marshal(b, m, deterministic) +} +func (m *BatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchRequest.Merge(m, src) +} +func (m *BatchRequest) XXX_Size() int { + return xxx_messageInfo_BatchRequest.Size(m) +} +func (m *BatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BatchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchRequest proto.InternalMessageInfo + +func (m *BatchRequest) GetRequests() []*BatchRequestItem { + if m != nil { + return m.Requests + } + return nil +} + +type BatchRequestItem struct { + // Types that are valid to be assigned to Request: + // *BatchRequestItem_BucketCreate + // *BatchRequestItem_BucketGet + // *BatchRequestItem_BucketDelete + // *BatchRequestItem_BucketList + // *BatchRequestItem_BucketSetAttribution + // *BatchRequestItem_ObjectBegin + // *BatchRequestItem_ObjectCommit + // *BatchRequestItem_ObjectGet + // *BatchRequestItem_ObjectList + // *BatchRequestItem_ObjectBeginDelete + // *BatchRequestItem_ObjectFinishDelete + // *BatchRequestItem_SegmentBegin + // *BatchRequestItem_SegmentCommit + // *BatchRequestItem_SegmentMakeInline + // *BatchRequestItem_SegmentBeginDelete + // *BatchRequestItem_SegmentFinishDelete + // *BatchRequestItem_SegmentList + // *BatchRequestItem_SegmentDownload + Request isBatchRequestItem_Request `protobuf_oneof:"Request"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchRequestItem) Reset() { *m = BatchRequestItem{} } +func (m *BatchRequestItem) String() string { return proto.CompactTextString(m) } +func (*BatchRequestItem) ProtoMessage() {} +func (*BatchRequestItem) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{67} +} +func (m *BatchRequestItem) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchRequestItem.Unmarshal(m, b) +} +func (m *BatchRequestItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchRequestItem.Marshal(b, m, deterministic) +} +func (m *BatchRequestItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchRequestItem.Merge(m, src) +} +func (m *BatchRequestItem) XXX_Size() int { + return xxx_messageInfo_BatchRequestItem.Size(m) +} +func (m *BatchRequestItem) XXX_DiscardUnknown() { + xxx_messageInfo_BatchRequestItem.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchRequestItem proto.InternalMessageInfo + +type isBatchRequestItem_Request interface { + isBatchRequestItem_Request() +} + +type BatchRequestItem_BucketCreate struct { + BucketCreate *BucketCreateRequest `protobuf:"bytes,1,opt,name=bucket_create,json=bucketCreate,proto3,oneof"` +} +type BatchRequestItem_BucketGet struct { + BucketGet *BucketGetRequest `protobuf:"bytes,2,opt,name=bucket_get,json=bucketGet,proto3,oneof"` +} +type BatchRequestItem_BucketDelete struct { + BucketDelete *BucketDeleteRequest `protobuf:"bytes,3,opt,name=bucket_delete,json=bucketDelete,proto3,oneof"` +} +type BatchRequestItem_BucketList struct { + BucketList *BucketListRequest `protobuf:"bytes,4,opt,name=bucket_list,json=bucketList,proto3,oneof"` +} +type BatchRequestItem_BucketSetAttribution struct { + BucketSetAttribution *BucketSetAttributionRequest `protobuf:"bytes,5,opt,name=bucket_set_attribution,json=bucketSetAttribution,proto3,oneof"` +} +type BatchRequestItem_ObjectBegin struct { + ObjectBegin *ObjectBeginRequest `protobuf:"bytes,6,opt,name=object_begin,json=objectBegin,proto3,oneof"` +} +type BatchRequestItem_ObjectCommit struct { + ObjectCommit *ObjectCommitRequest `protobuf:"bytes,7,opt,name=object_commit,json=objectCommit,proto3,oneof"` +} +type BatchRequestItem_ObjectGet struct { + ObjectGet *ObjectGetRequest `protobuf:"bytes,8,opt,name=object_get,json=objectGet,proto3,oneof"` +} +type BatchRequestItem_ObjectList struct { + ObjectList *ObjectListRequest `protobuf:"bytes,9,opt,name=object_list,json=objectList,proto3,oneof"` +} +type BatchRequestItem_ObjectBeginDelete struct { + ObjectBeginDelete *ObjectBeginDeleteRequest `protobuf:"bytes,10,opt,name=object_begin_delete,json=objectBeginDelete,proto3,oneof"` +} +type BatchRequestItem_ObjectFinishDelete struct { + ObjectFinishDelete *ObjectFinishDeleteRequest `protobuf:"bytes,11,opt,name=object_finish_delete,json=objectFinishDelete,proto3,oneof"` +} +type BatchRequestItem_SegmentBegin struct { + SegmentBegin *SegmentBeginRequest `protobuf:"bytes,12,opt,name=segment_begin,json=segmentBegin,proto3,oneof"` +} +type BatchRequestItem_SegmentCommit struct { + SegmentCommit *SegmentCommitRequest `protobuf:"bytes,13,opt,name=segment_commit,json=segmentCommit,proto3,oneof"` +} +type BatchRequestItem_SegmentMakeInline struct { + SegmentMakeInline *SegmentMakeInlineRequest `protobuf:"bytes,14,opt,name=segment_make_inline,json=segmentMakeInline,proto3,oneof"` +} +type BatchRequestItem_SegmentBeginDelete struct { + SegmentBeginDelete *SegmentBeginDeleteRequest `protobuf:"bytes,15,opt,name=segment_begin_delete,json=segmentBeginDelete,proto3,oneof"` +} +type BatchRequestItem_SegmentFinishDelete struct { + SegmentFinishDelete *SegmentFinishDeleteRequest `protobuf:"bytes,16,opt,name=segment_finish_delete,json=segmentFinishDelete,proto3,oneof"` +} +type BatchRequestItem_SegmentList struct { + SegmentList *SegmentListRequest `protobuf:"bytes,17,opt,name=segment_list,json=segmentList,proto3,oneof"` +} +type BatchRequestItem_SegmentDownload struct { + SegmentDownload *SegmentDownloadRequest `protobuf:"bytes,18,opt,name=segment_download,json=segmentDownload,proto3,oneof"` +} + +func (*BatchRequestItem_BucketCreate) isBatchRequestItem_Request() {} +func (*BatchRequestItem_BucketGet) isBatchRequestItem_Request() {} +func (*BatchRequestItem_BucketDelete) isBatchRequestItem_Request() {} +func (*BatchRequestItem_BucketList) isBatchRequestItem_Request() {} +func (*BatchRequestItem_BucketSetAttribution) isBatchRequestItem_Request() {} +func (*BatchRequestItem_ObjectBegin) isBatchRequestItem_Request() {} +func (*BatchRequestItem_ObjectCommit) isBatchRequestItem_Request() {} +func (*BatchRequestItem_ObjectGet) isBatchRequestItem_Request() {} +func (*BatchRequestItem_ObjectList) isBatchRequestItem_Request() {} +func (*BatchRequestItem_ObjectBeginDelete) isBatchRequestItem_Request() {} +func (*BatchRequestItem_ObjectFinishDelete) isBatchRequestItem_Request() {} +func (*BatchRequestItem_SegmentBegin) isBatchRequestItem_Request() {} +func (*BatchRequestItem_SegmentCommit) isBatchRequestItem_Request() {} +func (*BatchRequestItem_SegmentMakeInline) isBatchRequestItem_Request() {} +func (*BatchRequestItem_SegmentBeginDelete) isBatchRequestItem_Request() {} +func (*BatchRequestItem_SegmentFinishDelete) isBatchRequestItem_Request() {} +func (*BatchRequestItem_SegmentList) isBatchRequestItem_Request() {} +func (*BatchRequestItem_SegmentDownload) isBatchRequestItem_Request() {} + +func (m *BatchRequestItem) GetRequest() isBatchRequestItem_Request { + if m != nil { + return m.Request + } + return nil +} + +func (m *BatchRequestItem) GetBucketCreate() *BucketCreateRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_BucketCreate); ok { + return x.BucketCreate + } + return nil +} + +func (m *BatchRequestItem) GetBucketGet() *BucketGetRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_BucketGet); ok { + return x.BucketGet + } + return nil +} + +func (m *BatchRequestItem) GetBucketDelete() *BucketDeleteRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_BucketDelete); ok { + return x.BucketDelete + } + return nil +} + +func (m *BatchRequestItem) GetBucketList() *BucketListRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_BucketList); ok { + return x.BucketList + } + return nil +} + +func (m *BatchRequestItem) GetBucketSetAttribution() *BucketSetAttributionRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_BucketSetAttribution); ok { + return x.BucketSetAttribution + } + return nil +} + +func (m *BatchRequestItem) GetObjectBegin() *ObjectBeginRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_ObjectBegin); ok { + return x.ObjectBegin + } + return nil +} + +func (m *BatchRequestItem) GetObjectCommit() *ObjectCommitRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_ObjectCommit); ok { + return x.ObjectCommit + } + return nil +} + +func (m *BatchRequestItem) GetObjectGet() *ObjectGetRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_ObjectGet); ok { + return x.ObjectGet + } + return nil +} + +func (m *BatchRequestItem) GetObjectList() *ObjectListRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_ObjectList); ok { + return x.ObjectList + } + return nil +} + +func (m *BatchRequestItem) GetObjectBeginDelete() *ObjectBeginDeleteRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_ObjectBeginDelete); ok { + return x.ObjectBeginDelete + } + return nil +} + +func (m *BatchRequestItem) GetObjectFinishDelete() *ObjectFinishDeleteRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_ObjectFinishDelete); ok { + return x.ObjectFinishDelete + } + return nil +} + +func (m *BatchRequestItem) GetSegmentBegin() *SegmentBeginRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_SegmentBegin); ok { + return x.SegmentBegin + } + return nil +} + +func (m *BatchRequestItem) GetSegmentCommit() *SegmentCommitRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_SegmentCommit); ok { + return x.SegmentCommit + } + return nil +} + +func (m *BatchRequestItem) GetSegmentMakeInline() *SegmentMakeInlineRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_SegmentMakeInline); ok { + return x.SegmentMakeInline + } + return nil +} + +func (m *BatchRequestItem) GetSegmentBeginDelete() *SegmentBeginDeleteRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_SegmentBeginDelete); ok { + return x.SegmentBeginDelete + } + return nil +} + +func (m *BatchRequestItem) GetSegmentFinishDelete() *SegmentFinishDeleteRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_SegmentFinishDelete); ok { + return x.SegmentFinishDelete + } + return nil +} + +func (m *BatchRequestItem) GetSegmentList() *SegmentListRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_SegmentList); ok { + return x.SegmentList + } + return nil +} + +func (m *BatchRequestItem) GetSegmentDownload() *SegmentDownloadRequest { + if x, ok := m.GetRequest().(*BatchRequestItem_SegmentDownload); ok { + return x.SegmentDownload + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BatchRequestItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BatchRequestItem_OneofMarshaler, _BatchRequestItem_OneofUnmarshaler, _BatchRequestItem_OneofSizer, []interface{}{ + (*BatchRequestItem_BucketCreate)(nil), + (*BatchRequestItem_BucketGet)(nil), + (*BatchRequestItem_BucketDelete)(nil), + (*BatchRequestItem_BucketList)(nil), + (*BatchRequestItem_BucketSetAttribution)(nil), + (*BatchRequestItem_ObjectBegin)(nil), + (*BatchRequestItem_ObjectCommit)(nil), + (*BatchRequestItem_ObjectGet)(nil), + (*BatchRequestItem_ObjectList)(nil), + (*BatchRequestItem_ObjectBeginDelete)(nil), + (*BatchRequestItem_ObjectFinishDelete)(nil), + (*BatchRequestItem_SegmentBegin)(nil), + (*BatchRequestItem_SegmentCommit)(nil), + (*BatchRequestItem_SegmentMakeInline)(nil), + (*BatchRequestItem_SegmentBeginDelete)(nil), + (*BatchRequestItem_SegmentFinishDelete)(nil), + (*BatchRequestItem_SegmentList)(nil), + (*BatchRequestItem_SegmentDownload)(nil), + } +} + +func _BatchRequestItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BatchRequestItem) + // Request + switch x := m.Request.(type) { + case *BatchRequestItem_BucketCreate: + _ = b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketCreate); err != nil { + return err + } + case *BatchRequestItem_BucketGet: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketGet); err != nil { + return err + } + case *BatchRequestItem_BucketDelete: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketDelete); err != nil { + return err + } + case *BatchRequestItem_BucketList: + _ = b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketList); err != nil { + return err + } + case *BatchRequestItem_BucketSetAttribution: + _ = b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketSetAttribution); err != nil { + return err + } + case *BatchRequestItem_ObjectBegin: + _ = b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectBegin); err != nil { + return err + } + case *BatchRequestItem_ObjectCommit: + _ = b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectCommit); err != nil { + return err + } + case *BatchRequestItem_ObjectGet: + _ = b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectGet); err != nil { + return err + } + case *BatchRequestItem_ObjectList: + _ = b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectList); err != nil { + return err + } + case *BatchRequestItem_ObjectBeginDelete: + _ = b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectBeginDelete); err != nil { + return err + } + case *BatchRequestItem_ObjectFinishDelete: + _ = b.EncodeVarint(11<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectFinishDelete); err != nil { + return err + } + case *BatchRequestItem_SegmentBegin: + _ = b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentBegin); err != nil { + return err + } + case *BatchRequestItem_SegmentCommit: + _ = b.EncodeVarint(13<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentCommit); err != nil { + return err + } + case *BatchRequestItem_SegmentMakeInline: + _ = b.EncodeVarint(14<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentMakeInline); err != nil { + return err + } + case *BatchRequestItem_SegmentBeginDelete: + _ = b.EncodeVarint(15<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentBeginDelete); err != nil { + return err + } + case *BatchRequestItem_SegmentFinishDelete: + _ = b.EncodeVarint(16<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentFinishDelete); err != nil { + return err + } + case *BatchRequestItem_SegmentList: + _ = b.EncodeVarint(17<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentList); err != nil { + return err + } + case *BatchRequestItem_SegmentDownload: + _ = b.EncodeVarint(18<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentDownload); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("BatchRequestItem.Request has unexpected type %T", x) + } + return nil +} + +func _BatchRequestItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BatchRequestItem) + switch tag { + case 1: // Request.bucket_create + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketCreateRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_BucketCreate{msg} + return true, err + case 2: // Request.bucket_get + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketGetRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_BucketGet{msg} + return true, err + case 3: // Request.bucket_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketDeleteRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_BucketDelete{msg} + return true, err + case 4: // Request.bucket_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketListRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_BucketList{msg} + return true, err + case 5: // Request.bucket_set_attribution + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketSetAttributionRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_BucketSetAttribution{msg} + return true, err + case 6: // Request.object_begin + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectBeginRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_ObjectBegin{msg} + return true, err + case 7: // Request.object_commit + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectCommitRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_ObjectCommit{msg} + return true, err + case 8: // Request.object_get + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectGetRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_ObjectGet{msg} + return true, err + case 9: // Request.object_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectListRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_ObjectList{msg} + return true, err + case 10: // Request.object_begin_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectBeginDeleteRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_ObjectBeginDelete{msg} + return true, err + case 11: // Request.object_finish_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectFinishDeleteRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_ObjectFinishDelete{msg} + return true, err + case 12: // Request.segment_begin + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentBeginRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_SegmentBegin{msg} + return true, err + case 13: // Request.segment_commit + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentCommitRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_SegmentCommit{msg} + return true, err + case 14: // Request.segment_make_inline + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentMakeInlineRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_SegmentMakeInline{msg} + return true, err + case 15: // Request.segment_begin_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentBeginDeleteRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_SegmentBeginDelete{msg} + return true, err + case 16: // Request.segment_finish_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentFinishDeleteRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_SegmentFinishDelete{msg} + return true, err + case 17: // Request.segment_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentListRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_SegmentList{msg} + return true, err + case 18: // Request.segment_download + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentDownloadRequest) + err := b.DecodeMessage(msg) + m.Request = &BatchRequestItem_SegmentDownload{msg} + return true, err + default: + return false, nil + } +} + +func _BatchRequestItem_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BatchRequestItem) + // Request + switch x := m.Request.(type) { + case *BatchRequestItem_BucketCreate: + s := proto.Size(x.BucketCreate) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_BucketGet: + s := proto.Size(x.BucketGet) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_BucketDelete: + s := proto.Size(x.BucketDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_BucketList: + s := proto.Size(x.BucketList) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_BucketSetAttribution: + s := proto.Size(x.BucketSetAttribution) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_ObjectBegin: + s := proto.Size(x.ObjectBegin) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_ObjectCommit: + s := proto.Size(x.ObjectCommit) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_ObjectGet: + s := proto.Size(x.ObjectGet) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_ObjectList: + s := proto.Size(x.ObjectList) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_ObjectBeginDelete: + s := proto.Size(x.ObjectBeginDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_ObjectFinishDelete: + s := proto.Size(x.ObjectFinishDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_SegmentBegin: + s := proto.Size(x.SegmentBegin) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_SegmentCommit: + s := proto.Size(x.SegmentCommit) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_SegmentMakeInline: + s := proto.Size(x.SegmentMakeInline) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_SegmentBeginDelete: + s := proto.Size(x.SegmentBeginDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_SegmentFinishDelete: + s := proto.Size(x.SegmentFinishDelete) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_SegmentList: + s := proto.Size(x.SegmentList) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchRequestItem_SegmentDownload: + s := proto.Size(x.SegmentDownload) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type BatchResponse struct { + Responses []*BatchResponseItem `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchResponse) Reset() { *m = BatchResponse{} } +func (m *BatchResponse) String() string { return proto.CompactTextString(m) } +func (*BatchResponse) ProtoMessage() {} +func (*BatchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{68} +} +func (m *BatchResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchResponse.Unmarshal(m, b) +} +func (m *BatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchResponse.Marshal(b, m, deterministic) +} +func (m *BatchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchResponse.Merge(m, src) +} +func (m *BatchResponse) XXX_Size() int { + return xxx_messageInfo_BatchResponse.Size(m) +} +func (m *BatchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BatchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchResponse proto.InternalMessageInfo + +func (m *BatchResponse) GetResponses() []*BatchResponseItem { + if m != nil { + return m.Responses + } + return nil +} + +type BatchResponseItem struct { + // Types that are valid to be assigned to Response: + // *BatchResponseItem_BucketCreate + // *BatchResponseItem_BucketGet + // *BatchResponseItem_BucketDelete + // *BatchResponseItem_BucketList + // *BatchResponseItem_BucketSetAttribution + // *BatchResponseItem_ObjectBegin + // *BatchResponseItem_ObjectCommit + // *BatchResponseItem_ObjectGet + // *BatchResponseItem_ObjectList + // *BatchResponseItem_ObjectBeginDelete + // *BatchResponseItem_ObjectFinishDelete + // *BatchResponseItem_SegmentBegin + // *BatchResponseItem_SegmentCommit + // *BatchResponseItem_SegmentMakeInline + // *BatchResponseItem_SegmentBeginDelete + // *BatchResponseItem_SegmentFinishDelete + // *BatchResponseItem_SegmentList + // *BatchResponseItem_SegmentDownload + Response isBatchResponseItem_Response `protobuf_oneof:"Response"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchResponseItem) Reset() { *m = BatchResponseItem{} } +func (m *BatchResponseItem) String() string { return proto.CompactTextString(m) } +func (*BatchResponseItem) ProtoMessage() {} +func (*BatchResponseItem) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{69} +} +func (m *BatchResponseItem) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchResponseItem.Unmarshal(m, b) +} +func (m *BatchResponseItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchResponseItem.Marshal(b, m, deterministic) +} +func (m *BatchResponseItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchResponseItem.Merge(m, src) +} +func (m *BatchResponseItem) XXX_Size() int { + return xxx_messageInfo_BatchResponseItem.Size(m) +} +func (m *BatchResponseItem) XXX_DiscardUnknown() { + xxx_messageInfo_BatchResponseItem.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchResponseItem proto.InternalMessageInfo + +type isBatchResponseItem_Response interface { + isBatchResponseItem_Response() +} + +type BatchResponseItem_BucketCreate struct { + BucketCreate *BucketCreateResponse `protobuf:"bytes,1,opt,name=bucket_create,json=bucketCreate,proto3,oneof"` +} +type BatchResponseItem_BucketGet struct { + BucketGet *BucketGetResponse `protobuf:"bytes,2,opt,name=bucket_get,json=bucketGet,proto3,oneof"` +} +type BatchResponseItem_BucketDelete struct { + BucketDelete *BucketDeleteResponse `protobuf:"bytes,3,opt,name=bucket_delete,json=bucketDelete,proto3,oneof"` +} +type BatchResponseItem_BucketList struct { + BucketList *BucketListResponse `protobuf:"bytes,4,opt,name=bucket_list,json=bucketList,proto3,oneof"` +} +type BatchResponseItem_BucketSetAttribution struct { + BucketSetAttribution *BucketSetAttributionResponse `protobuf:"bytes,5,opt,name=bucket_set_attribution,json=bucketSetAttribution,proto3,oneof"` +} +type BatchResponseItem_ObjectBegin struct { + ObjectBegin *ObjectBeginResponse `protobuf:"bytes,6,opt,name=object_begin,json=objectBegin,proto3,oneof"` +} +type BatchResponseItem_ObjectCommit struct { + ObjectCommit *ObjectCommitResponse `protobuf:"bytes,7,opt,name=object_commit,json=objectCommit,proto3,oneof"` +} +type BatchResponseItem_ObjectGet struct { + ObjectGet *ObjectGetResponse `protobuf:"bytes,8,opt,name=object_get,json=objectGet,proto3,oneof"` +} +type BatchResponseItem_ObjectList struct { + ObjectList *ObjectListResponse `protobuf:"bytes,9,opt,name=object_list,json=objectList,proto3,oneof"` +} +type BatchResponseItem_ObjectBeginDelete struct { + ObjectBeginDelete *ObjectBeginDeleteResponse `protobuf:"bytes,10,opt,name=object_begin_delete,json=objectBeginDelete,proto3,oneof"` +} +type BatchResponseItem_ObjectFinishDelete struct { + ObjectFinishDelete *ObjectFinishDeleteResponse `protobuf:"bytes,11,opt,name=object_finish_delete,json=objectFinishDelete,proto3,oneof"` +} +type BatchResponseItem_SegmentBegin struct { + SegmentBegin *SegmentBeginResponse `protobuf:"bytes,12,opt,name=segment_begin,json=segmentBegin,proto3,oneof"` +} +type BatchResponseItem_SegmentCommit struct { + SegmentCommit *SegmentCommitResponse `protobuf:"bytes,13,opt,name=segment_commit,json=segmentCommit,proto3,oneof"` +} +type BatchResponseItem_SegmentMakeInline struct { + SegmentMakeInline *SegmentMakeInlineResponse `protobuf:"bytes,14,opt,name=segment_make_inline,json=segmentMakeInline,proto3,oneof"` +} +type BatchResponseItem_SegmentBeginDelete struct { + SegmentBeginDelete *SegmentBeginDeleteResponse `protobuf:"bytes,15,opt,name=segment_begin_delete,json=segmentBeginDelete,proto3,oneof"` +} +type BatchResponseItem_SegmentFinishDelete struct { + SegmentFinishDelete *SegmentFinishDeleteResponse `protobuf:"bytes,16,opt,name=segment_finish_delete,json=segmentFinishDelete,proto3,oneof"` +} +type BatchResponseItem_SegmentList struct { + SegmentList *SegmentListResponse `protobuf:"bytes,17,opt,name=segment_list,json=segmentList,proto3,oneof"` +} +type BatchResponseItem_SegmentDownload struct { + SegmentDownload *SegmentDownloadResponse `protobuf:"bytes,18,opt,name=segment_download,json=segmentDownload,proto3,oneof"` +} + +func (*BatchResponseItem_BucketCreate) isBatchResponseItem_Response() {} +func (*BatchResponseItem_BucketGet) isBatchResponseItem_Response() {} +func (*BatchResponseItem_BucketDelete) isBatchResponseItem_Response() {} +func (*BatchResponseItem_BucketList) isBatchResponseItem_Response() {} +func (*BatchResponseItem_BucketSetAttribution) isBatchResponseItem_Response() {} +func (*BatchResponseItem_ObjectBegin) isBatchResponseItem_Response() {} +func (*BatchResponseItem_ObjectCommit) isBatchResponseItem_Response() {} +func (*BatchResponseItem_ObjectGet) isBatchResponseItem_Response() {} +func (*BatchResponseItem_ObjectList) isBatchResponseItem_Response() {} +func (*BatchResponseItem_ObjectBeginDelete) isBatchResponseItem_Response() {} +func (*BatchResponseItem_ObjectFinishDelete) isBatchResponseItem_Response() {} +func (*BatchResponseItem_SegmentBegin) isBatchResponseItem_Response() {} +func (*BatchResponseItem_SegmentCommit) isBatchResponseItem_Response() {} +func (*BatchResponseItem_SegmentMakeInline) isBatchResponseItem_Response() {} +func (*BatchResponseItem_SegmentBeginDelete) isBatchResponseItem_Response() {} +func (*BatchResponseItem_SegmentFinishDelete) isBatchResponseItem_Response() {} +func (*BatchResponseItem_SegmentList) isBatchResponseItem_Response() {} +func (*BatchResponseItem_SegmentDownload) isBatchResponseItem_Response() {} + +func (m *BatchResponseItem) GetResponse() isBatchResponseItem_Response { + if m != nil { + return m.Response + } + return nil +} + +func (m *BatchResponseItem) GetBucketCreate() *BucketCreateResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_BucketCreate); ok { + return x.BucketCreate + } + return nil +} + +func (m *BatchResponseItem) GetBucketGet() *BucketGetResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_BucketGet); ok { + return x.BucketGet + } + return nil +} + +func (m *BatchResponseItem) GetBucketDelete() *BucketDeleteResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_BucketDelete); ok { + return x.BucketDelete + } + return nil +} + +func (m *BatchResponseItem) GetBucketList() *BucketListResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_BucketList); ok { + return x.BucketList + } + return nil +} + +func (m *BatchResponseItem) GetBucketSetAttribution() *BucketSetAttributionResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_BucketSetAttribution); ok { + return x.BucketSetAttribution + } + return nil +} + +func (m *BatchResponseItem) GetObjectBegin() *ObjectBeginResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_ObjectBegin); ok { + return x.ObjectBegin + } + return nil +} + +func (m *BatchResponseItem) GetObjectCommit() *ObjectCommitResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_ObjectCommit); ok { + return x.ObjectCommit + } + return nil +} + +func (m *BatchResponseItem) GetObjectGet() *ObjectGetResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_ObjectGet); ok { + return x.ObjectGet + } + return nil +} + +func (m *BatchResponseItem) GetObjectList() *ObjectListResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_ObjectList); ok { + return x.ObjectList + } + return nil +} + +func (m *BatchResponseItem) GetObjectBeginDelete() *ObjectBeginDeleteResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_ObjectBeginDelete); ok { + return x.ObjectBeginDelete + } + return nil +} + +func (m *BatchResponseItem) GetObjectFinishDelete() *ObjectFinishDeleteResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_ObjectFinishDelete); ok { + return x.ObjectFinishDelete + } + return nil +} + +func (m *BatchResponseItem) GetSegmentBegin() *SegmentBeginResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_SegmentBegin); ok { + return x.SegmentBegin + } + return nil +} + +func (m *BatchResponseItem) GetSegmentCommit() *SegmentCommitResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_SegmentCommit); ok { + return x.SegmentCommit + } + return nil +} + +func (m *BatchResponseItem) GetSegmentMakeInline() *SegmentMakeInlineResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_SegmentMakeInline); ok { + return x.SegmentMakeInline + } + return nil +} + +func (m *BatchResponseItem) GetSegmentBeginDelete() *SegmentBeginDeleteResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_SegmentBeginDelete); ok { + return x.SegmentBeginDelete + } + return nil +} + +func (m *BatchResponseItem) GetSegmentFinishDelete() *SegmentFinishDeleteResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_SegmentFinishDelete); ok { + return x.SegmentFinishDelete + } + return nil +} + +func (m *BatchResponseItem) GetSegmentList() *SegmentListResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_SegmentList); ok { + return x.SegmentList + } + return nil +} + +func (m *BatchResponseItem) GetSegmentDownload() *SegmentDownloadResponse { + if x, ok := m.GetResponse().(*BatchResponseItem_SegmentDownload); ok { + return x.SegmentDownload + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BatchResponseItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BatchResponseItem_OneofMarshaler, _BatchResponseItem_OneofUnmarshaler, _BatchResponseItem_OneofSizer, []interface{}{ + (*BatchResponseItem_BucketCreate)(nil), + (*BatchResponseItem_BucketGet)(nil), + (*BatchResponseItem_BucketDelete)(nil), + (*BatchResponseItem_BucketList)(nil), + (*BatchResponseItem_BucketSetAttribution)(nil), + (*BatchResponseItem_ObjectBegin)(nil), + (*BatchResponseItem_ObjectCommit)(nil), + (*BatchResponseItem_ObjectGet)(nil), + (*BatchResponseItem_ObjectList)(nil), + (*BatchResponseItem_ObjectBeginDelete)(nil), + (*BatchResponseItem_ObjectFinishDelete)(nil), + (*BatchResponseItem_SegmentBegin)(nil), + (*BatchResponseItem_SegmentCommit)(nil), + (*BatchResponseItem_SegmentMakeInline)(nil), + (*BatchResponseItem_SegmentBeginDelete)(nil), + (*BatchResponseItem_SegmentFinishDelete)(nil), + (*BatchResponseItem_SegmentList)(nil), + (*BatchResponseItem_SegmentDownload)(nil), + } +} + +func _BatchResponseItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BatchResponseItem) + // Response + switch x := m.Response.(type) { + case *BatchResponseItem_BucketCreate: + _ = b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketCreate); err != nil { + return err + } + case *BatchResponseItem_BucketGet: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketGet); err != nil { + return err + } + case *BatchResponseItem_BucketDelete: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketDelete); err != nil { + return err + } + case *BatchResponseItem_BucketList: + _ = b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketList); err != nil { + return err + } + case *BatchResponseItem_BucketSetAttribution: + _ = b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BucketSetAttribution); err != nil { + return err + } + case *BatchResponseItem_ObjectBegin: + _ = b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectBegin); err != nil { + return err + } + case *BatchResponseItem_ObjectCommit: + _ = b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectCommit); err != nil { + return err + } + case *BatchResponseItem_ObjectGet: + _ = b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectGet); err != nil { + return err + } + case *BatchResponseItem_ObjectList: + _ = b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectList); err != nil { + return err + } + case *BatchResponseItem_ObjectBeginDelete: + _ = b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectBeginDelete); err != nil { + return err + } + case *BatchResponseItem_ObjectFinishDelete: + _ = b.EncodeVarint(11<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ObjectFinishDelete); err != nil { + return err + } + case *BatchResponseItem_SegmentBegin: + _ = b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentBegin); err != nil { + return err + } + case *BatchResponseItem_SegmentCommit: + _ = b.EncodeVarint(13<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentCommit); err != nil { + return err + } + case *BatchResponseItem_SegmentMakeInline: + _ = b.EncodeVarint(14<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentMakeInline); err != nil { + return err + } + case *BatchResponseItem_SegmentBeginDelete: + _ = b.EncodeVarint(15<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentBeginDelete); err != nil { + return err + } + case *BatchResponseItem_SegmentFinishDelete: + _ = b.EncodeVarint(16<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentFinishDelete); err != nil { + return err + } + case *BatchResponseItem_SegmentList: + _ = b.EncodeVarint(17<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentList); err != nil { + return err + } + case *BatchResponseItem_SegmentDownload: + _ = b.EncodeVarint(18<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.SegmentDownload); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("BatchResponseItem.Response has unexpected type %T", x) + } + return nil +} + +func _BatchResponseItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BatchResponseItem) + switch tag { + case 1: // Response.bucket_create + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketCreateResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_BucketCreate{msg} + return true, err + case 2: // Response.bucket_get + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketGetResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_BucketGet{msg} + return true, err + case 3: // Response.bucket_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketDeleteResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_BucketDelete{msg} + return true, err + case 4: // Response.bucket_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketListResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_BucketList{msg} + return true, err + case 5: // Response.bucket_set_attribution + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BucketSetAttributionResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_BucketSetAttribution{msg} + return true, err + case 6: // Response.object_begin + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectBeginResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_ObjectBegin{msg} + return true, err + case 7: // Response.object_commit + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectCommitResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_ObjectCommit{msg} + return true, err + case 8: // Response.object_get + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectGetResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_ObjectGet{msg} + return true, err + case 9: // Response.object_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectListResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_ObjectList{msg} + return true, err + case 10: // Response.object_begin_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectBeginDeleteResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_ObjectBeginDelete{msg} + return true, err + case 11: // Response.object_finish_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ObjectFinishDeleteResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_ObjectFinishDelete{msg} + return true, err + case 12: // Response.segment_begin + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentBeginResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_SegmentBegin{msg} + return true, err + case 13: // Response.segment_commit + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentCommitResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_SegmentCommit{msg} + return true, err + case 14: // Response.segment_make_inline + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentMakeInlineResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_SegmentMakeInline{msg} + return true, err + case 15: // Response.segment_begin_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentBeginDeleteResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_SegmentBeginDelete{msg} + return true, err + case 16: // Response.segment_finish_delete + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentFinishDeleteResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_SegmentFinishDelete{msg} + return true, err + case 17: // Response.segment_list + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentListResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_SegmentList{msg} + return true, err + case 18: // Response.segment_download + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SegmentDownloadResponse) + err := b.DecodeMessage(msg) + m.Response = &BatchResponseItem_SegmentDownload{msg} + return true, err + default: + return false, nil + } +} + +func _BatchResponseItem_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BatchResponseItem) + // Response + switch x := m.Response.(type) { + case *BatchResponseItem_BucketCreate: + s := proto.Size(x.BucketCreate) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_BucketGet: + s := proto.Size(x.BucketGet) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_BucketDelete: + s := proto.Size(x.BucketDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_BucketList: + s := proto.Size(x.BucketList) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_BucketSetAttribution: + s := proto.Size(x.BucketSetAttribution) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_ObjectBegin: + s := proto.Size(x.ObjectBegin) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_ObjectCommit: + s := proto.Size(x.ObjectCommit) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_ObjectGet: + s := proto.Size(x.ObjectGet) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_ObjectList: + s := proto.Size(x.ObjectList) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_ObjectBeginDelete: + s := proto.Size(x.ObjectBeginDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_ObjectFinishDelete: + s := proto.Size(x.ObjectFinishDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_SegmentBegin: + s := proto.Size(x.SegmentBegin) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_SegmentCommit: + s := proto.Size(x.SegmentCommit) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_SegmentMakeInline: + s := proto.Size(x.SegmentMakeInline) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_SegmentBeginDelete: + s := proto.Size(x.SegmentBeginDelete) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_SegmentFinishDelete: + s := proto.Size(x.SegmentFinishDelete) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_SegmentList: + s := proto.Size(x.SegmentList) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *BatchResponseItem_SegmentDownload: + s := proto.Size(x.SegmentDownload) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + func init() { proto.RegisterEnum("metainfo.Object_Status", Object_Status_name, Object_Status_value) proto.RegisterType((*Bucket)(nil), "metainfo.Bucket") @@ -3519,200 +4873,242 @@ func init() { proto.RegisterType((*SegmentListItem)(nil), "metainfo.SegmentListItem") proto.RegisterType((*SegmentDownloadRequest)(nil), "metainfo.SegmentDownloadRequest") proto.RegisterType((*SegmentDownloadResponse)(nil), "metainfo.SegmentDownloadResponse") + proto.RegisterType((*BatchRequest)(nil), "metainfo.BatchRequest") + proto.RegisterType((*BatchRequestItem)(nil), "metainfo.BatchRequestItem") + proto.RegisterType((*BatchResponse)(nil), "metainfo.BatchResponse") + proto.RegisterType((*BatchResponseItem)(nil), "metainfo.BatchResponseItem") } func init() { proto.RegisterFile("metainfo.proto", fileDescriptor_631e2f30a93cd64e) } var fileDescriptor_631e2f30a93cd64e = []byte{ - // 2993 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x1a, 0x4b, 0x6f, 0x24, 0x47, - 0x39, 0xf3, 0x1e, 0x7f, 0x33, 0x9e, 0x19, 0x97, 0xbd, 0xde, 0xd9, 0xf1, 0x3a, 0xf6, 0xf6, 0x66, - 0x37, 0x8e, 0x94, 0xcc, 0x46, 0x0e, 0x48, 0x91, 0x92, 0x48, 0xd8, 0x9e, 0xcd, 0x7a, 0x92, 0xf5, - 0x23, 0xed, 0xbc, 0x88, 0x82, 0x5a, 0x6d, 0x77, 0xd9, 0x6e, 0x76, 0xa6, 0x7b, 0xe8, 0xee, 0x59, - 0xbc, 0x39, 0x71, 0x40, 0x42, 0x28, 0x1c, 0x38, 0x72, 0xca, 0x05, 0x71, 0xe2, 0x17, 0x44, 0x42, - 0x5c, 0x41, 0x08, 0x71, 0x08, 0x37, 0x90, 0x02, 0xbf, 0x80, 0x0b, 0x67, 0x24, 0x54, 0xaf, 0xee, - 0xea, 0xd7, 0x3c, 0xec, 0xf1, 0x4a, 0xb9, 0x75, 0x7f, 0xdf, 0x57, 0x5f, 0x55, 0x7d, 0xef, 0xfa, - 0xaa, 0xa0, 0xd6, 0xc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0x12, - 0x58, 0x86, 0xe2, 0xc0, 0xc1, 0xa7, 0xe6, 0x05, 0x97, 0x01, 0xff, 0x43, 0x6b, 0x50, 0x71, 0x3d, - 0xdd, 0xf1, 0x34, 0xfd, 0x94, 0x88, 0x9f, 0x5a, 0x8b, 0x0a, 0x14, 0xb4, 0x45, 0x20, 0x24, 0x37, - 0x62, 0xcb, 0xd0, 0x8e, 0xf1, 0x29, 0x49, 0xb4, 0x79, 0x96, 0x1b, 0xb1, 0x65, 0x6c, 0x53, 0x00, - 0xc9, 0xf2, 0x0e, 0x26, 0x75, 0x80, 0xf9, 0x94, 0x45, 0xf1, 0xb2, 0x1a, 0x00, 0x82, 0xca, 0xa0, - 0x28, 0x57, 0x06, 0xab, 0x00, 0x44, 0x52, 0xda, 0x69, 0x4f, 0x3f, 0x73, 0x69, 0x21, 0x5d, 0x52, - 0xe7, 0x08, 0xe4, 0x5d, 0x02, 0xa0, 0x61, 0x3a, 0xbc, 0xbb, 0x40, 0xfa, 0x6f, 0x87, 0x0b, 0x84, - 0xfb, 0x81, 0xc8, 0x53, 0x46, 0xb4, 0xc7, 0x94, 0x0b, 0x2d, 0x0c, 0x79, 0x51, 0xac, 0x53, 0x13, - 0xc9, 0x48, 0x26, 0x32, 0x9d, 0xe3, 0xad, 0xc0, 0x9c, 0xe9, 0x6a, 0x5c, 0xca, 0x39, 0x3a, 0x45, - 0xd9, 0x74, 0x0f, 0xe9, 0xbf, 0xf2, 0x19, 0x31, 0xa9, 0x84, 0x7a, 0x84, 0x6c, 0x6a, 0x0d, 0x2a, - 0x4c, 0x4b, 0x9a, 0x54, 0x99, 0x00, 0x03, 0xed, 0x4f, 0x50, 0x9f, 0xac, 0x90, 0x58, 0x97, 0x54, - 0x99, 0x1c, 0xf4, 0x0c, 0x65, 0x09, 0xd0, 0xa1, 0x63, 0xff, 0x18, 0x9f, 0xc8, 0x4e, 0xad, 0xbc, - 0x09, 0x8b, 0x21, 0x28, 0xaf, 0xbf, 0xee, 0x40,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73, 0x5e, 0xad, 0x28, 0x71, 0xb2, 0x82, - 0xe3, 0x0d, 0x69, 0xae, 0x11, 0x86, 0x08, 0x69, 0x24, 0xd6, 0x7c, 0x6e, 0xdd, 0x4e, 0x46, 0x72, - 0x4e, 0x9f, 0xc3, 0x82, 0x54, 0x4f, 0xf0, 0x75, 0x29, 0x89, 0x22, 0x09, 0x1b, 0xcd, 0xdd, 0x91, - 0x34, 0x9c, 0xbb, 0x06, 0x48, 0x4e, 0x60, 0x9c, 0x7d, 0x6c, 0x68, 0x42, 0xf2, 0x6f, 0xbd, 0x34, - 0x9a, 0x28, 0xd0, 0x0e, 0x9d, 0x57, 0xb4, 0x5e, 0x56, 0x63, 0xce, 0x1b, 0xd2, 0xf5, 0x8b, 0x69, - 0x68, 0xce, 0xee, 0x10, 0xe6, 0x99, 0xbe, 0x04, 0xbf, 0xf8, 0x80, 0xb0, 0xba, 0xd7, 0x52, 0xf1, - 0x81, 0x7c, 0x83, 0xf2, 0x51, 0x70, 0x8d, 0x57, 0x25, 0xb1, 0xe2, 0x5b, 0x96, 0x6f, 0x6a, 0x19, - 0x4a, 0xe4, 0x2b, 0x89, 0x5d, 0xb0, 0xbf, 0x9b, 0xbc, 0xcb, 0x54, 0xf9, 0x8e, 0xa8, 0x2b, 0x8f, - 0x61, 0x51, 0x96, 0xbb, 0x98, 0x21, 0x3e, 0x38, 0x49, 0x85, 0xf7, 0xc6, 0x50, 0xf1, 0x39, 0xde, - 0x87, 0xaa, 0xfc, 0x88, 0x44, 0x76, 0xd7, 0x78, 0x91, 0xd3, 0x5a, 0x4d, 0xc1, 0x72, 0x66, 0x1f, - 0x43, 0x5d, 0x24, 0x54, 0xb1, 0xd8, 0xf5, 0xd8, 0x88, 0x48, 0x01, 0xd0, 0xba, 0x33, 0x82, 0x82, - 0xf3, 0xfd, 0x04, 0x1a, 0x2c, 0x54, 0x73, 0x82, 0x83, 0x9e, 0x91, 0xc0, 0x38, 0xf2, 0xfe, 0x33, - 0x81, 0x71, 0xec, 0x01, 0xe4, 0x0f, 0xa1, 0x11, 0x32, 0x39, 0x02, 0xbb, 0x33, 0xda, 0xea, 0x08, - 0x67, 0x65, 0x8c, 0xe1, 0x11, 0x36, 0x47, 0x50, 0x93, 0x1e, 0x7e, 0xd1, 0x17, 0x2f, 0xb1, 0x51, - 0xe1, 0x17, 0x67, 0xad, 0xf5, 0x14, 0x82, 0x80, 0xa9, 0x06, 0x28, 0x22, 0x60, 0x02, 0xbd, 0x3b, - 0x4e, 0xc6, 0x84, 0xf9, 0x4b, 0x63, 0xc5, 0xcc, 0x05, 0x12, 0x32, 0xb6, 0x64, 0x81, 0x44, 0x9f, - 0xa0, 0x25, 0x08, 0x24, 0xfe, 0x86, 0xec, 0x63, 0xa8, 0xcb, 0x96, 0x16, 0xd1, 0x61, 0xf2, 0xcb, - 0x2e, 0x59, 0x87, 0x69, 0xaf, 0xa3, 0x3e, 0x87, 0x85, 0x70, 0x26, 0x22, 0xc0, 0xd0, 0x82, 0x92, - 0x5f, 0x20, 0x85, 0x9d, 0x3c, 0xe5, 0x25, 0x11, 0xc9, 0x66, 0xd2, 0x9b, 0x21, 0xd9, 0x3d, 0xe2, - 0x0f, 0x8c, 0x64, 0xf7, 0x48, 0x78, 0x68, 0xb4, 0x9d, 0xff, 0x2c, 0x3b, 0x38, 0x3e, 0x2e, 0xd2, - 0x5e, 0xc3, 0x1b, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x22, 0x4e, 0x8c, 0x7a, 0x6d, 0x33, 0x00, - 0x00, + // 3607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0xcd, 0x6f, 0x1c, 0xc7, + 0x95, 0xe7, 0x7c, 0xcf, 0xbc, 0x19, 0x72, 0x86, 0x45, 0x8a, 0x1a, 0x0d, 0x45, 0x51, 0x6a, 0x7d, + 0x58, 0x06, 0x6c, 0xca, 0xa0, 0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x79, 0x97, 0x36, + 0x74, 0xda, 0x7a, 0x99, 0xb1, 0x74, 0xcc, 0xc8, 0x21, 0xac, 0x78, 0xba, 0xf3, 0xef, 0x1a, 0x19, + 0x93, 0x8c, 0x4e, 0x64, 0x94, 0x4e, 0x20, 0xa3, 0xcc, 0xba, 0xad, 0x91, 0xb4, 0x8f, 0xa5, 0x27, + 0x98, 0xca, 0x28, 0x9f, 0x64, 0x1e, 0xbc, 0xdf, 0x9a, 0x87, 0xee, 0x41, 0x33, 0xd0, 0x36, 0xd1, + 0x93, 0x69, 0x78, 0x46, 0x77, 0x60, 0x0f, 0xf6, 0x71, 0xb3, 0x42, 0x55, 0x31, 0xcd, 0x55, 0x51, + 0xd8, 0x26, 0x44, 0x7d, 0xc1, 0x67, 0xdf, 0xe2, 0xdc, 0x94, 0x8e, 0xde, 0x04, 0x14, 0x17, 0xd4, + 0x04, 0x6a, 0xba, 0xd9, 0x58, 0x1f, 0xf4, 0x06, 0xa0, 0x03, 0xeb, 0x38, 0x9a, 0xc8, 0x55, 0x29, + 0x94, 0x36, 0x68, 0x8b, 0x9c, 0xc1, 0x6d, 0xc2, 0x6c, 0xfc, 0x48, 0x58, 0x1b, 0x9f, 0x42, 0x36, + 0x9c, 0xe8, 0x59, 0xf0, 0x11, 0x9c, 0x53, 0x9f, 0x01, 0xa7, 0x27, 0x3c, 0x03, 0xce, 0xe3, 0x84, + 0xc3, 0x9f, 0x67, 0x7b, 0x46, 0x8f, 0x2d, 0x63, 0x86, 0x2e, 0xa3, 0x42, 0x29, 0x74, 0xfe, 0xcb, + 0x50, 0xb5, 0x06, 0x3d, 0x6b, 0x80, 0x59, 0x7b, 0x9d, 0xb6, 0x03, 0x23, 0x09, 0x06, 0x07, 0xf7, + 0x6d, 0x8f, 0x33, 0x34, 0x18, 0x03, 0x23, 0x11, 0x06, 0xed, 0x23, 0x28, 0x32, 0xaf, 0x45, 0x55, + 0x28, 0x75, 0xb6, 0x3f, 0x5e, 0xbb, 0xdf, 0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, 0xfc, + 0x49, 0x2a, 0x86, 0x5f, 0x4b, 0xc7, 0xf0, 0x40, 0x83, 0x0a, 0x10, 0xff, 0xff, 0x74, 0x10, 0xbf, + 0x3e, 0x06, 0xc4, 0x7d, 0xd9, 0x4a, 0x14, 0x5f, 0x57, 0xa2, 0xf8, 0x52, 0x02, 0x8a, 0x07, 0x91, + 0x25, 0xc3, 0xf8, 0x76, 0x22, 0x8c, 0x5f, 0x49, 0x81, 0x71, 0x5f, 0x56, 0x0c, 0xc7, 0x01, 0xca, + 0xa2, 0x79, 0xf5, 0x9b, 0x59, 0x28, 0x6f, 0x71, 0x19, 0x68, 0x0b, 0x6a, 0x0c, 0x36, 0xf9, 0xaf, + 0x5a, 0xe9, 0x29, 0x72, 0x6b, 0x0c, 0x16, 0xa3, 0x36, 0x54, 0xee, 0x61, 0x8f, 0xcb, 0x4a, 0xc9, + 0x95, 0x5b, 0x69, 0x80, 0x4c, 0x26, 0xc5, 0x74, 0x99, 0x34, 0xa9, 0xd0, 0x6e, 0xda, 0x1a, 0x83, + 0xcd, 0x68, 0x13, 0xaa, 0x44, 0xa9, 0xac, 0xcd, 0x45, 0x69, 0xe9, 0x73, 0x2b, 0x15, 0xa2, 0x11, + 0x86, 0xf9, 0x5d, 0xb1, 0x3c, 0x19, 0x4c, 0x27, 0x4b, 0xa3, 0x5b, 0x13, 0x62, 0x36, 0xfa, 0x00, + 0xaa, 0xd4, 0x5b, 0xf9, 0x97, 0x8a, 0xa9, 0xf9, 0x74, 0x2b, 0x1d, 0xb2, 0xa9, 0x81, 0x69, 0x94, + 0x72, 0x61, 0xe9, 0x89, 0x75, 0x6b, 0x0c, 0x76, 0x73, 0x03, 0x73, 0x59, 0x29, 0x19, 0x76, 0x2b, + 0x0d, 0xc0, 0x85, 0x45, 0x58, 0x43, 0xc8, 0x22, 0xb1, 0x5c, 0xbb, 0x95, 0x0a, 0xe5, 0xe8, 0x13, + 0x98, 0x95, 0x02, 0x9b, 0xcf, 0x6b, 0x82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x68, 0x17, 0x50, + 0xc4, 0x34, 0x84, 0x7a, 0x75, 0x9c, 0x75, 0x88, 0xf0, 0x6b, 0x63, 0x0d, 0xc4, 0x15, 0x12, 0x72, + 0x53, 0xb5, 0x42, 0xa2, 0xbf, 0x8d, 0x28, 0x14, 0x12, 0xff, 0xef, 0xe3, 0x63, 0xa8, 0xcb, 0x3e, + 0x1a, 0xb1, 0xa1, 0xfa, 0x6f, 0x0c, 0xd9, 0x86, 0x49, 0x7f, 0x34, 0x7c, 0x02, 0xb3, 0xe1, 0x3d, + 0x8c, 0x10, 0x43, 0x13, 0x52, 0xff, 0x35, 0x10, 0x86, 0x87, 0x84, 0xaf, 0xff, 0xc9, 0x3e, 0x28, + 0x7d, 0xe7, 0x2f, 0x07, 0x56, 0xfc, 0xa7, 0x00, 0x39, 0xb0, 0x14, 0x3f, 0x07, 0xac, 0xe7, 0x9f, + 0x66, 0x87, 0x7b, 0x7b, 0x45, 0x7a, 0x3f, 0xf8, 0xf6, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc0, + 0x85, 0xf8, 0x5e, 0x21, 0x3f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3747,6 +5143,7 @@ type MetainfoClient interface { FinishDeleteSegment(ctx context.Context, in *SegmentFinishDeleteRequest, opts ...grpc.CallOption) (*SegmentFinishDeleteResponse, error) ListSegments(ctx context.Context, in *SegmentListRequest, opts ...grpc.CallOption) (*SegmentListResponse, error) DownloadSegment(ctx context.Context, in *SegmentDownloadRequest, opts ...grpc.CallOption) (*SegmentDownloadResponse, error) + Batch(ctx context.Context, in *BatchRequest, opts ...grpc.CallOption) (*BatchResponse, error) CreateSegmentOld(ctx context.Context, in *SegmentWriteRequestOld, opts ...grpc.CallOption) (*SegmentWriteResponseOld, error) CommitSegmentOld(ctx context.Context, in *SegmentCommitRequestOld, opts ...grpc.CallOption) (*SegmentCommitResponseOld, error) SegmentInfoOld(ctx context.Context, in *SegmentInfoRequestOld, opts ...grpc.CallOption) (*SegmentInfoResponseOld, error) @@ -3927,6 +5324,15 @@ func (c *metainfoClient) DownloadSegment(ctx context.Context, in *SegmentDownloa return out, nil } +func (c *metainfoClient) Batch(ctx context.Context, in *BatchRequest, opts ...grpc.CallOption) (*BatchResponse, error) { + out := new(BatchResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/Batch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *metainfoClient) CreateSegmentOld(ctx context.Context, in *SegmentWriteRequestOld, opts ...grpc.CallOption) (*SegmentWriteResponseOld, error) { out := new(SegmentWriteResponseOld) err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CreateSegmentOld", in, out, opts...) @@ -4021,6 +5427,7 @@ type MetainfoServer interface { FinishDeleteSegment(context.Context, *SegmentFinishDeleteRequest) (*SegmentFinishDeleteResponse, error) ListSegments(context.Context, *SegmentListRequest) (*SegmentListResponse, error) DownloadSegment(context.Context, *SegmentDownloadRequest) (*SegmentDownloadResponse, error) + Batch(context.Context, *BatchRequest) (*BatchResponse, error) CreateSegmentOld(context.Context, *SegmentWriteRequestOld) (*SegmentWriteResponseOld, error) CommitSegmentOld(context.Context, *SegmentCommitRequestOld) (*SegmentCommitResponseOld, error) SegmentInfoOld(context.Context, *SegmentInfoRequestOld) (*SegmentInfoResponseOld, error) @@ -4359,6 +5766,24 @@ func _Metainfo_DownloadSegment_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Metainfo_Batch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetainfoServer).Batch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/metainfo.Metainfo/Batch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetainfoServer).Batch(ctx, req.(*BatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Metainfo_CreateSegmentOld_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SegmentWriteRequestOld) if err := dec(in); err != nil { @@ -4579,6 +6004,10 @@ var _Metainfo_serviceDesc = grpc.ServiceDesc{ MethodName: "DownloadSegment", Handler: _Metainfo_DownloadSegment_Handler, }, + { + MethodName: "Batch", + Handler: _Metainfo_Batch_Handler, + }, { MethodName: "CreateSegmentOld", Handler: _Metainfo_CreateSegmentOld_Handler, diff --git a/pkg/pb/metainfo.proto b/pkg/pb/metainfo.proto index ed7f6f90a..06fa495f1 100644 --- a/pkg/pb/metainfo.proto +++ b/pkg/pb/metainfo.proto @@ -37,6 +37,8 @@ service Metainfo { rpc ListSegments(SegmentListRequest) returns (SegmentListResponse); rpc DownloadSegment(SegmentDownloadRequest) returns (SegmentDownloadResponse); + rpc Batch(BatchRequest) returns (BatchResponse); + rpc CreateSegmentOld(SegmentWriteRequestOld) returns (SegmentWriteResponseOld); rpc CommitSegmentOld(SegmentCommitRequestOld) returns (SegmentCommitResponseOld); rpc SegmentInfoOld(SegmentInfoRequestOld) returns (SegmentInfoResponseOld); @@ -500,4 +502,66 @@ message SegmentDownloadResponse { bytes encrypted_key = 7; SegmentPosition next = 8; // can be nil +} + +message BatchRequest { + repeated BatchRequestItem requests = 1; +} + +message BatchRequestItem { + oneof Request { + BucketCreateRequest bucket_create = 1; + BucketGetRequest bucket_get = 2; + BucketDeleteRequest bucket_delete = 3; + BucketListRequest bucket_list = 4; + BucketSetAttributionRequest bucket_set_attribution = 5; + + ObjectBeginRequest object_begin = 6; + ObjectCommitRequest object_commit = 7; + ObjectGetRequest object_get = 8; + ObjectListRequest object_list = 9; + ObjectBeginDeleteRequest object_begin_delete = 10; + ObjectFinishDeleteRequest object_finish_delete = 11; + + SegmentBeginRequest segment_begin = 12; + SegmentCommitRequest segment_commit = 13; + SegmentMakeInlineRequest segment_make_inline = 14; + + SegmentBeginDeleteRequest segment_begin_delete = 15; + SegmentFinishDeleteRequest segment_finish_delete = 16; + + SegmentListRequest segment_list = 17; + SegmentDownloadRequest segment_download = 18; + } +} + +message BatchResponse { + repeated BatchResponseItem responses = 1; +} + +message BatchResponseItem { + oneof Response { + BucketCreateResponse bucket_create = 1; + BucketGetResponse bucket_get = 2; + BucketDeleteResponse bucket_delete = 3; + BucketListResponse bucket_list = 4; + BucketSetAttributionResponse bucket_set_attribution = 5; + + ObjectBeginResponse object_begin = 6; + ObjectCommitResponse object_commit = 7; + ObjectGetResponse object_get = 8; + ObjectListResponse object_list = 9; + ObjectBeginDeleteResponse object_begin_delete = 10; + ObjectFinishDeleteResponse object_finish_delete = 11; + + SegmentBeginResponse segment_begin = 12; + SegmentCommitResponse segment_commit = 13; + SegmentMakeInlineResponse segment_make_inline = 14; + + SegmentBeginDeleteResponse segment_begin_delete = 15; + SegmentFinishDeleteResponse segment_finish_delete = 16; + + SegmentListResponse segment_list = 17; + SegmentDownloadResponse segment_download = 18; + } } \ No newline at end of file diff --git a/proto.lock b/proto.lock index 3dbf2474e..33f6d9d1e 100644 --- a/proto.lock +++ b/proto.lock @@ -3379,6 +3379,218 @@ "type": "SegmentPosition" } ] + }, + { + "name": "BatchRequest", + "fields": [ + { + "id": 1, + "name": "requests", + "type": "BatchRequestItem", + "is_repeated": true + } + ] + }, + { + "name": "BatchRequestItem", + "fields": [ + { + "id": 1, + "name": "bucket_create", + "type": "BucketCreateRequest" + }, + { + "id": 2, + "name": "bucket_get", + "type": "BucketGetRequest" + }, + { + "id": 3, + "name": "bucket_delete", + "type": "BucketDeleteRequest" + }, + { + "id": 4, + "name": "bucket_list", + "type": "BucketListRequest" + }, + { + "id": 5, + "name": "bucket_set_attribution", + "type": "BucketSetAttributionRequest" + }, + { + "id": 6, + "name": "object_begin", + "type": "ObjectBeginRequest" + }, + { + "id": 7, + "name": "object_commit", + "type": "ObjectCommitRequest" + }, + { + "id": 8, + "name": "object_get", + "type": "ObjectGetRequest" + }, + { + "id": 9, + "name": "object_list", + "type": "ObjectListRequest" + }, + { + "id": 10, + "name": "object_begin_delete", + "type": "ObjectBeginDeleteRequest" + }, + { + "id": 11, + "name": "object_finish_delete", + "type": "ObjectFinishDeleteRequest" + }, + { + "id": 12, + "name": "segment_begin", + "type": "SegmentBeginRequest" + }, + { + "id": 13, + "name": "segment_commit", + "type": "SegmentCommitRequest" + }, + { + "id": 14, + "name": "segment_make_inline", + "type": "SegmentMakeInlineRequest" + }, + { + "id": 15, + "name": "segment_begin_delete", + "type": "SegmentBeginDeleteRequest" + }, + { + "id": 16, + "name": "segment_finish_delete", + "type": "SegmentFinishDeleteRequest" + }, + { + "id": 17, + "name": "segment_list", + "type": "SegmentListRequest" + }, + { + "id": 18, + "name": "segment_download", + "type": "SegmentDownloadRequest" + } + ] + }, + { + "name": "BatchResponse", + "fields": [ + { + "id": 1, + "name": "responses", + "type": "BatchResponseItem", + "is_repeated": true + } + ] + }, + { + "name": "BatchResponseItem", + "fields": [ + { + "id": 1, + "name": "bucket_create", + "type": "BucketCreateResponse" + }, + { + "id": 2, + "name": "bucket_get", + "type": "BucketGetResponse" + }, + { + "id": 3, + "name": "bucket_delete", + "type": "BucketDeleteResponse" + }, + { + "id": 4, + "name": "bucket_list", + "type": "BucketListResponse" + }, + { + "id": 5, + "name": "bucket_set_attribution", + "type": "BucketSetAttributionResponse" + }, + { + "id": 6, + "name": "object_begin", + "type": "ObjectBeginResponse" + }, + { + "id": 7, + "name": "object_commit", + "type": "ObjectCommitResponse" + }, + { + "id": 8, + "name": "object_get", + "type": "ObjectGetResponse" + }, + { + "id": 9, + "name": "object_list", + "type": "ObjectListResponse" + }, + { + "id": 10, + "name": "object_begin_delete", + "type": "ObjectBeginDeleteResponse" + }, + { + "id": 11, + "name": "object_finish_delete", + "type": "ObjectFinishDeleteResponse" + }, + { + "id": 12, + "name": "segment_begin", + "type": "SegmentBeginResponse" + }, + { + "id": 13, + "name": "segment_commit", + "type": "SegmentCommitResponse" + }, + { + "id": 14, + "name": "segment_make_inline", + "type": "SegmentMakeInlineResponse" + }, + { + "id": 15, + "name": "segment_begin_delete", + "type": "SegmentBeginDeleteResponse" + }, + { + "id": 16, + "name": "segment_finish_delete", + "type": "SegmentFinishDeleteResponse" + }, + { + "id": 17, + "name": "segment_list", + "type": "SegmentListResponse" + }, + { + "id": 18, + "name": "segment_download", + "type": "SegmentDownloadResponse" + } + ] } ], "services": [ @@ -3475,6 +3687,11 @@ "in_type": "SegmentDownloadRequest", "out_type": "SegmentDownloadResponse" }, + { + "name": "Batch", + "in_type": "BatchRequest", + "out_type": "BatchResponse" + }, { "name": "CreateSegmentOld", "in_type": "SegmentWriteRequestOld", diff --git a/satellite/metainfo/batch.go b/satellite/metainfo/batch.go new file mode 100644 index 000000000..e3de32fbc --- /dev/null +++ b/satellite/metainfo/batch.go @@ -0,0 +1,215 @@ +// Copyright (C) 2019 Storj Labs, Inc. +// See LICENSE for copying information. + +package metainfo + +import ( + "context" + + "github.com/zeebo/errs" + + "storj.io/storj/pkg/pb" +) + +// Batch handle requests sent in batch +func (endpoint *Endpoint) Batch(ctx context.Context, req *pb.BatchRequest) (resp *pb.BatchResponse, err error) { + defer mon.Task()(&ctx)(&err) + + resp = &pb.BatchResponse{} + + resp.Responses = make([]*pb.BatchResponseItem, 0, len(req.Requests)) + + // TODO find a way to pass some parameters between request -> response > request + // TODO maybe use reflection to shrink code + for _, request := range req.Requests { + switch singleRequest := request.Request.(type) { + // BUCKET + case *pb.BatchRequestItem_BucketCreate: + response, err := endpoint.CreateBucket(ctx, singleRequest.BucketCreate) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_BucketCreate{ + BucketCreate: response, + }, + }) + case *pb.BatchRequestItem_BucketGet: + response, err := endpoint.GetBucket(ctx, singleRequest.BucketGet) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_BucketGet{ + BucketGet: response, + }, + }) + case *pb.BatchRequestItem_BucketDelete: + response, err := endpoint.DeleteBucket(ctx, singleRequest.BucketDelete) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_BucketDelete{ + BucketDelete: response, + }, + }) + case *pb.BatchRequestItem_BucketList: + response, err := endpoint.ListBuckets(ctx, singleRequest.BucketList) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_BucketList{ + BucketList: response, + }, + }) + case *pb.BatchRequestItem_BucketSetAttribution: + response, err := endpoint.SetBucketAttribution(ctx, singleRequest.BucketSetAttribution) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_BucketSetAttribution{ + BucketSetAttribution: response, + }, + }) + //OBJECT + case *pb.BatchRequestItem_ObjectBegin: + response, err := endpoint.BeginObject(ctx, singleRequest.ObjectBegin) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_ObjectBegin{ + ObjectBegin: response, + }, + }) + case *pb.BatchRequestItem_ObjectCommit: + response, err := endpoint.CommitObject(ctx, singleRequest.ObjectCommit) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_ObjectCommit{ + ObjectCommit: response, + }, + }) + case *pb.BatchRequestItem_ObjectGet: + response, err := endpoint.GetObject(ctx, singleRequest.ObjectGet) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_ObjectGet{ + ObjectGet: response, + }, + }) + case *pb.BatchRequestItem_ObjectList: + response, err := endpoint.ListObjects(ctx, singleRequest.ObjectList) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_ObjectList{ + ObjectList: response, + }, + }) + case *pb.BatchRequestItem_ObjectBeginDelete: + response, err := endpoint.BeginDeleteObject(ctx, singleRequest.ObjectBeginDelete) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_ObjectBeginDelete{ + ObjectBeginDelete: response, + }, + }) + case *pb.BatchRequestItem_ObjectFinishDelete: + response, err := endpoint.FinishDeleteObject(ctx, singleRequest.ObjectFinishDelete) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_ObjectFinishDelete{ + ObjectFinishDelete: response, + }, + }) + // SEGMENT + case *pb.BatchRequestItem_SegmentBegin: + response, err := endpoint.BeginSegment(ctx, singleRequest.SegmentBegin) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_SegmentBegin{ + SegmentBegin: response, + }, + }) + case *pb.BatchRequestItem_SegmentCommit: + response, err := endpoint.CommitSegment(ctx, singleRequest.SegmentCommit) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_SegmentCommit{ + SegmentCommit: response, + }, + }) + case *pb.BatchRequestItem_SegmentList: + response, err := endpoint.ListSegments(ctx, singleRequest.SegmentList) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_SegmentList{ + SegmentList: response, + }, + }) + case *pb.BatchRequestItem_SegmentMakeInline: + response, err := endpoint.MakeInlineSegment(ctx, singleRequest.SegmentMakeInline) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_SegmentMakeInline{ + SegmentMakeInline: response, + }, + }) + case *pb.BatchRequestItem_SegmentDownload: + response, err := endpoint.DownloadSegment(ctx, singleRequest.SegmentDownload) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_SegmentDownload{ + SegmentDownload: response, + }, + }) + case *pb.BatchRequestItem_SegmentBeginDelete: + response, err := endpoint.BeginDeleteSegment(ctx, singleRequest.SegmentBeginDelete) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_SegmentBeginDelete{ + SegmentBeginDelete: response, + }, + }) + case *pb.BatchRequestItem_SegmentFinishDelete: + response, err := endpoint.FinishDeleteSegment(ctx, singleRequest.SegmentFinishDelete) + if err != nil { + return resp, err + } + resp.Responses = append(resp.Responses, &pb.BatchResponseItem{ + Response: &pb.BatchResponseItem_SegmentFinishDelete{ + SegmentFinishDelete: response, + }, + }) + default: + return nil, errs.New("unsupported request type") + } + } + + return resp, nil +} diff --git a/satellite/metainfo/metainfo_test.go b/satellite/metainfo/metainfo_test.go index 0eb1d67cb..14c50d451 100644 --- a/satellite/metainfo/metainfo_test.go +++ b/satellite/metainfo/metainfo_test.go @@ -1206,7 +1206,9 @@ func TestInlineSegment(t *testing.T) { require.NoError(t, err) require.Empty(t, items) - err = metainfoClient.FinishDeleteObject(ctx, streamID) + err = metainfoClient.FinishDeleteObject(ctx, metainfo.FinishDeleteObjectParams{ + StreamID: streamID, + }) require.NoError(t, err) } }) @@ -1293,7 +1295,9 @@ func TestRemoteSegment(t *testing.T) { require.NoError(t, err) } - err = metainfoClient.FinishDeleteObject(ctx, streamID) + err = metainfoClient.FinishDeleteObject(ctx, metainfo.FinishDeleteObjectParams{ + StreamID: streamID, + }) require.NoError(t, err) items, _, err = metainfoClient.ListObjects(ctx, metainfo.ListObjectsParams{ @@ -1368,3 +1372,117 @@ func TestIDs(t *testing.T) { } }) } + +func TestBatch(t *testing.T) { + testplanet.Run(t, testplanet.Config{ + SatelliteCount: 1, StorageNodeCount: 0, UplinkCount: 1, + }, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) { + apiKey := planet.Uplinks[0].APIKey[planet.Satellites[0].ID()] + + metainfoClient, err := planet.Uplinks[0].DialMetainfo(ctx, planet.Satellites[0], apiKey) + require.NoError(t, err) + defer ctx.Check(metainfoClient.Close) + + { // create few buckets and list them in one batch + requests := make([]metainfo.BatchItem, 0) + numOfBuckets := 5 + for i := 0; i < numOfBuckets; i++ { + requests = append(requests, &metainfo.CreateBucketParams{ + Name: []byte("test-bucket-" + strconv.Itoa(i)), + PathCipher: storj.EncAESGCM, + DefaultSegmentsSize: memory.MiB.Int64(), + }) + } + requests = append(requests, &metainfo.ListBucketsParams{ + ListOpts: storj.BucketListOptions{ + Cursor: "", + Direction: storj.After, + }, + }) + responses, err := metainfoClient.Batch(ctx, requests...) + require.NoError(t, err) + require.Equal(t, numOfBuckets+1, len(responses)) + + for i := 0; i < numOfBuckets; i++ { + response, err := responses[i].CreateBucket() + require.NoError(t, err) + require.Equal(t, "test-bucket-"+strconv.Itoa(i), response.Bucket.Name) + + _, err = responses[i].GetBucket() + require.Error(t, err) + } + + bucketsListResp, err := responses[numOfBuckets].ListBuckets() + require.NoError(t, err) + require.Equal(t, numOfBuckets, len(bucketsListResp.BucketList.Items)) + } + + { // create bucket, object, upload inline segments in batch, download inline segments in batch + err := planet.Uplinks[0].CreateBucket(ctx, planet.Satellites[0], "second-test-bucket") + require.NoError(t, err) + + streamID, err := metainfoClient.BeginObject(ctx, metainfo.BeginObjectParams{ + Bucket: []byte("second-test-bucket"), + EncryptedPath: []byte("encrypted-path"), + }) + require.NoError(t, err) + + requests := make([]metainfo.BatchItem, 0) + numOfSegments := 10 + expectedData := make([][]byte, numOfSegments) + for i := 0; i < numOfSegments; i++ { + expectedData[i] = testrand.Bytes(memory.KiB) + + requests = append(requests, &metainfo.MakeInlineSegmentParams{ + StreamID: streamID, + Position: storj.SegmentPosition{ + Index: int32(i), + }, + EncryptedInlineData: expectedData[i], + }) + } + + requests = append(requests, &metainfo.CommitObjectParams{ + StreamID: streamID, + }) + + requests = append(requests, &metainfo.ListSegmentsParams{ + StreamID: streamID, + }) + + requests = append(requests, &metainfo.GetObjectParams{ + Bucket: []byte("second-test-bucket"), + EncryptedPath: []byte("encrypted-path"), + }) + + responses, err := metainfoClient.Batch(ctx, requests...) + require.NoError(t, err) + require.Equal(t, numOfSegments+3, len(responses)) + + listResponse, err := responses[numOfSegments+1].ListSegment() + require.NoError(t, err) + require.Equal(t, numOfSegments, len(listResponse.Items)) + + getResponse, err := responses[numOfSegments+2].GetObject() + require.NoError(t, err) + + requests = make([]metainfo.BatchItem, 0) + for _, segment := range listResponse.Items { + requests = append(requests, &metainfo.DownloadSegmentParams{ + StreamID: getResponse.Info.StreamID, + Position: segment.Position, + }) + } + responses, err = metainfoClient.Batch(ctx, requests...) + require.NoError(t, err) + require.Equal(t, len(listResponse.Items), len(responses)) + + for i, response := range responses { + downloadResponse, err := response.DownloadSegment() + require.NoError(t, err) + + require.Equal(t, expectedData[i], downloadResponse.Info.EncryptedInlineData) + } + } + }) +} diff --git a/uplink/metainfo/batch.go b/uplink/metainfo/batch.go new file mode 100644 index 000000000..8a15ed5f7 --- /dev/null +++ b/uplink/metainfo/batch.go @@ -0,0 +1,142 @@ +// Copyright (C) 2019 Storj Labs, Inc. +// See LICENSE for copying information. + +package metainfo + +import ( + "github.com/zeebo/errs" + + "storj.io/storj/pkg/pb" +) + +var ( + // ErrInvalidType error for inalid response type casting + ErrInvalidType = errs.New("invalid response type") +) + +// BatchItem represents single request in batch +type BatchItem interface { + BatchItem() *pb.BatchRequestItem +} + +// BatchResponse single response from batch call +type BatchResponse struct { + pbRequest interface{} + pbResponse interface{} +} + +// CreateBucket returns BatchResponse for CreateBucket request +func (resp *BatchResponse) CreateBucket() (CreateBucketResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_BucketCreate) + if !ok { + return CreateBucketResponse{}, ErrInvalidType + } + + createResponse, err := newCreateBucketResponse(item.BucketCreate) + if err != nil { + return CreateBucketResponse{}, err + } + return createResponse, nil +} + +// GetBucket returns response for GetBucket request +func (resp *BatchResponse) GetBucket() (GetBucketResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_BucketGet) + if !ok { + return GetBucketResponse{}, ErrInvalidType + } + getResponse, err := newGetBucketResponse(item.BucketGet) + if err != nil { + return GetBucketResponse{}, err + } + return getResponse, nil +} + +// ListBuckets returns response for ListBuckets request +func (resp *BatchResponse) ListBuckets() (ListBucketsResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_BucketList) + if !ok { + return ListBucketsResponse{}, ErrInvalidType + } + return newListBucketsResponse(item.BucketList), nil +} + +// BeginObject returns response for BeginObject request +func (resp *BatchResponse) BeginObject() (BeginObjectResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_ObjectBegin) + if !ok { + return BeginObjectResponse{}, ErrInvalidType + } + return newBeginObjectResponse(item.ObjectBegin), nil +} + +// BeginDeleteObject returns response for BeginDeleteObject request +func (resp *BatchResponse) BeginDeleteObject() (BeginDeleteObjectResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_ObjectBeginDelete) + if !ok { + return BeginDeleteObjectResponse{}, ErrInvalidType + } + return newBeginDeleteObjectResponse(item.ObjectBeginDelete), nil +} + +// GetObject returns response for GetObject request +func (resp *BatchResponse) GetObject() (GetObjectResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_ObjectGet) + if !ok { + return GetObjectResponse{}, ErrInvalidType + } + return newGetObjectResponse(item.ObjectGet), nil +} + +// ListObjects returns response for ListObjects request +func (resp *BatchResponse) ListObjects() (ListObjectsResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_ObjectList) + if !ok { + return ListObjectsResponse{}, ErrInvalidType + } + + requestItem, ok := resp.pbRequest.(*pb.BatchRequestItem_ObjectList) + if !ok { + return ListObjectsResponse{}, ErrInvalidType + } + + return newListObjectsResponse(item.ObjectList, requestItem.ObjectList.EncryptedPrefix, requestItem.ObjectList.Recursive), nil +} + +// BeginSegment returns response for BeginSegment request +func (resp *BatchResponse) BeginSegment() (BeginSegmentResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_SegmentBegin) + if !ok { + return BeginSegmentResponse{}, ErrInvalidType + } + + return newBeginSegmentResponse(item.SegmentBegin), nil +} + +// BeginDeleteSegment returns response for BeginDeleteSegment request +func (resp *BatchResponse) BeginDeleteSegment() (BeginDeleteSegmentResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_SegmentBeginDelete) + if !ok { + return BeginDeleteSegmentResponse{}, ErrInvalidType + } + + return newBeginDeleteSegmentResponse(item.SegmentBeginDelete), nil +} + +// ListSegment returns response for ListSegment request +func (resp *BatchResponse) ListSegment() (ListSegmentsResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_SegmentList) + if !ok { + return ListSegmentsResponse{}, ErrInvalidType + } + return newListSegmentsResponse(item.SegmentList), nil +} + +// DownloadSegment returns response for DownloadSegment request +func (resp *BatchResponse) DownloadSegment() (DownloadSegmentResponse, error) { + item, ok := resp.pbResponse.(*pb.BatchResponseItem_SegmentDownload) + if !ok { + return DownloadSegmentResponse{}, ErrInvalidType + } + return newDownloadSegmentResponse(item.SegmentDownload), nil +} diff --git a/uplink/metainfo/client.go b/uplink/metainfo/client.go index e4fde3c4e..6d580f3bd 100644 --- a/uplink/metainfo/client.go +++ b/uplink/metainfo/client.go @@ -235,29 +235,120 @@ func (client *Client) GetProjectInfo(ctx context.Context) (resp *pb.ProjectInfoR return client.client.ProjectInfo(ctx, &pb.ProjectInfoRequest{}) } -// CreateBucket creates a new bucket -func (client *Client) CreateBucket(ctx context.Context, bucket storj.Bucket) (respBucket storj.Bucket, err error) { - defer mon.Task()(&ctx)(&err) - req, err := convertBucketToProtoRequest(bucket) - if err != nil { - return respBucket, Error.Wrap(err) +// CreateBucketParams parameters for CreateBucket method +type CreateBucketParams struct { + Name []byte + PathCipher storj.CipherSuite + PartnerID []byte + DefaultSegmentsSize int64 + DefaultRedundancyScheme storj.RedundancyScheme + DefaultEncryptionParameters storj.EncryptionParameters +} + +func (params *CreateBucketParams) toRequest() *pb.BucketCreateRequest { + defaultRS := params.DefaultRedundancyScheme + defaultEP := params.DefaultEncryptionParameters + + return &pb.BucketCreateRequest{ + Name: params.Name, + PathCipher: pb.CipherSuite(params.PathCipher), + PartnerId: params.PartnerID, + DefaultSegmentSize: params.DefaultSegmentsSize, + DefaultRedundancyScheme: &pb.RedundancyScheme{ + Type: pb.RedundancyScheme_SchemeType(defaultRS.Algorithm), + MinReq: int32(defaultRS.RequiredShares), + Total: int32(defaultRS.TotalShares), + RepairThreshold: int32(defaultRS.RepairShares), + SuccessThreshold: int32(defaultRS.OptimalShares), + ErasureShareSize: defaultRS.ShareSize, + }, + DefaultEncryptionParameters: &pb.EncryptionParameters{ + CipherSuite: pb.CipherSuite(defaultEP.CipherSuite), + BlockSize: int64(defaultEP.BlockSize), + }, } - resp, err := client.client.CreateBucket(ctx, &req) +} + +// BatchItem returns single item for batch request +func (params *CreateBucketParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_BucketCreate{ + BucketCreate: params.toRequest(), + }, + } +} + +// TODO potential names *Response/*Out/*Result + +// CreateBucketResponse response for CreateBucket request +type CreateBucketResponse struct { + Bucket storj.Bucket +} + +func newCreateBucketResponse(response *pb.BucketCreateResponse) (CreateBucketResponse, error) { + bucket, err := convertProtoToBucket(response.Bucket) + if err != nil { + return CreateBucketResponse{}, err + } + return CreateBucketResponse{ + Bucket: bucket, + }, nil +} + +// CreateBucket creates a new bucket +func (client *Client) CreateBucket(ctx context.Context, params CreateBucketParams) (respBucket storj.Bucket, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.CreateBucket(ctx, params.toRequest()) if err != nil { return storj.Bucket{}, Error.Wrap(err) } - respBucket, err = convertProtoToBucket(resp.Bucket) + respBucket, err = convertProtoToBucket(response.Bucket) if err != nil { - return respBucket, Error.Wrap(err) + return storj.Bucket{}, Error.Wrap(err) } return respBucket, nil } +// GetBucketParams parmaters for GetBucketParams method +type GetBucketParams struct { + Name []byte +} + +func (params *GetBucketParams) toRequest() *pb.BucketGetRequest { + return &pb.BucketGetRequest{Name: params.Name} +} + +// BatchItem returns single item for batch request +func (params *GetBucketParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_BucketGet{ + BucketGet: params.toRequest(), + }, + } +} + +// GetBucketResponse response for GetBucket request +type GetBucketResponse struct { + Bucket storj.Bucket +} + +func newGetBucketResponse(response *pb.BucketGetResponse) (GetBucketResponse, error) { + bucket, err := convertProtoToBucket(response.Bucket) + if err != nil { + return GetBucketResponse{}, err + } + return GetBucketResponse{ + Bucket: bucket, + }, nil +} + // GetBucket returns a bucket -func (client *Client) GetBucket(ctx context.Context, bucketName string) (respBucket storj.Bucket, err error) { +func (client *Client) GetBucket(ctx context.Context, params GetBucketParams) (respBucket storj.Bucket, err error) { defer mon.Task()(&ctx)(&err) - resp, err := client.client.GetBucket(ctx, &pb.BucketGetRequest{Name: []byte(bucketName)}) + + resp, err := client.client.GetBucket(ctx, params.toRequest()) if err != nil { if status.Code(err) == codes.NotFound { return storj.Bucket{}, storj.ErrBucketNotFound.Wrap(err) @@ -267,15 +358,33 @@ func (client *Client) GetBucket(ctx context.Context, bucketName string) (respBuc respBucket, err = convertProtoToBucket(resp.Bucket) if err != nil { - return respBucket, Error.Wrap(err) + return storj.Bucket{}, Error.Wrap(err) } return respBucket, nil } +// DeleteBucketParams parmaters for DeleteBucket method +type DeleteBucketParams struct { + Name []byte +} + +func (params *DeleteBucketParams) toRequest() *pb.BucketDeleteRequest { + return &pb.BucketDeleteRequest{Name: params.Name} +} + +// BatchItem returns single item for batch request +func (params *DeleteBucketParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_BucketDelete{ + BucketDelete: params.toRequest(), + }, + } +} + // DeleteBucket deletes a bucket -func (client *Client) DeleteBucket(ctx context.Context, bucketName string) (err error) { +func (client *Client) DeleteBucket(ctx context.Context, params DeleteBucketParams) (err error) { defer mon.Task()(&ctx)(&err) - _, err = client.client.DeleteBucket(ctx, &pb.BucketDeleteRequest{Name: []byte(bucketName)}) + _, err = client.client.DeleteBucket(ctx, params.toRequest()) if err != nil { if status.Code(err) == codes.NotFound { return storj.ErrBucketNotFound.Wrap(err) @@ -285,15 +394,54 @@ func (client *Client) DeleteBucket(ctx context.Context, bucketName string) (err return nil } -// ListBuckets lists buckets -func (client *Client) ListBuckets(ctx context.Context, listOpts storj.BucketListOptions) (_ storj.BucketList, err error) { - defer mon.Task()(&ctx)(&err) - req := &pb.BucketListRequest{ - Cursor: []byte(listOpts.Cursor), - Limit: int32(listOpts.Limit), - Direction: int32(listOpts.Direction), +// ListBucketsParams parmaters for ListBucketsParams method +type ListBucketsParams struct { + ListOpts storj.BucketListOptions +} + +func (params *ListBucketsParams) toRequest() *pb.BucketListRequest { + return &pb.BucketListRequest{ + Cursor: []byte(params.ListOpts.Cursor), + Limit: int32(params.ListOpts.Limit), + Direction: int32(params.ListOpts.Direction), } - resp, err := client.client.ListBuckets(ctx, req) +} + +// BatchItem returns single item for batch request +func (params *ListBucketsParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_BucketList{ + BucketList: params.toRequest(), + }, + } +} + +// ListBucketsResponse response for ListBucket request +type ListBucketsResponse struct { + BucketList storj.BucketList +} + +func newListBucketsResponse(response *pb.BucketListResponse) ListBucketsResponse { + bucketList := storj.BucketList{ + More: response.More, + } + bucketList.Items = make([]storj.Bucket, len(response.Items)) + for i, item := range response.GetItems() { + bucketList.Items[i] = storj.Bucket{ + Name: string(item.Name), + Created: item.CreatedAt, + } + } + return ListBucketsResponse{ + BucketList: bucketList, + } +} + +// ListBuckets lists buckets +func (client *Client) ListBuckets(ctx context.Context, params ListBucketsParams) (_ storj.BucketList, err error) { + defer mon.Task()(&ctx)(&err) + + resp, err := client.client.ListBuckets(ctx, params.toRequest()) if err != nil { return storj.BucketList{}, Error.Wrap(err) } @@ -310,32 +458,6 @@ func (client *Client) ListBuckets(ctx context.Context, listOpts storj.BucketList return resultBucketList, nil } -func convertBucketToProtoRequest(bucket storj.Bucket) (bucketReq pb.BucketCreateRequest, err error) { - rs := bucket.DefaultRedundancyScheme - partnerID, err := bucket.PartnerID.MarshalJSON() - if err != nil { - return bucketReq, Error.Wrap(err) - } - return pb.BucketCreateRequest{ - Name: []byte(bucket.Name), - PathCipher: pb.CipherSuite(bucket.PathCipher), - PartnerId: partnerID, - DefaultSegmentSize: bucket.DefaultSegmentsSize, - DefaultRedundancyScheme: &pb.RedundancyScheme{ - Type: pb.RedundancyScheme_SchemeType(rs.Algorithm), - MinReq: int32(rs.RequiredShares), - Total: int32(rs.TotalShares), - RepairThreshold: int32(rs.RepairShares), - SuccessThreshold: int32(rs.OptimalShares), - ErasureShareSize: rs.ShareSize, - }, - DefaultEncryptionParameters: &pb.EncryptionParameters{ - CipherSuite: pb.CipherSuite(bucket.DefaultEncryptionParameters.CipherSuite), - BlockSize: int64(bucket.DefaultEncryptionParameters.BlockSize), - }, - }, nil -} - func convertProtoToBucket(pbBucket *pb.Bucket) (bucket storj.Bucket, err error) { defaultRS := pbBucket.GetDefaultRedundancyScheme() defaultEP := pbBucket.GetDefaultEncryptionParameters() @@ -365,6 +487,37 @@ func convertProtoToBucket(pbBucket *pb.Bucket) (bucket storj.Bucket, err error) }, nil } +// SetBucketAttributionParams parameters for SetBucketAttribution method +type SetBucketAttributionParams struct { + Bucket string + PartnerID uuid.UUID +} + +func (params *SetBucketAttributionParams) toRequest() *pb.BucketSetAttributionRequest { + return &pb.BucketSetAttributionRequest{ + Name: []byte(params.Bucket), + PartnerId: params.PartnerID[:], + } +} + +// BatchItem returns single item for batch request +func (params *SetBucketAttributionParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_BucketSetAttribution{ + BucketSetAttribution: params.toRequest(), + }, + } +} + +// SetBucketAttribution tries to set the attribution information on the bucket. +func (client *Client) SetBucketAttribution(ctx context.Context, params SetBucketAttributionParams) (err error) { + defer mon.Task()(&ctx)(&err) + + _, err = client.client.SetBucketAttribution(ctx, params.toRequest()) + + return Error.Wrap(err) +} + // BeginObjectParams parmaters for BeginObject method type BeginObjectParams struct { Bucket []byte @@ -375,11 +528,8 @@ type BeginObjectParams struct { ExpiresAt time.Time } -// BeginObject begins object creation -func (client *Client) BeginObject(ctx context.Context, params BeginObjectParams) (_ storj.StreamID, err error) { - defer mon.Task()(&ctx)(&err) - - response, err := client.client.BeginObject(ctx, &pb.ObjectBeginRequest{ +func (params *BeginObjectParams) toRequest() *pb.ObjectBeginRequest { + return &pb.ObjectBeginRequest{ Bucket: params.Bucket, EncryptedPath: params.EncryptedPath, Version: params.Version, @@ -396,7 +546,34 @@ func (client *Client) BeginObject(ctx context.Context, params BeginObjectParams) CipherSuite: pb.CipherSuite(params.EncryptionParameters.CipherSuite), BlockSize: int64(params.EncryptionParameters.BlockSize), }, - }) + } +} + +// BatchItem returns single item for batch request +func (params *BeginObjectParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_ObjectBegin{ + ObjectBegin: params.toRequest(), + }, + } +} + +// BeginObjectResponse response for BeginObject request +type BeginObjectResponse struct { + StreamID storj.StreamID +} + +func newBeginObjectResponse(response *pb.ObjectBeginResponse) BeginObjectResponse { + return BeginObjectResponse{ + StreamID: response.StreamId, + } +} + +// BeginObject begins object creation +func (client *Client) BeginObject(ctx context.Context, params BeginObjectParams) (_ storj.StreamID, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.BeginObject(ctx, params.toRequest()) if err != nil { return nil, Error.Wrap(err) } @@ -412,15 +589,29 @@ type CommitObjectParams struct { EncryptedMetadata []byte } +func (params *CommitObjectParams) toRequest() *pb.ObjectCommitRequest { + return &pb.ObjectCommitRequest{ + StreamId: params.StreamID, + EncryptedMetadataNonce: params.EncryptedMetadataNonce, + EncryptedMetadata: params.EncryptedMetadata, + } +} + +// BatchItem returns single item for batch request +func (params *CommitObjectParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_ObjectCommit{ + ObjectCommit: params.toRequest(), + }, + } +} + // CommitObject commits created object func (client *Client) CommitObject(ctx context.Context, params CommitObjectParams) (err error) { defer mon.Task()(&ctx)(&err) - _, err = client.client.CommitObject(ctx, &pb.ObjectCommitRequest{ - StreamId: params.StreamID, - EncryptedMetadataNonce: params.EncryptedMetadataNonce, - EncryptedMetadata: params.EncryptedMetadata, - }) + _, err = client.client.CommitObject(ctx, params.toRequest()) + return Error.Wrap(err) } @@ -431,23 +622,29 @@ type GetObjectParams struct { Version int32 } -// GetObject gets single object -func (client *Client) GetObject(ctx context.Context, params GetObjectParams) (_ storj.ObjectInfo, err error) { - defer mon.Task()(&ctx)(&err) - - response, err := client.client.GetObject(ctx, &pb.ObjectGetRequest{ +func (params *GetObjectParams) toRequest() *pb.ObjectGetRequest { + return &pb.ObjectGetRequest{ Bucket: params.Bucket, EncryptedPath: params.EncryptedPath, Version: params.Version, - }) - - if err != nil { - if status.Code(err) == codes.NotFound { - return storj.ObjectInfo{}, storj.ErrObjectNotFound.Wrap(err) - } - return storj.ObjectInfo{}, Error.Wrap(err) } +} +// BatchItem returns single item for batch request +func (params *GetObjectParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_ObjectGet{ + ObjectGet: params.toRequest(), + }, + } +} + +// GetObjectResponse response for GetObject request +type GetObjectResponse struct { + Info storj.ObjectInfo +} + +func newGetObjectResponse(response *pb.ObjectGetResponse) GetObjectResponse { object := storj.ObjectInfo{ Bucket: string(response.Object.Bucket), Path: storj.Path(response.Object.EncryptedPath), @@ -478,8 +675,26 @@ func (client *Client) GetObject(ctx context.Context, params GetObjectParams) (_ TotalShares: int16(pbRS.Total), } } + return GetObjectResponse{ + Info: object, + } +} - return object, nil +// GetObject gets single object +func (client *Client) GetObject(ctx context.Context, params GetObjectParams) (_ storj.ObjectInfo, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.GetObject(ctx, params.toRequest()) + + if err != nil { + if status.Code(err) == codes.NotFound { + return storj.ObjectInfo{}, storj.ErrObjectNotFound.Wrap(err) + } + return storj.ObjectInfo{}, Error.Wrap(err) + } + + getResponse := newGetObjectResponse(response) + return getResponse.Info, nil } // BeginDeleteObjectParams parameters for BeginDeleteObject method @@ -489,15 +704,39 @@ type BeginDeleteObjectParams struct { Version int32 } +func (params *BeginDeleteObjectParams) toRequest() *pb.ObjectBeginDeleteRequest { + return &pb.ObjectBeginDeleteRequest{ + Bucket: params.Bucket, + EncryptedPath: params.EncryptedPath, + Version: params.Version, + } +} + +// BatchItem returns single item for batch request +func (params *BeginDeleteObjectParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_ObjectBeginDelete{ + ObjectBeginDelete: params.toRequest(), + }, + } +} + +// BeginDeleteObjectResponse response for BeginDeleteObject request +type BeginDeleteObjectResponse struct { + StreamID storj.StreamID +} + +func newBeginDeleteObjectResponse(response *pb.ObjectBeginDeleteResponse) BeginDeleteObjectResponse { + return BeginDeleteObjectResponse{ + StreamID: response.StreamId, + } +} + // BeginDeleteObject begins object deletion process func (client *Client) BeginDeleteObject(ctx context.Context, params BeginDeleteObjectParams) (_ storj.StreamID, err error) { defer mon.Task()(&ctx)(&err) - response, err := client.client.BeginDeleteObject(ctx, &pb.ObjectBeginDeleteRequest{ - Bucket: params.Bucket, - EncryptedPath: params.EncryptedPath, - Version: params.Version, - }) + response, err := client.client.BeginDeleteObject(ctx, params.toRequest()) if err != nil { if status.Code(err) == codes.NotFound { return storj.StreamID{}, storj.ErrObjectNotFound.Wrap(err) @@ -508,13 +747,32 @@ func (client *Client) BeginDeleteObject(ctx context.Context, params BeginDeleteO return response.StreamId, nil } +// FinishDeleteObjectParams parameters for FinishDeleteObject method +type FinishDeleteObjectParams struct { + StreamID storj.StreamID +} + +func (params *FinishDeleteObjectParams) toRequest() *pb.ObjectFinishDeleteRequest { + return &pb.ObjectFinishDeleteRequest{ + StreamId: params.StreamID, + } +} + +// BatchItem returns single item for batch request +func (params *FinishDeleteObjectParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_ObjectFinishDelete{ + ObjectFinishDelete: params.toRequest(), + }, + } +} + // FinishDeleteObject finishes object deletion process -func (client *Client) FinishDeleteObject(ctx context.Context, streamID storj.StreamID) (err error) { +func (client *Client) FinishDeleteObject(ctx context.Context, params FinishDeleteObjectParams) (err error) { defer mon.Task()(&ctx)(&err) - _, err = client.client.FinishDeleteObject(ctx, &pb.ObjectFinishDeleteRequest{ - StreamId: streamID, - }) + _, err = client.client.FinishDeleteObject(ctx, params.toRequest()) + return Error.Wrap(err) } @@ -528,11 +786,8 @@ type ListObjectsParams struct { Recursive bool } -// ListObjects lists objects according to specific parameters -func (client *Client) ListObjects(ctx context.Context, params ListObjectsParams) (_ []storj.ObjectListItem, more bool, err error) { - defer mon.Task()(&ctx)(&err) - - response, err := client.client.ListObjects(ctx, &pb.ObjectListRequest{ +func (params *ListObjectsParams) toRequest() *pb.ObjectListRequest { + return &pb.ObjectListRequest{ Bucket: params.Bucket, EncryptedPrefix: params.EncryptedPrefix, EncryptedCursor: params.EncryptedCursor, @@ -541,16 +796,30 @@ func (client *Client) ListObjects(ctx context.Context, params ListObjectsParams) Metadata: params.IncludeMetadata, }, Recursive: params.Recursive, - }) - if err != nil { - return []storj.ObjectListItem{}, false, Error.Wrap(err) } +} +// BatchItem returns single item for batch request +func (params *ListObjectsParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_ObjectList{ + ObjectList: params.toRequest(), + }, + } +} + +// ListObjectsResponse response for ListObjects request +type ListObjectsResponse struct { + Items []storj.ObjectListItem + More bool +} + +func newListObjectsResponse(response *pb.ObjectListResponse, encryptedPrefix []byte, recursive bool) ListObjectsResponse { objects := make([]storj.ObjectListItem, len(response.Items)) for i, object := range response.Items { encryptedPath := object.EncryptedPath isPrefix := false - if !params.Recursive && len(encryptedPath) != 0 && encryptedPath[len(encryptedPath)-1] == '/' && !bytes.Equal(encryptedPath, params.EncryptedPrefix) { + if !recursive && len(encryptedPath) != 0 && encryptedPath[len(encryptedPath)-1] == '/' && !bytes.Equal(encryptedPath, encryptedPrefix) { isPrefix = true } @@ -568,7 +837,23 @@ func (client *Client) ListObjects(ctx context.Context, params ListObjectsParams) } } - return objects, response.More, Error.Wrap(err) + return ListObjectsResponse{ + Items: objects, + More: response.More, + } +} + +// ListObjects lists objects according to specific parameters +func (client *Client) ListObjects(ctx context.Context, params ListObjectsParams) (_ []storj.ObjectListItem, more bool, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.ListObjects(ctx, params.toRequest()) + if err != nil { + return []storj.ObjectListItem{}, false, Error.Wrap(err) + } + + listResponse := newListObjectsResponse(response, params.EncryptedPrefix, params.Recursive) + return listResponse.Items, listResponse.More, Error.Wrap(err) } // BeginSegmentParams parameters for BeginSegment method @@ -578,18 +863,46 @@ type BeginSegmentParams struct { MaxOderLimit int64 } -// BeginSegment begins segment upload -func (client *Client) BeginSegment(ctx context.Context, params BeginSegmentParams) (_ storj.SegmentID, limits []*pb.AddressedOrderLimit, piecePrivateKey storj.PiecePrivateKey, err error) { - defer mon.Task()(&ctx)(&err) - - response, err := client.client.BeginSegment(ctx, &pb.SegmentBeginRequest{ +func (params *BeginSegmentParams) toRequest() *pb.SegmentBeginRequest { + return &pb.SegmentBeginRequest{ StreamId: params.StreamID, Position: &pb.SegmentPosition{ PartNumber: params.Position.PartNumber, Index: params.Position.Index, }, MaxOrderLimit: params.MaxOderLimit, - }) + } +} + +// BatchItem returns single item for batch request +func (params *BeginSegmentParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_SegmentBegin{ + SegmentBegin: params.toRequest(), + }, + } +} + +// BeginSegmentResponse response for BeginSegment request +type BeginSegmentResponse struct { + SegmentID storj.SegmentID + Limits []*pb.AddressedOrderLimit + PiecePrivateKey storj.PiecePrivateKey +} + +func newBeginSegmentResponse(response *pb.SegmentBeginResponse) BeginSegmentResponse { + return BeginSegmentResponse{ + SegmentID: response.SegmentId, + Limits: response.AddressedLimits, + PiecePrivateKey: response.PrivateKey, + } +} + +// BeginSegment begins segment upload +func (client *Client) BeginSegment(ctx context.Context, params BeginSegmentParams) (_ storj.SegmentID, limits []*pb.AddressedOrderLimit, piecePrivateKey storj.PiecePrivateKey, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.BeginSegment(ctx, params.toRequest()) if err != nil { return storj.SegmentID{}, nil, storj.PiecePrivateKey{}, Error.Wrap(err) } @@ -606,23 +919,33 @@ type CommitSegmentParams struct { UploadResult []*pb.SegmentPieceUploadResult } -// CommitSegmentNew commits segment after upload -func (client *Client) CommitSegmentNew(ctx context.Context, params CommitSegmentParams) (err error) { - defer mon.Task()(&ctx)(&err) - - _, err = client.client.CommitSegment(ctx, &pb.SegmentCommitRequest{ +func (params *CommitSegmentParams) toRequest() *pb.SegmentCommitRequest { + return &pb.SegmentCommitRequest{ SegmentId: params.SegmentID, EncryptedKeyNonce: params.Encryption.EncryptedKeyNonce, EncryptedKey: params.Encryption.EncryptedKey, SizeEncryptedData: params.SizeEncryptedData, UploadResult: params.UploadResult, - }) - if err != nil { - return Error.Wrap(err) } +} - return nil +// BatchItem returns single item for batch request +func (params *CommitSegmentParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_SegmentCommit{ + SegmentCommit: params.toRequest(), + }, + } +} + +// CommitSegmentNew commits segment after upload +func (client *Client) CommitSegmentNew(ctx context.Context, params CommitSegmentParams) (err error) { + defer mon.Task()(&ctx)(&err) + + _, err = client.client.CommitSegment(ctx, params.toRequest()) + + return Error.Wrap(err) } // MakeInlineSegmentParams parameters for MakeInlineSegment method @@ -633,11 +956,8 @@ type MakeInlineSegmentParams struct { EncryptedInlineData []byte } -// MakeInlineSegment commits segment after upload -func (client *Client) MakeInlineSegment(ctx context.Context, params MakeInlineSegmentParams) (err error) { - defer mon.Task()(&ctx)(&err) - - _, err = client.client.MakeInlineSegment(ctx, &pb.SegmentMakeInlineRequest{ +func (params *MakeInlineSegmentParams) toRequest() *pb.SegmentMakeInlineRequest { + return &pb.SegmentMakeInlineRequest{ StreamId: params.StreamID, Position: &pb.SegmentPosition{ PartNumber: params.Position.PartNumber, @@ -646,12 +966,25 @@ func (client *Client) MakeInlineSegment(ctx context.Context, params MakeInlineSe EncryptedKeyNonce: params.Encryption.EncryptedKeyNonce, EncryptedKey: params.Encryption.EncryptedKey, EncryptedInlineData: params.EncryptedInlineData, - }) - if err != nil { - return Error.Wrap(err) } +} - return nil +// BatchItem returns single item for batch request +func (params *MakeInlineSegmentParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_SegmentMakeInline{ + SegmentMakeInline: params.toRequest(), + }, + } +} + +// MakeInlineSegment commits segment after upload +func (client *Client) MakeInlineSegment(ctx context.Context, params MakeInlineSegmentParams) (err error) { + defer mon.Task()(&ctx)(&err) + + _, err = client.client.MakeInlineSegment(ctx, params.toRequest()) + + return Error.Wrap(err) } // BeginDeleteSegmentParams parameters for BeginDeleteSegment method @@ -660,17 +993,45 @@ type BeginDeleteSegmentParams struct { Position storj.SegmentPosition } -// BeginDeleteSegment begins segment upload process -func (client *Client) BeginDeleteSegment(ctx context.Context, params BeginDeleteSegmentParams) (_ storj.SegmentID, limits []*pb.AddressedOrderLimit, _ storj.PiecePrivateKey, err error) { - defer mon.Task()(&ctx)(&err) - - response, err := client.client.BeginDeleteSegment(ctx, &pb.SegmentBeginDeleteRequest{ +func (params *BeginDeleteSegmentParams) toRequest() *pb.SegmentBeginDeleteRequest { + return &pb.SegmentBeginDeleteRequest{ StreamId: params.StreamID, Position: &pb.SegmentPosition{ PartNumber: params.Position.PartNumber, Index: params.Position.Index, }, - }) + } +} + +// BatchItem returns single item for batch request +func (params *BeginDeleteSegmentParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_SegmentBeginDelete{ + SegmentBeginDelete: params.toRequest(), + }, + } +} + +// BeginDeleteSegmentResponse response for BeginDeleteSegment request +type BeginDeleteSegmentResponse struct { + SegmentID storj.SegmentID + Limits []*pb.AddressedOrderLimit + PiecePrivateKey storj.PiecePrivateKey +} + +func newBeginDeleteSegmentResponse(response *pb.SegmentBeginDeleteResponse) BeginDeleteSegmentResponse { + return BeginDeleteSegmentResponse{ + SegmentID: response.SegmentId, + Limits: response.AddressedLimits, + PiecePrivateKey: response.PrivateKey, + } +} + +// BeginDeleteSegment begins segment upload process +func (client *Client) BeginDeleteSegment(ctx context.Context, params BeginDeleteSegmentParams) (_ storj.SegmentID, limits []*pb.AddressedOrderLimit, _ storj.PiecePrivateKey, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.BeginDeleteSegment(ctx, params.toRequest()) if err != nil { return storj.SegmentID{}, nil, storj.PiecePrivateKey{}, Error.Wrap(err) } @@ -685,14 +1046,28 @@ type FinishDeleteSegmentParams struct { DeleteResults []*pb.SegmentPieceDeleteResult } +func (params *FinishDeleteSegmentParams) toRequest() *pb.SegmentFinishDeleteRequest { + return &pb.SegmentFinishDeleteRequest{ + SegmentId: params.SegmentID, + Results: params.DeleteResults, + } +} + +// BatchItem returns single item for batch request +func (params *FinishDeleteSegmentParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_SegmentFinishDelete{ + SegmentFinishDelete: params.toRequest(), + }, + } +} + // FinishDeleteSegment finishes segment upload process func (client *Client) FinishDeleteSegment(ctx context.Context, params FinishDeleteSegmentParams) (err error) { defer mon.Task()(&ctx)(&err) - _, err = client.client.FinishDeleteSegment(ctx, &pb.SegmentFinishDeleteRequest{ - SegmentId: params.SegmentID, - Results: params.DeleteResults, - }) + _, err = client.client.FinishDeleteSegment(ctx, params.toRequest()) + return Error.Wrap(err) } @@ -702,21 +1077,33 @@ type DownloadSegmentParams struct { Position storj.SegmentPosition } -// DownloadSegment gets info for downloading remote segment or data from inline segment -func (client *Client) DownloadSegment(ctx context.Context, params DownloadSegmentParams) (_ storj.SegmentDownloadInfo, _ []*pb.AddressedOrderLimit, err error) { - defer mon.Task()(&ctx)(&err) - - response, err := client.client.DownloadSegment(ctx, &pb.SegmentDownloadRequest{ +func (params *DownloadSegmentParams) toRequest() *pb.SegmentDownloadRequest { + return &pb.SegmentDownloadRequest{ StreamId: params.StreamID, CursorPosition: &pb.SegmentPosition{ PartNumber: params.Position.PartNumber, Index: params.Position.Index, }, - }) - if err != nil { - return storj.SegmentDownloadInfo{}, nil, Error.Wrap(err) } +} +// BatchItem returns single item for batch request +func (params *DownloadSegmentParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_SegmentDownload{ + SegmentDownload: params.toRequest(), + }, + } +} + +// DownloadSegmentResponse response for DownloadSegment request +type DownloadSegmentResponse struct { + Info storj.SegmentDownloadInfo + + Limits []*pb.AddressedOrderLimit +} + +func newDownloadSegmentResponse(response *pb.SegmentDownloadResponse) DownloadSegmentResponse { info := storj.SegmentDownloadInfo{ SegmentID: response.SegmentId, Size: response.SegmentSize, @@ -739,8 +1126,23 @@ func (client *Client) DownloadSegment(ctx context.Context, params DownloadSegmen response.AddressedLimits[i] = nil } } + return DownloadSegmentResponse{ + Info: info, + Limits: response.AddressedLimits, + } +} - return info, response.AddressedLimits, nil +// DownloadSegment gets info for downloading remote segment or data from inline segment +func (client *Client) DownloadSegment(ctx context.Context, params DownloadSegmentParams) (_ storj.SegmentDownloadInfo, _ []*pb.AddressedOrderLimit, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.DownloadSegment(ctx, params.toRequest()) + if err != nil { + return storj.SegmentDownloadInfo{}, nil, Error.Wrap(err) + } + + downloadResponse := newDownloadSegmentResponse(response) + return downloadResponse.Info, downloadResponse.Limits, nil } // ListSegmentsParams parameters for ListSegment method @@ -750,22 +1152,33 @@ type ListSegmentsParams struct { Limit int32 } -// ListSegmentsNew lists object segments -func (client *Client) ListSegmentsNew(ctx context.Context, params ListSegmentsParams) (_ []storj.SegmentListItem, more bool, err error) { - defer mon.Task()(&ctx)(&err) +// ListSegmentsResponse response for ListSegments request +type ListSegmentsResponse struct { + Items []storj.SegmentListItem + More bool +} - response, err := client.client.ListSegments(ctx, &pb.SegmentListRequest{ +func (params *ListSegmentsParams) toRequest() *pb.SegmentListRequest { + return &pb.SegmentListRequest{ StreamId: params.StreamID, CursorPosition: &pb.SegmentPosition{ PartNumber: params.CursorPosition.PartNumber, Index: params.CursorPosition.Index, }, Limit: params.Limit, - }) - if err != nil { - return []storj.SegmentListItem{}, false, Error.Wrap(err) } +} +// BatchItem returns single item for batch request +func (params *ListSegmentsParams) BatchItem() *pb.BatchRequestItem { + return &pb.BatchRequestItem{ + Request: &pb.BatchRequestItem_SegmentList{ + SegmentList: params.toRequest(), + }, + } +} + +func newListSegmentsResponse(response *pb.SegmentListResponse) ListSegmentsResponse { items := make([]storj.SegmentListItem, len(response.Items)) for i, responseItem := range response.Items { items[i] = storj.SegmentListItem{ @@ -775,23 +1188,47 @@ func (client *Client) ListSegmentsNew(ctx context.Context, params ListSegmentsPa }, } } - return items, response.More, Error.Wrap(err) + return ListSegmentsResponse{ + Items: items, + More: response.More, + } } -// SetBucketAttributionParams parameters for SetBucketAttribution method -type SetBucketAttributionParams struct { - Bucket string - PartnerID uuid.UUID -} - -// SetBucketAttribution tries to set the attribution information on the bucket. -func (client *Client) SetBucketAttribution(ctx context.Context, params SetBucketAttributionParams) (err error) { +// ListSegmentsNew lists object segments +func (client *Client) ListSegmentsNew(ctx context.Context, params ListSegmentsParams) (_ []storj.SegmentListItem, more bool, err error) { defer mon.Task()(&ctx)(&err) - _, err = client.client.SetBucketAttribution(ctx, &pb.BucketSetAttributionRequest{ - PartnerId: params.PartnerID[:], // TODO: implement storj.UUID that can be sent using pb - Name: []byte(params.Bucket), - }) + response, err := client.client.ListSegments(ctx, params.toRequest()) + if err != nil { + return []storj.SegmentListItem{}, false, Error.Wrap(err) + } - return Error.Wrap(err) + listResponse := newListSegmentsResponse(response) + return listResponse.Items, listResponse.More, Error.Wrap(err) +} + +// Batch sends multiple requests in one batch +func (client *Client) Batch(ctx context.Context, requests ...BatchItem) (resp []BatchResponse, err error) { + defer mon.Task()(&ctx)(&err) + + batchItems := make([]*pb.BatchRequestItem, len(requests)) + for i, request := range requests { + batchItems[i] = request.BatchItem() + } + response, err := client.client.Batch(ctx, &pb.BatchRequest{ + Requests: batchItems, + }) + if err != nil { + return []BatchResponse{}, err + } + + resp = make([]BatchResponse, len(response.Responses)) + for i, response := range response.Responses { + resp[i] = BatchResponse{ + pbRequest: batchItems[i].Request, + pbResponse: response.Response, + } + } + + return resp, nil } diff --git a/uplink/storage/buckets/store.go b/uplink/storage/buckets/store.go index 513d38a98..737dbe1f9 100644 --- a/uplink/storage/buckets/store.go +++ b/uplink/storage/buckets/store.go @@ -38,23 +38,39 @@ func NewStore(metainfoClient metainfo.Client) *BucketStore { // Create creates a bucket func (store *BucketStore) Create(ctx context.Context, bucket storj.Bucket) (_ storj.Bucket, err error) { defer mon.Task()(&ctx)(&err) - return store.metainfoClient.CreateBucket(ctx, bucket) + + // uuid MarshalJSON implementation always returns err == nil + partnerID, _ := bucket.PartnerID.MarshalJSON() + return store.metainfoClient.CreateBucket(ctx, metainfo.CreateBucketParams{ + Name: []byte(bucket.Name), + PathCipher: bucket.PathCipher, + PartnerID: partnerID, + DefaultSegmentsSize: bucket.DefaultSegmentsSize, + DefaultRedundancyScheme: bucket.DefaultRedundancyScheme, + DefaultEncryptionParameters: bucket.DefaultEncryptionParameters, + }) } // Get returns a bucket func (store *BucketStore) Get(ctx context.Context, bucketName string) (_ storj.Bucket, err error) { defer mon.Task()(&ctx)(&err) - return store.metainfoClient.GetBucket(ctx, bucketName) + return store.metainfoClient.GetBucket(ctx, metainfo.GetBucketParams{ + Name: []byte(bucketName), + }) } // Delete deletes a bucket func (store *BucketStore) Delete(ctx context.Context, bucketName string) (err error) { defer mon.Task()(&ctx)(&err) - return store.metainfoClient.DeleteBucket(ctx, bucketName) + return store.metainfoClient.DeleteBucket(ctx, metainfo.DeleteBucketParams{ + Name: []byte(bucketName), + }) } // List returns a list of buckets func (store *BucketStore) List(ctx context.Context, listOpts storj.BucketListOptions) (_ storj.BucketList, err error) { defer mon.Task()(&ctx)(&err) - return store.metainfoClient.ListBuckets(ctx, listOpts) + return store.metainfoClient.ListBuckets(ctx, metainfo.ListBucketsParams{ + ListOpts: listOpts, + }) }