Documentation ¶
Overview ¶
Package audit provides features to process data audit in FrostFS system.
Result type groups values which can be gathered during data audit process:
var res audit.Result res.ForEpoch(32) res.ForContainer(cnr) // ... res.Complete()
Result instances can be stored in a binary format. On reporter side:
data := res.Marshal() // send data
On receiver side:
var res audit.Result err := res.Unmarshal(data) // ...
Using package types in an application is recommended to potentially work with different protocol versions with which these types are compatible.
Index ¶
- type Result
- func (r Result) AuditorKey() []byte
- func (r *Result) Complete()
- func (r Result) Completed() bool
- func (r Result) Container() (cid.ID, bool)
- func (r Result) Epoch() uint64
- func (r Result) Failures() uint32
- func (r *Result) ForContainer(cnr cid.ID)
- func (r *Result) ForEpoch(epoch uint64)
- func (r Result) Hits() uint32
- func (r Result) IterateFailedStorageGroups(f func(oid.ID) bool)
- func (r Result) IterateFailedStorageNodes(f func([]byte) bool)
- func (r Result) IteratePassedStorageGroups(f func(oid.ID) bool)
- func (r Result) IteratePassedStorageNodes(f func([]byte) bool)
- func (r *Result) Marshal() []byte
- func (r Result) Misses() uint32
- func (r Result) RequestsPoR() uint32
- func (r Result) RetriesPoR() uint32
- func (r *Result) SetAuditorKey(key []byte)
- func (r *Result) SetFailures(fail uint32)
- func (r *Result) SetHits(hit uint32)
- func (r *Result) SetMisses(miss uint32)
- func (r *Result) SetRequestsPoR(v uint32)
- func (r *Result) SetRetriesPoR(v uint32)
- func (r *Result) SubmitFailedStorageGroup(sg oid.ID)
- func (r *Result) SubmitFailedStorageNodes(list [][]byte)
- func (r *Result) SubmitPassedStorageGroup(sg oid.ID)
- func (r *Result) SubmitPassedStorageNodes(list [][]byte)
- func (r *Result) Unmarshal(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result represents report on the results of the data audit in FrostFS system.
Result is mutually binary-compatible with github.com/TrueCloudLab/frostfs-api-go/v2/audit.DataAuditResult message. See Marshal / Unmarshal methods.
Instances can be created using built-in var declaration.
func (Result) AuditorKey ¶
AuditorKey returns public key of the auditing FrostFS Inner Ring node in a FrostFS binary key format.
Zero Result has nil key. Return value MUST NOT be mutated: to do this, first make a copy.
See also SetAuditorPublicKey.
func (*Result) Complete ¶
func (r *Result) Complete()
Complete marks the data audit associated with the Result as completed.
See also Completed.
func (Result) Completed ¶
Completed returns completion state of the data audit associated with the Result.
Zero Result corresponds to incomplete data audit.
See also Complete.
func (Result) Container ¶
Container returns identifier of the container with which the data audit Result is associated and a bool that indicates container ID field presence in the Result.
Zero Result does not have container ID.
See also ForContainer.
func (Result) Epoch ¶
Epoch returns FrostFS epoch when the data associated with the Result was audited.
Zero Result has zero epoch.
See also ForEpoch.
func (Result) Failures ¶
Failures returns number of sampled objects under audit stored in a way not confirming placement policy or not found at all when checking Proof-of-Placement.
Zero result has zero failures.
See also SetFailures.
func (*Result) ForContainer ¶
ForContainer sets identifier of the container with which the data audit Result is associated.
See also Container.
func (*Result) ForEpoch ¶
ForEpoch specifies FrostFS epoch when the data associated with the Result was audited.
See also Epoch.
func (Result) Hits ¶
Hits returns number of sampled objects under audit placed in an optimal way according to the container's placement policy when checking Proof-of-Placement.
Zero result has zero hits.
See also SetHits.
func (Result) IterateFailedStorageGroups ¶
IterateFailedStorageGroups is similar to IteratePassedStorageGroups but for failed groups.
See also SubmitFailedStorageGroup.
func (Result) IterateFailedStorageNodes ¶
IterateFailedStorageNodes is similar to IteratePassedStorageNodes but for failed nodes.
See also SubmitPassedStorageNodes.
func (Result) IteratePassedStorageGroups ¶
IteratePassedStorageGroups iterates over all storage groups that passed Proof-of-Retrievability audit check and passes them into f. Breaks on f's false return, f MUST NOT be nil.
Zero Result has no passed storage groups and doesn't call f.
See also SubmitPassedStorageGroup.
func (Result) IteratePassedStorageNodes ¶
IteratePassedStorageNodes iterates over all storage nodes that passed at least one Proof-of-Data-Possession audit check and passes their public keys into f. Breaks on f's false return.
f MUST NOT be nil and MUST NOT mutate parameter passed into it at least until the end of using the Result.
Zero Result has no passed storage nodes and doesn't call f.
See also SubmitPassedStorageNode.
func (*Result) Marshal ¶
Marshal encodes Result into a canonical FrostFS binary format (Protocol Buffers with direct field order).
Writes version.Current() protocol version into the resulting message if Result hasn't been already decoded from such a message using Unmarshal.
See also Unmarshal.
func (Result) Misses ¶
Misses returns number of sampled objects under audit placed in suboptimal way according to the container's placement policy, but still at a satisfactory level when checking Proof-of-Placement.
Zero Result has zero misses.
See also SetMisses.
func (Result) RequestsPoR ¶
RequestsPoR returns number of requests made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.
Zero Result has zero requests.
See also SetRequestsPoR.
func (Result) RetriesPoR ¶
RetriesPoR returns number of retries made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.
Zero Result has zero retries.
See also SetRetriesPoR.
func (*Result) SetAuditorKey ¶
SetAuditorKey specifies public key of the auditing FrostFS Inner Ring node in a FrostFS binary key format.
Argument MUST NOT be mutated at least until the end of using the Result.
See also AuditorKey.
func (*Result) SetFailures ¶
SetFailures sets number of sampled objects under audit stored in a way not confirming placement policy or not found at all when checking Proof-of-Placement.
See also Failures.
func (*Result) SetHits ¶
SetHits sets number of sampled objects under audit placed in an optimal way according to the containers placement policy when checking Proof-of-Placement.
See also Hits.
func (*Result) SetMisses ¶
SetMisses sets number of sampled objects under audit placed in suboptimal way according to the container's placement policy, but still at a satisfactory level when checking Proof-of-Placement.
See also Misses.
func (*Result) SetRequestsPoR ¶
SetRequestsPoR sets number of requests made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.
See also RequestsPoR.
func (*Result) SetRetriesPoR ¶
SetRetriesPoR sets number of retries made by Proof-of-Retrievability audit check to get all headers of the objects inside storage groups.
See also RetriesPoR.
func (*Result) SubmitFailedStorageGroup ¶
SubmitFailedStorageGroup is similar to SubmitPassedStorageGroup but for failed groups.
See also IterateFailedStorageGroups.
func (*Result) SubmitFailedStorageNodes ¶
SubmitFailedStorageNodes is similar to SubmitPassedStorageNodes but for failed nodes.
See also IterateFailedStorageNodes.
func (*Result) SubmitPassedStorageGroup ¶
SubmitPassedStorageGroup marks storage group as passed Proof-of-Retrievability audit check.
See also IteratePassedStorageGroups.
func (*Result) SubmitPassedStorageNodes ¶
SubmitPassedStorageNodes marks storage node list as passed Proof-of-Data-Possession audit check. The list contains public keys.
Argument and its elements MUST NOT be mutated at least until the end of using the Result.
See also IteratePassedStorageNodes.