forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(blooms): Correctly skip block page in case it exceeds the max pag…
…e size for querying (grafana#12297) Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
- Loading branch information
1 parent
813e665
commit 9736772
Showing
3 changed files
with
59 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
v1 "github.com/grafana/loki/pkg/storage/bloom/v1" | ||
) | ||
|
||
func main() { | ||
if len(os.Args) < 2 { | ||
fmt.Println("Usage: go run main.go BLOCK_DIRECTORY") | ||
os.Exit(2) | ||
} | ||
|
||
path := os.Args[1] | ||
fmt.Printf("Block directory: %s\n", path) | ||
|
||
r := v1.NewDirectoryBlockReader(path) | ||
b := v1.NewBlock(r) | ||
q := v1.NewBlockQuerier(b) | ||
|
||
md, err := q.Metadata() | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
fmt.Printf("Metadata: %+v\n", md) | ||
|
||
for q.Next() { | ||
swb := q.At() | ||
fmt.Printf("%s (%d)\n", swb.Series.Fingerprint, swb.Series.Chunks.Len()) | ||
} | ||
if q.Err() != nil { | ||
fmt.Printf("error: %s\n", q.Err()) | ||
} | ||
} |