[#645] blobtree: Add .data
extension for data files
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
41f94fe18f
commit
2f6d4a49dc
2 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue