MCPcopy Create free account
hub / github.com/akalin/gopar / VerifyAllData

Method VerifyAllData

par1/decoder.go:368–377  ·  view source on GitHub ↗

VerifyAllData checks and returns whether all data and parity files contain correct data. Note that this is worth calling only when there are no unusable data or parity files, since if there are, then false is guaranteed to be returned for ok.

()

Source from the content-addressed store, hash-verified

366// there are no unusable data or parity files, since if there are,
367// then false is guaranteed to be returned for ok.
368func (d *Decoder) VerifyAllData() (ok bool, err error) {
369 rs, err := d.newReedSolomon()
370 if err != nil {
371 return false, err
372 }
373
374 shards := d.buildShards()
375
376 return rs.Verify(shards)
377}
378
379// Repair tries to repair any missing or corrupt data, using the
380// parity volumes. Returns a list of paths to files that were

Callers 4

testCreateFunction · 0.80
verifyFunction · 0.80
testWriteParityFunction · 0.80
testVerifyAllDataFunction · 0.80

Calls 2

newReedSolomonMethod · 0.95
buildShardsMethod · 0.95

Tested by 3

testCreateFunction · 0.64
testWriteParityFunction · 0.64
testVerifyAllDataFunction · 0.64