(ctx context.Context, blobID blob.ID, blobData *gather.WriteBuffer)
| 95 | } |
| 96 | |
| 97 | func (c *contentCacheImpl) fetchBlobInternal(ctx context.Context, blobID blob.ID, blobData *gather.WriteBuffer) error { |
| 98 | // read the entire blob |
| 99 | if err := c.st.GetBlob(ctx, blobID, 0, -1, blobData); err != nil { |
| 100 | c.pc.reportMissError() |
| 101 | |
| 102 | return errors.Wrapf(err, "failed to get blob with ID %s", blobID) |
| 103 | } |
| 104 | |
| 105 | c.pc.reportMissBytes(int64(blobData.Length())) |
| 106 | |
| 107 | // store the whole blob in the cache. |
| 108 | c.pc.Put(ctx, BlobIDCacheKey(blobID), blobData.Bytes()) |
| 109 | |
| 110 | return nil |
| 111 | } |
| 112 | |
| 113 | func (c *contentCacheImpl) getContentFromFullOrPartialBlob(ctx context.Context, contentID string, blobID blob.ID, offset, length int64, output *gather.WriteBuffer) error { |
| 114 | // acquire shared lock on a blob, PrefetchBlob will acquire exclusive lock here. |
no test coverage detected