[#645] blobtree: Add .data extension for data files

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-10-09 10:13:21 +03:00
parent 41f94fe18f
commit 2f6d4a49dc
2 changed files with 4 additions and 2 deletions

View file

@ -21,6 +21,8 @@ const (
sizeOfDataLength = 8
sizeOfContainerID = sha256.Size
sizeOfObjectID = sha256.Size
dataExtension = ".data"
)
var (
@ -187,5 +189,5 @@ func (b *BlobTree) estimateSize(records []objectData) uint64 {
}
func (b *BlobTree) getFilePath(dir string, idx uint64) string {
return filepath.Join(dir, strconv.FormatUint(idx, 16))
return filepath.Join(dir, strconv.FormatUint(idx, 16)+dataExtension)
}

View file

@ -78,7 +78,7 @@ func (b *BlobTree) isTempFile(name string) bool {
}
func (b *BlobTree) parseIdx(name string) (uint64, error) {
return strconv.ParseUint(name, 16, 64)
return strconv.ParseUint(strings.TrimSuffix(name, dataExtension), 16, 64)
}
func (b *BlobTree) Close() error {