-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/cleanup-js-dependencies
- Loading branch information
Showing
33 changed files
with
1,030 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package storage | ||
|
||
import ( | ||
"fmt" | ||
metastorev1 "github.com/grafana/pyroscope/api/gen/proto/go/metastore/v1" | ||
"github.com/grafana/pyroscope/pkg/tenant" | ||
"path" | ||
"strings" | ||
) | ||
|
||
const PathDLQ = "dlq" | ||
|
||
const pathSegments = "segments" | ||
const pathAnon = tenant.DefaultTenantID | ||
const pathBlock = "block.bin" | ||
const pathMetaPB = "meta.pb" | ||
|
||
func PathForDLQ(meta *metastorev1.BlockMeta) string { | ||
return path.Join(PathDLQ, fmt.Sprintf("%d", meta.Shard), pathAnon, meta.Id, pathMetaPB) | ||
} | ||
|
||
func PathForSegment(meta *metastorev1.BlockMeta) string { | ||
return path.Join(pathSegments, fmt.Sprintf("%d", meta.Shard), pathAnon, meta.Id, pathBlock) | ||
} | ||
|
||
func IsDLQPath(p string) bool { | ||
fs := strings.Split(p, "/") | ||
return len(fs) == 5 && fs[0] == PathDLQ && fs[2] == pathAnon && fs[4] == pathMetaPB | ||
} | ||
|
||
func IsSegmentPath(p string) bool { | ||
fs := strings.Split(p, "/") | ||
return len(fs) == 5 && fs[0] == pathSegments && fs[2] == pathAnon && fs[4] == pathBlock | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.