MCPcopy
hub / github.com/cubefs/cubefs / StatChunk

Method StatChunk

blobstore/blobnode/client/blobnode_cli.go:88–98  ·  view source on GitHub ↗

StatChunk returns chunk stat

(ctx context.Context, location proto.VunitLocation)

Source from the content-addressed store, hash-verified

86
87// StatChunk returns chunk stat
88func (c *BlobNodeClient) StatChunk(ctx context.Context, location proto.VunitLocation) (ci *ChunkInfo, err error) {
89 ctx = trace.NewContextFromContext(ctx)
90 span := trace.SpanFromContext(ctx).WithOperation("StatChunk")
91 info, err := c.cli.StatChunk(ctx, location.Host, &api.StatChunkArgs{DiskID: location.DiskID, Vuid: location.Vuid})
92 if err != nil {
93 span.Debugf("StatChunk failed: location[%+v], code[%d], err[%v]", location, rpc.DetectStatusCode(err), err)
94 return
95 }
96 span.Debugf("StatChunk success: chunk info[%+v], location[%+v]", info, location)
97 return &ChunkInfo{ChunkInfo: *info}, nil
98}
99
100// GetShard returns shard data
101func (c *BlobNodeClient) GetShard(ctx context.Context, location proto.VunitLocation, bid proto.BlobID, ioType api.IOType) (body io.ReadCloser, crc32 uint32, err error) {

Callers

nothing calls this directly

Calls 6

NewContextFromContextFunction · 0.92
SpanFromContextFunction · 0.92
DetectStatusCodeFunction · 0.92
WithOperationMethod · 0.65
StatChunkMethod · 0.65
DebugfMethod · 0.65

Tested by

no test coverage detected