Skip to content

Commit

Permalink
jpe cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <number101010@gmail.com>
  • Loading branch information
joe-elliott committed Feb 4, 2021
1 parent 0b572f5 commit 0e84c94
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tempodb/encoding/backend_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type BackendBlock struct {
func NewBackendBlock(meta *backend.BlockMeta, r backend.Reader) (*BackendBlock, error) {
var encoding versionedEncoding

switch meta.Version { // jpe need a way to test this
switch meta.Version {
case "v0":
encoding = v0Encoding{}
case "v1":
Expand Down
2 changes: 1 addition & 1 deletion tempodb/encoding/complete_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type CompleteBlock struct {
// NewCompleteBlock creates a new block and takes _ALL_ the parameters necessary to build the ordered, deduped file on disk
func NewCompleteBlock(cfg *BlockConfig, originatingMeta *backend.BlockMeta, iterator common.Iterator, estimatedObjects int, filepath string, walFilename string) (*CompleteBlock, error) {
c := &CompleteBlock{
encoding: latestEncoding(), // jpe - wut
encoding: latestEncoding(),
meta: backend.NewBlockMeta(originatingMeta.TenantID, uuid.New(), currentVersion, cfg.Encoding),
bloom: common.NewWithEstimates(uint(estimatedObjects), cfg.BloomFP),
records: make([]*common.Record, 0),
Expand Down
5 changes: 4 additions & 1 deletion tempodb/encoding/v1/appender_buffered.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import (
v0 "github.com/grafana/tempo/tempodb/encoding/v0"
)

// meteredWriter exists jpe
// meteredWriter is a struct that is used to count the number of bytes
// written to a block after compression. Unfortunately the compression io.Reader
// returns bytes before compression so this is necessary to know the actual number of
// byte written.
type meteredWriter struct {
wrappedWriter io.Writer
bytesWritten int
Expand Down
6 changes: 2 additions & 4 deletions tempodb/encoding/v1/finder_paged.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import (
v0 "github.com/grafana/tempo/tempodb/encoding/v0"
)

// jpe comment
// NewPagedFinder returns a pagedFinder. This finder is used for searching
// a set of records and returning an object. If a set of consecutive records has
// matching ids they will be combined using the ObjectCombiner.
// NewPagedFinder returns a v0.pagedFinder. There are no changes
// to logic from the v0 finder and all compression changes are handled in the pageReader
func NewPagedFinder(index common.IndexReader, r common.PageReader, combiner common.ObjectCombiner) common.Finder {
return v0.NewPagedFinder(index, r, combiner)
}
5 changes: 2 additions & 3 deletions tempodb/encoding/v1/iterator_paged.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
v0 "github.com/grafana/tempo/tempodb/encoding/v0"
)

// jpe comment
// NewPagedIterator returns a backendIterator. This iterator is used to iterate
// through objects stored in object storage.
// NewPagedIterator returns a v0.backendIterator. There are no changes
// to logic from the v0 iterator and all compression changes are handled in the pageReader
func NewPagedIterator(chunkSizeBytes uint32, indexReader common.IndexReader, pageReader common.PageReader) common.Iterator {
return v0.NewPagedIterator(chunkSizeBytes, indexReader, pageReader)
}
2 changes: 1 addition & 1 deletion tempodb/encoding/versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type versionedEncoding interface {
appendBlockData(ctx context.Context, w backend.Writer, meta *backend.BlockMeta, tracker backend.AppendTracker, buffer []byte) (backend.AppendTracker, error)

newPageReader(ra io.ReaderAt, encoding backend.Encoding) (common.PageReader, error)
newIndexReader(indexBytes []byte) (common.IndexReader, error) // jpe make this newindexreader
newIndexReader(indexBytes []byte) (common.IndexReader, error)

nameIndex() string
nameObjects() string
Expand Down

0 comments on commit 0e84c94

Please sign in to comment.