MCPcopy
hub / github.com/cubefs/cubefs / directGetShard

Method directGetShard

blobstore/blobnode/work_shard_recover.go:498–516  ·  view source on GitHub ↗
(ctx context.Context, repairBids []proto.BlobID, repairIdxs []uint8)

Source from the content-addressed store, hash-verified

496}
497
498func (r *ShardRecover) directGetShard(ctx context.Context, repairBids []proto.BlobID, repairIdxs []uint8) (failBids []proto.BlobID, allocBufErr error) {
499 span := trace.SpanFromContextSafe(ctx)
500 span.Info("start direct get shard")
501
502 allocBufErr = r.allocBuf(ctx, repairIdxs)
503 if allocBufErr != nil {
504 return nil, allocBufErr
505 }
506 replicas := make(Vunits, len(repairIdxs))
507 for i, idx := range repairIdxs {
508 replicas[i] = r.replicas[idx]
509 }
510
511 r.download(ctx, repairBids, replicas)
512 failBids = r.collectFailBids(repairBids, repairIdxs)
513 span.Infof("end direct get shard: failBids len[%d], allocBufErr[%+v]", len(failBids), allocBufErr)
514
515 return failBids, allocBufErr
516}
517
518func (r *ShardRecover) recoverByLocalStripe(ctx context.Context, repairBids []proto.BlobID, repairIdxs []uint8) (err error) {
519 span := trace.SpanFromContextSafe(ctx)

Callers 2

RecoverShardsMethod · 0.95
testDirectGetShardFunction · 0.80

Calls 6

allocBufMethod · 0.95
downloadMethod · 0.95
collectFailBidsMethod · 0.95
SpanFromContextSafeFunction · 0.92
InfoMethod · 0.65
InfofMethod · 0.65

Tested by 1

testDirectGetShardFunction · 0.64