More PR Feedback

This commit is contained in:
Neil Macneale IV
2025-02-13 15:44:57 -08:00
parent 2434b63eae
commit 77a4e59fc2
2 changed files with 4 additions and 9 deletions

View File

@@ -459,7 +459,7 @@ func (gcs *GenerationalNBS) GetChunkLocationsWithPaths(ctx context.Context, hash
return res, nil
}
func (gcs *GenerationalNBS) GetChunkLocations(ctx context.Context, hashes hash.HashSet) (map[string]map[hash.Hash]Range, error) {
func (gcs *GenerationalNBS) GetChunkLocations(ctx context.Context, hashes hash.HashSet) (map[hash.Hash]map[hash.Hash]Range, error) {
res, err := gcs.newGen.GetChunkLocations(ctx, hashes)
if err != nil {
return nil, err

View File

@@ -227,20 +227,15 @@ func (nbs *NomsBlockStore) getChunkLocations(ctx context.Context, hashes hash.Ha
}
func (nbs *NomsBlockStore) GetChunkLocations(ctx context.Context, hashes hash.HashSet) (map[string]map[hash.Hash]Range, error) {
func (nbs *NomsBlockStore) GetChunkLocations(ctx context.Context, hashes hash.HashSet) (map[hash.Hash]map[hash.Hash]Range, error) {
sourcesToRanges, err := nbs.getChunkLocations(ctx, hashes)
if err != nil {
return nil, err
}
res := make(map[string]map[hash.Hash]Range, len(hashes))
res := make(map[hash.Hash]map[hash.Hash]Range, len(hashes))
for csP, ranges := range sourcesToRanges {
cs := *csP
suffix := ""
if _, ok := cs.(archiveChunkSource); ok {
suffix = ArchiveFileSuffix
}
h := cs.hash()
res[h.String()+suffix] = ranges
res[cs.hash()] = ranges
}
return res, nil
}