mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-25 03:05:52 -05:00
Add CompressedSize method to ToChunker
This commit is contained in:
@@ -99,3 +99,8 @@ func (a ArchiveToChunker) IsGhost() bool {
|
||||
// archives are never ghosts. They are only instantiated when the chunk is found.
|
||||
return false
|
||||
}
|
||||
|
||||
// CompressedSize returns the size of the compressed chunk data, but does not include the size of the dictionary.
|
||||
func (a ArchiveToChunker) CompressedSize() uint32 {
|
||||
return uint32(len(a.chunkData))
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ type ToChunker interface {
|
||||
Hash() hash.Hash
|
||||
ToChunk() (chunks.Chunk, error)
|
||||
IsEmpty() bool
|
||||
CompressedSize() uint32
|
||||
IsGhost() bool
|
||||
}
|
||||
|
||||
@@ -118,9 +119,9 @@ func (cmp CompressedChunk) IsGhost() bool {
|
||||
return cmp.ghost
|
||||
}
|
||||
|
||||
// CompressedSize returns the size of this CompressedChunk.
|
||||
func (cmp CompressedChunk) CompressedSize() int {
|
||||
return len(cmp.CompressedData)
|
||||
// CompressedSize returns on disk size of the compressed chunk. Includes crc.
|
||||
func (cmp CompressedChunk) CompressedSize() uint32 {
|
||||
return uint32(len(cmp.FullCompressedChunk))
|
||||
}
|
||||
|
||||
var EmptyCompressedChunk CompressedChunk
|
||||
|
||||
Reference in New Issue
Block a user