public class CacheWriter extends Object
UnwrittenLayers to the cache.| Constructor and Description |
|---|
CacheWriter(Cache cache) |
| Modifier and Type | Method and Description |
|---|---|
CachedLayer |
getCachedLayer(long layerSize,
DescriptorDigest layerDigest)
Gets the layer that was cached by writing the contents to a file in the cache.
|
com.google.common.io.CountingOutputStream |
getLayerOutputStream(DescriptorDigest layerDigest) |
CachedLayerWithMetadata |
writeLayer(ReproducibleLayerBuilder reproducibleLayerBuilder)
Builds an
UnwrittenLayer from a ReproducibleLayerBuilder and compresses and
writes the UnwrittenLayer's uncompressed layer content BLOB to cache. |
public CacheWriter(Cache cache)
public CachedLayerWithMetadata writeLayer(ReproducibleLayerBuilder reproducibleLayerBuilder) throws IOException
UnwrittenLayer from a ReproducibleLayerBuilder and compresses and
writes the UnwrittenLayer's uncompressed layer content BLOB to cache.reproducibleLayerBuilder - the layer builderLayerMetadataIOException - if writing the layer to file failspublic com.google.common.io.CountingOutputStream getLayerOutputStream(DescriptorDigest layerDigest) throws IOException
layerDigest - the written layer's digest.CountingOutputStream to write to to cache a layer with the specified
compressed digest.IOException - if writing to the layer file's output stream fails.public CachedLayer getCachedLayer(long layerSize, DescriptorDigest layerDigest) throws IOException
CachedLayer should be added to the cache metadata.layerSize - the size of the layerlayerDigest - the digest of the layer to retrieveCachedLayer from a layer digest and the CountingOutputStream the
layer BLOB was written toIOException - if closing the output stream or getting the layer diff ID failsCopyright © 2018. All rights reserved.