[#79] object: Implement Range\RangeHash
requests for EC object
All checks were successful
DCO action / DCO (pull_request) Successful in 1m16s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m37s
Tests and linters / Lint (pull_request) Successful in 1m56s
Tests and linters / Tests (1.19) (pull_request) Successful in 2m9s
Tests and linters / Tests with -race (pull_request) Successful in 2m2s
All checks were successful
DCO action / DCO (pull_request) Successful in 1m16s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m37s
Tests and linters / Lint (pull_request) Successful in 1m56s
Tests and linters / Tests (1.19) (pull_request) Successful in 2m9s
Tests and linters / Tests with -race (pull_request) Successful in 2m2s
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
df9b65324a
commit
67c6f305b2
3 changed files with 24 additions and 0 deletions
|
@ -1962,6 +1962,8 @@ func (r *GetRangeResponseBody) ToGRPCMessage() grpc.Message {
|
|||
m.SetChunk(v.ToGRPCMessage().(*object.GetRangeResponse_Body_Chunk))
|
||||
case *SplitInfo:
|
||||
m.SetSplitInfo(v.ToGRPCMessage().(*object.SplitInfo))
|
||||
case *ECInfo:
|
||||
m.SetECInfo(v.ToGRPCMessage().(*object.ECInfo))
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown get range part %T", v))
|
||||
}
|
||||
|
@ -1994,6 +1996,12 @@ func (r *GetRangeResponseBody) FromGRPCMessage(m grpc.Message) error {
|
|||
r.rngPart = partSplit
|
||||
err = partSplit.FromGRPCMessage(pt.SplitInfo)
|
||||
}
|
||||
case *object.GetRangeResponse_Body_EcInfo:
|
||||
if pt != nil {
|
||||
partEC := new(ECInfo)
|
||||
r.rngPart = partEC
|
||||
err = partEC.FromGRPCMessage(pt.EcInfo)
|
||||
}
|
||||
default:
|
||||
err = fmt.Errorf("unknown get range part %T", pt)
|
||||
}
|
||||
|
|
|
@ -435,6 +435,13 @@ func (m *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) {
|
|||
}
|
||||
}
|
||||
|
||||
// SetECInfo sets meta info about the erasure-coded object.
|
||||
func (m *GetRangeResponse_Body) SetECInfo(v *ECInfo) {
|
||||
m.RangePart = &GetRangeResponse_Body_EcInfo{
|
||||
EcInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) {
|
||||
m.Body = v
|
||||
|
|
|
@ -117,6 +117,7 @@ const (
|
|||
|
||||
getRangeRespChunkField = 1
|
||||
getRangeRespSplitInfoField = 2
|
||||
getRangeRespECInfoField = 3
|
||||
|
||||
getRangeHashReqBodyAddressField = 1
|
||||
getRangeHashReqBodyRangesField = 2
|
||||
|
@ -1110,6 +1111,10 @@ func (r *GetRangeResponseBody) StableMarshal(buf []byte) []byte {
|
|||
if v != nil {
|
||||
proto.NestedStructureMarshal(getRangeRespSplitInfoField, buf, v)
|
||||
}
|
||||
case *ECInfo:
|
||||
if v != nil {
|
||||
proto.NestedStructureMarshal(getRangeRespECInfoField, buf, v)
|
||||
}
|
||||
default:
|
||||
panic("unknown one of object get range request body type")
|
||||
}
|
||||
|
@ -1132,6 +1137,10 @@ func (r *GetRangeResponseBody) StableSize() (size int) {
|
|||
if v != nil {
|
||||
size = proto.NestedStructureSize(getRangeRespSplitInfoField, v)
|
||||
}
|
||||
case *ECInfo:
|
||||
if v != nil {
|
||||
size = proto.NestedStructureSize(getRangeRespECInfoField, v)
|
||||
}
|
||||
default:
|
||||
panic("unknown one of object get range request body type")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue