[#xx] object: Store EC chunk's parent parent's attributes
In FrostFS we can: - Split a big object into parts: Object -> Parts - Split an object into chunks: Object -> Chunks - Do both: Object -> Parts -> Chunks And object's attributes are propagated in the following way: - Object (attributes) -> Parts (no attributes) - Object (attributes) -> Chunks (attributes) - Object (attributes) -> Parts (no attributes) -> Chunks (no attributes) As a result, in a FrostFS node, there's no way to determine the expiration epoch of an expirable regular object. Now attributes are stored in the following way: - If a chunk's parent has no parent, store chunk's parent's attributes - If a chunk's parent has a parent, store chunk's parent's parent's attributes Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
parent
328d214d2d
commit
cda1c5b40d
1 changed files with 3 additions and 1 deletions
|
@ -33,19 +33,21 @@ func (c *Constructor) Split(obj *objectSDK.Object, key *ecdsa.PrivateKey) ([]*ob
|
||||||
chunk.SetPayload(payloadShards[i])
|
chunk.SetPayload(payloadShards[i])
|
||||||
chunk.SetPayloadSize(uint64(len(payloadShards[i])))
|
chunk.SetPayloadSize(uint64(len(payloadShards[i])))
|
||||||
|
|
||||||
|
attributes := obj.Attributes()
|
||||||
var parentSplitParentID *oid.ID
|
var parentSplitParentID *oid.ID
|
||||||
if obj.HasParent() {
|
if obj.HasParent() {
|
||||||
splitParentID, ok := obj.Parent().ID()
|
splitParentID, ok := obj.Parent().ID()
|
||||||
if ok {
|
if ok {
|
||||||
parentSplitParentID = &splitParentID
|
parentSplitParentID = &splitParentID
|
||||||
}
|
}
|
||||||
|
attributes = obj.Parent().Attributes()
|
||||||
}
|
}
|
||||||
|
|
||||||
ecParentInfo := objectSDK.ECParentInfo{
|
ecParentInfo := objectSDK.ECParentInfo{
|
||||||
ID: parent,
|
ID: parent,
|
||||||
SplitID: obj.SplitID(),
|
SplitID: obj.SplitID(),
|
||||||
SplitParentID: parentSplitParentID,
|
SplitParentID: parentSplitParentID,
|
||||||
Attributes: obj.Attributes(),
|
Attributes: attributes,
|
||||||
}
|
}
|
||||||
|
|
||||||
ec := objectSDK.NewECHeader(ecParentInfo, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header)))
|
ec := objectSDK.NewECHeader(ecParentInfo, uint32(i), uint32(len(payloadShards)), headerShards[i], uint32(len(header)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue